-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from alercebroker/feature/alerts-api-deploy
Feature/alerts api deploy
- Loading branch information
Showing
150 changed files
with
503 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
appVersion: 23.12.1-rc8 | ||
description: ALeRCE API | ||
name: alerts-api | ||
type: application | ||
version: 23.12.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "alerts-api.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "alerts-api.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "alerts-api.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "alerts-api.labels" -}} | ||
helm.sh/chart: {{ include "alerts-api.chart" . }} | ||
{{ include "alerts-api.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "alerts-api.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "alerts-api.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "alerts-api.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "alerts-api.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "imagePullSecret" }} | ||
{{- with .Values.imageCredentials }} | ||
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "alerts-api.fullname" . }} | ||
namespace: {{ .Values.namespace }} | ||
data: | ||
port: '{{ .Values.configmap.port }}' | ||
api-url: '{{ .Values.configmap.apiUrl }}' | ||
app-workers: '{{ .Values.configmap.appWorkers }}' | ||
threads: '{{ .Values.configmap.threads }}' | ||
log-level: '{{ .Values.configmap.logLevel }}' | ||
--- | ||
apiVersion: v1 | ||
metadata: | ||
name: alerts-api-nginx-conf | ||
namespace: {{ .Values.namespace }} | ||
data: | ||
default.conf: | | ||
server { | ||
listen 80; | ||
location /v1/alerts/ { | ||
proxy_pass http://localhost:5000/; | ||
proxy_redirect off; | ||
proxy_set_header X-Forwarded-Prefix /v1/alerts/; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Forwarded-Host $http_host; | ||
} | ||
location /v1/alerts { | ||
proxy_pass http://localhost:5000/; | ||
proxy_redirect off; | ||
proxy_set_header X-Forwarded-Prefix /v1/alerts; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Forwarded-Host $http_host; | ||
} | ||
location / { | ||
proxy_pass http://localhost:5000/; | ||
} | ||
} | ||
kind: ConfigMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "alerts-api.fullname" . }} | ||
namespace: {{ .Values.namespace }} | ||
labels: | ||
{{- include "alerts-api.labels" . | nindent 4 }} | ||
spec: | ||
{{- if not .Values.autoscaling.enabled }} | ||
replicas: {{ .Values.replicaCount }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "alerts-api.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "alerts-api.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
env: | ||
- name: PORT | ||
valueFrom: | ||
configMapKeyRef: | ||
name: {{ include "alerts-api.fullname" . }} | ||
key: port | ||
- name: API_URL | ||
valueFrom: | ||
configMapKeyRef: | ||
name: {{ include "alerts-api.fullname" . }} | ||
key: api-url | ||
- name: APP_WORKERS | ||
valueFrom: | ||
configMapKeyRef: | ||
name: {{ include "alerts-api.fullname" . }} | ||
key: app-workers | ||
- name: THREADS | ||
valueFrom: | ||
configMapKeyRef: | ||
name: {{ include "alerts-api.fullname" . }} | ||
key: threads | ||
- name: LOG_LEVEL | ||
valueFrom: | ||
configMapKeyRef: | ||
name: {{ include "alerts-api.fullname" . }} | ||
key: log-level | ||
- name: PSQL_HOST | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: sql-host | ||
- name: PSQL_DATABASE | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: sql-database | ||
- name: PSQL_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: sql-user | ||
- name: PSQL_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: sql-password | ||
- name: PSQL_PORT | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: sql-port | ||
- name: MONGO_HOST | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: mongo-host | ||
- name: MONGO_DATABASE | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: mongo-database | ||
- name: MONGO_AUTH_SOURCE | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: mongo-auth-source | ||
- name: MONGO_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: mongo-user | ||
- name: MONGO_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: mongo-password | ||
- name: MONGO_PORT | ||
valueFrom: | ||
secretKeyRef: | ||
name: database-auth | ||
key: mongo-port | ||
- name: SECRET_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: secret-key | ||
key: secret-key | ||
- name: nginx-sidecar | ||
image: nginx | ||
ports: | ||
- containerPort: 80 | ||
volumeMounts: | ||
- name: nginx-conf | ||
mountPath: /etc/nginx/conf.d/default.conf | ||
subPath: default.conf | ||
resources: | ||
requests: | ||
memory: 64M | ||
cpu: 50m | ||
volumes: | ||
- name: nginx-conf | ||
configMap: | ||
name: alerts-api-nginx-conf | ||
items: | ||
- key: "default.conf" | ||
path: "default.conf" | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
Oops, something went wrong.