-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e768505
commit 8dbc907
Showing
18 changed files
with
384 additions
and
228 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
k8s/nginx/*/global-config.yaml | ||
k8s/*/templates/ | ||
k8s/**/templates/ |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
apiVersion: v1 | ||
appVersion: "1.0" | ||
apiVersion: v2 | ||
appVersion: "1.16.0" | ||
description: AirQo Prediction Helm Chart | ||
name: airqo-prediction-api | ||
home: https://airqo.net | ||
version: 0.1.0 | ||
maintainers: | ||
maintainers: | ||
- name: AirQo | ||
email: [email protected] | ||
url: https://airqo.net |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "airqo-prediction-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 "airqo-prediction-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 "airqo-prediction-api.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "airqo-prediction-api.labels" -}} | ||
helm.sh/chart: {{ include "airqo-prediction-api.chart" . }} | ||
{{ include "airqo-prediction-api.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "airqo-prediction-api.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "airqo-prediction-api.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- 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,82 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Values.app.name }} | ||
namespace: {{ .Values.app.namespace }} | ||
labels: | ||
{{- include "airqo-prediction-api.labels" . | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {{ .Values.app.label }} | ||
replicas: {{ .Values.replicaCount }} | ||
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} | ||
{{- with .Values.strategy }} | ||
strategy: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
minReadySeconds: {{ .Values.minReadySeconds }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
app: {{ .Values.app.label }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: {{ .Values.app.label }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- containerPort: {{ .Values.service.targetPort }} | ||
name: {{ .Values.app.label }} | ||
# livenessProbe: | ||
# httpGet: | ||
# path: /health | ||
# port: 5000 | ||
# readinessProbe: | ||
# httpGet: | ||
# path: /health | ||
# port: 5000 | ||
# initialDelaySecond: 5 | ||
# periodSeconds: 3 | ||
# successThreshold: 1 | ||
envFrom: | ||
- configMapRef: | ||
name: {{ .Values.app.configmap }} | ||
{{- with .Values.env }} | ||
env: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.volumeMounts }} | ||
volumeMounts: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.volumes }} | ||
volumes: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- 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,31 @@ | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: '{{ .Values.app.name }}-hpa' | ||
namespace: {{ .Values.app.namespace }} | ||
labels: | ||
{{- include "airqo-prediction-api.labels" . | nindent 4 }} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ .Values.app.name }} | ||
minReplicas: {{ .Values.autoscaling.minReplicas }} | ||
maxReplicas: {{ .Values.autoscaling.maxReplicas }} | ||
metrics: | ||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} | ||
{{- end }} | ||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: memory | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} | ||
{{- 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,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: "{{ .Values.app.name }}-svc" | ||
labels: { { - include "airqo-prediction-api.labels" . | nindent 4 } } | ||
namespace: { { .Values.app.namespace } } | ||
spec: | ||
type: { { .Values.service.type } } | ||
ports: | ||
- port: { { .Values.service.port } } | ||
targetPort: { { .Values.service.targetPort } } | ||
protocol: { { .Values.service.protocol } } | ||
nodePort: { { .Values.service.nodePort } } | ||
selector: | ||
app: { { .Values.app.label } } |
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,15 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: "{{ include "airqo-prediction-api.fullname" . }}-test-connection" | ||
labels: | ||
{{ include "airqo-prediction-api.labels" . | indent 4 }} | ||
annotations: | ||
"helm.sh/hook": test-success | ||
spec: | ||
containers: | ||
- name: wget | ||
image: busybox | ||
command: ['wget'] | ||
args: ['{{ include "airqo-prediction-api.fullname" . }}:{{ .Values.service.port }}'] | ||
restartPolicy: Never |
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,90 @@ | ||
app: | ||
name: airqo-prediction-api | ||
label: prediction-api | ||
namespace: production | ||
configmap: env-predict-production | ||
|
||
replicaCount: 3 | ||
|
||
revisionHistoryLimit: 2 | ||
|
||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 1 | ||
|
||
minReadySeconds: 5 | ||
|
||
affinity: | ||
nodeAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- weight: 10 | ||
preference: | ||
matchExpressions: | ||
- key: node-type | ||
operator: In | ||
values: | ||
- general-purpose | ||
|
||
image: | ||
repository: gcr.io/airqo-250220/airqo-prediction-api | ||
pullPolicy: Always | ||
tag: latest | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
podAnnotations: {} | ||
|
||
podSecurityContext: | ||
{} | ||
# fsGroup: 2000 | ||
|
||
securityContext: | ||
{} | ||
# capabilities: | ||
# drop: | ||
# - ALL | ||
# readOnlyRootFilesystem: true | ||
# runAsNonRoot: true | ||
# runAsUser: 1000 | ||
|
||
resources: | ||
limits: | ||
cpu: 50m | ||
memory: 200Mi | ||
requests: | ||
# Average usage was 0.0007 vCPU and 120Mi over the last 30 days | ||
cpu: 5m | ||
memory: 120Mi | ||
|
||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/config | ||
|
||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: env-predict-production-files | ||
|
||
nodeSelector: {} | ||
|
||
tolerations: [] | ||
|
||
ingress: | ||
enabled: false | ||
|
||
service: | ||
type: NodePort | ||
port: 5000 | ||
protocol: TCP | ||
targetPort: 5000 | ||
nodePort: 30009 | ||
|
||
autoscaling: | ||
minReplicas: 1 | ||
maxReplicas: 3 | ||
# targetCPUUtilizationPercentage: 70 | ||
targetMemoryUtilizationPercentage: 70 |
Oops, something went wrong.