diff --git a/chart/Chart.yaml b/chart/Chart.yaml index a2af8586403ee7f19b9161db8a5a9d31e3604f4d..73b3ac562ecc21a369a34a1f5117ab948e7d11c2 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -24,6 +24,6 @@ appVersion: 2.1.0 # list dependencies dependencies: -#- name: rabbitmq -# version: "8.30" -# repository: "https://charts.bitnami.com/bitnami" +- name: rabbitmq + version: "8.30" + repository: "https://charts.bitnami.com/bitnami" diff --git a/chart/templates/deployment-back.yaml b/chart/templates/deployment-back.yaml new file mode 100644 index 0000000000000000000000000000000000000000..28c1f0fba02787c84232edd7610d3a5895c63c12 --- /dev/null +++ b/chart/templates/deployment-back.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ printf "%s-%s" .Release.Name "back" }} + labels: + {{- include "chart.labels" . | nindent 4 }} + app: back +spec: + selector: + matchLabels: + {{- include "chart.selectorLabels" . | nindent 6 }} + app: back + strategy: + type: Recreate + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "chart.selectorLabels" . | nindent 8 }} + app: back + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: back + image: {{ printf "%s/%s/%s:%s" .Values.CI_REGISTRY_IMAGE .Release.Name "backend" .Values.image.tag }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + resources: + {{- toYaml .Values.back.resources | nindent 12 }} + volumeMounts: + - mountPath: /code/data_persistent + name: data-files + volumes: + - name: data-files + persistentVolumeClaim: + claimName: {{ printf "%s-data-files" .Release.Name }} \ No newline at end of file diff --git a/chart/templates/deployment-celery-worker.yaml b/chart/templates/deployment-celery-worker.yaml new file mode 100644 index 0000000000000000000000000000000000000000..aefca8bd7254433f60e80deec20a83fb919d6ac9 --- /dev/null +++ b/chart/templates/deployment-celery-worker.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ printf "%s-%s" .Release.Name "celery" }} + labels: + {{- include "chart.labels" . | nindent 4 }} + app: celery-worker +spec: + selector: + matchLabels: + {{- include "chart.selectorLabels" . | nindent 6 }} + app: celery-worker + strategy: + type: Recreate + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "chart.selectorLabels" . | nindent 8 }} + app: celery-worker + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: celery + image: {{ printf "%s/%s/%s:%s" .Values.CI_REGISTRY_IMAGE .Release.Name "backend" .Values.image.tag }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + command: + - "celery" + - "-A" + - "jass" + - "worker" + {{- if .Values.celery.concurrency }} + - "--concurrency={{ .Values.celery.concurrency }}" + {{- end }} + {{- if .Values.celery.maxTasksPerChild }} + - "--max-tasks-per-child={{ .Values.celery.maxTasksPerChild }}" + {{- end }} + resources: + {{- toYaml .Values.celery.resources | nindent 12 }} + volumeMounts: + - mountPath: /code/data_persistent + name: data-files + volumes: + - name: data-files + persistentVolumeClaim: + claimName: {{ printf "%s-data-files" .Release.Name }} \ No newline at end of file diff --git a/chart/templates/deployment-client.yaml b/chart/templates/deployment-client.yaml new file mode 100644 index 0000000000000000000000000000000000000000..63f6ca92e7e76b194958b79b9a0389ee9d2a3e7b --- /dev/null +++ b/chart/templates/deployment-client.yaml @@ -0,0 +1,37 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ printf "%s-%s" .Release.Name "client" }} + labels: + {{- include "chart.labels" . | nindent 4 }} + app: client +spec: + selector: + matchLabels: + {{- include "chart.selectorLabels" . | nindent 6 }} + app: client + strategy: + type: Recreate + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "chart.selectorLabels" . | nindent 8 }} + app: client + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: nginx + image: {{ printf "%s/%s/%s:%s" .Values.CI_REGISTRY_IMAGE .Release.Name "client-static-serve" .Values.image.tag }} + securityContext: + {{- toYaml .Values.client.securityContext | nindent 12 }} + resources: + {{- toYaml .Values.client.resources | nindent 12 }} \ No newline at end of file diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e28543b09377473334ab63360e5bea2b8fdb420b --- /dev/null +++ b/chart/templates/ingress.yaml @@ -0,0 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "chart.fullname" . -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "chart.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + - host: {{ .Values.ingress.host.name | quote }} + http: + paths: + - path: /api/* + pathType: Prefix + backend: + service: + name: {{ printf "%s-%s" .Release.Name "back" }} + port: + number: 8080 + - path: / + pathType: Prefix + backend: + service: + name: {{ printf "%s-%s" .Release.Name "client" }} + port: + number: 8080 + {{- end }} diff --git a/chart/templates/service-back.yaml b/chart/templates/service-back.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2bbb20774d427edadd346e6026a3ee094e8f10b8 --- /dev/null +++ b/chart/templates/service-back.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ printf "%s-%s" .Release.Name "back" }} + labels: + {{- include "chart.labels" . | nindent 4 }} + app: back +spec: + type: ClusterIP + ports: + - name: server + port: 8080 + targetPort: 8080 + selector: + {{- include "chart.selectorLabels" . | nindent 4 }} + app: back diff --git a/chart/templates/service-client.yaml b/chart/templates/service-client.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1fd4de45daf9f650f13454c71fdb5b6c75d46005 --- /dev/null +++ b/chart/templates/service-client.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ printf "%s-%s" .Release.Name "client" }} + labels: + {{- include "chart.labels" . | nindent 4 }} + app: client +spec: + type: ClusterIP + ports: + - name: server + port: 8080 + targetPort: 8080 + selector: + {{- include "chart.selectorLabels" . | nindent 4 }} + app: client diff --git a/chart/values.yaml b/chart/values.yaml index 44b4e94356e9432ad1d96ca77c04da6fe7dfb5d8..0e2c186de8598a621fb58e646d18f8266b30584a 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -49,6 +49,47 @@ ingress: host: name: chart-example.local +celery: + resources: + requests: + memory: 4Gi + cpu: 1000m + limits: + memory: 4Gi + cpu: 2000m + concurrency: 1 + maxTasksPerChild: 1 + +back: + resources: + requests: + memory: 2Gi + cpu: 1000m + limits: + memory: 4Gi + cpu: 2000m + data: size: 50Gi storageClassName: isilon + +client: + securityContext: + runAsNonRoot: true + runAsUser: 101 + runAsGroup: 101 + resources: + requests: + memory: 256Mi + cpu: 500m + limits: + memory: 512Mi + cpu: 1000m + +rabbitmq: + rbac: + create: false + persistence: + size: 1Gi + clustering: + enabled: false