From d53491a2c2f9cca6a45ef4a6edea22822ec121a9 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 16:42:14 +0200 Subject: [PATCH 01/15] Add initial Helm chart for celery-beat with configuration and templates --- helm/capif/charts/celery-beat/.helmignore | 23 ++++ helm/capif/charts/celery-beat/Chart.yaml | 24 ++++ helm/capif/charts/celery-beat/README.md | 67 +++++++++++ .../charts/celery-beat/templates/NOTES.txt | 8 ++ .../charts/celery-beat/templates/_helpers.tpl | 62 ++++++++++ .../celery-beat/templates/configmap.yaml | 14 +++ .../celery-beat/templates/deployment.yaml | 70 +++++++++++ .../charts/celery-beat/templates/hpa.yaml | 32 +++++ .../charts/celery-beat/templates/ingress.yaml | 61 ++++++++++ .../celery-beat/templates/serviceaccount.yaml | 13 ++ helm/capif/charts/celery-beat/values.yaml | 113 ++++++++++++++++++ 11 files changed, 487 insertions(+) create mode 100644 helm/capif/charts/celery-beat/.helmignore create mode 100644 helm/capif/charts/celery-beat/Chart.yaml create mode 100644 helm/capif/charts/celery-beat/README.md create mode 100644 helm/capif/charts/celery-beat/templates/NOTES.txt create mode 100644 helm/capif/charts/celery-beat/templates/_helpers.tpl create mode 100644 helm/capif/charts/celery-beat/templates/configmap.yaml create mode 100644 helm/capif/charts/celery-beat/templates/deployment.yaml create mode 100644 helm/capif/charts/celery-beat/templates/hpa.yaml create mode 100644 helm/capif/charts/celery-beat/templates/ingress.yaml create mode 100644 helm/capif/charts/celery-beat/templates/serviceaccount.yaml create mode 100644 helm/capif/charts/celery-beat/values.yaml diff --git a/helm/capif/charts/celery-beat/.helmignore b/helm/capif/charts/celery-beat/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/helm/capif/charts/celery-beat/.helmignore @@ -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/ diff --git a/helm/capif/charts/celery-beat/Chart.yaml b/helm/capif/charts/celery-beat/Chart.yaml new file mode 100644 index 00000000..35c2eb3f --- /dev/null +++ b/helm/capif/charts/celery-beat/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: celery-beat +description: A Helm chart for Kubernetes of celery-beat + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/helm/capif/charts/celery-beat/README.md b/helm/capif/charts/celery-beat/README.md new file mode 100644 index 00000000..ae8c323f --- /dev/null +++ b/helm/capif/charts/celery-beat/README.md @@ -0,0 +1,67 @@ +# celery-beat + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) + +A Helm chart for Kubernetes of celery-beat + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| env.capifHostname | string | `"capif"` | | +| env.logLevel | string | `"INFO"` | | +| env.mongoInitdbRootPassword | string | `"example"` | | +| env.mongoInitdbRootUsername | string | `"root"` | | +| env.monitoring | string | `"true"` | | +| env.vaultAccessToken | string | `"dev-only-token"` | | +| env.vaultHostname | string | `"vault"` | | +| env.vaultPort | int | `8200` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"celery-beat"` | | +| image.tag | string | `""` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| livenessProbe | string | `nil` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podLabels | object | `{}` | | +| podSecurityContext | object | `{}` | | +| readinessProbe.initialDelaySeconds | int | `10` | | +| readinessProbe.periodSeconds | int | `5` | | +| readinessProbe.tcpSocket.port | int | `8080` | | +| replicaCount | int | `1` | | +| resources.limits.cpu | string | `"100m"` | | +| resources.limits.memory | string | `"128Mi"` | | +| resources.requests.cpu | string | `"100m"` | | +| resources.requests.memory | string | `"128Mi"` | | +| securityContext | object | `{}` | | +| service.port | int | `8080` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.automount | bool | `true` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| tolerations | list | `[]` | | +| volumeMounts[0].mountPath | string | `"/usr/src/app/config.yaml"` | | +| volumeMounts[0].name | string | `"capif-invocation-config"` | | +| volumeMounts[0].subPath | string | `"config.yaml"` | | +| volumes[0].configMap.items[0].key | string | `"config.yaml"` | | +| volumes[0].configMap.items[0].path | string | `"config.yaml"` | | +| volumes[0].configMap.name | string | `"celery-beat-configmap"` | | +| volumes[0].name | string | `"capif-invocation-config"` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/helm/capif/charts/celery-beat/templates/NOTES.txt b/helm/capif/charts/celery-beat/templates/NOTES.txt new file mode 100644 index 00000000..0dc54d5b --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/NOTES.txt @@ -0,0 +1,8 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-beat/templates/_helpers.tpl b/helm/capif/charts/celery-beat/templates/_helpers.tpl new file mode 100644 index 00000000..ece434bb --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "celery-beat.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 "celery-beat.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 "celery-beat.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "celery-beat.labels" -}} +helm.sh/chart: {{ include "celery-beat.chart" . }} +{{ include "celery-beat.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "celery-beat.selectorLabels" -}} +app.kubernetes.io/name: {{ include "celery-beat.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "celery-beat.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "celery-beat.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-beat/templates/configmap.yaml b/helm/capif/charts/celery-beat/templates/configmap.yaml new file mode 100644 index 00000000..3ae5cde3 --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/configmap.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: celery-beat-configmap +data: + config.yaml: | + mongo: { + 'user': '{{ .Values.env.mongoInitdbRootUsername }}', + 'password': '{{ .Values.env.mongoInitdbRootPassword }}', + 'db': 'capif', + 'notifications_col': 'notifications', + 'host': 'mongo', + 'port': "27017" + } diff --git a/helm/capif/charts/celery-beat/templates/deployment.yaml b/helm/capif/charts/celery-beat/templates/deployment.yaml new file mode 100644 index 00000000..f7094690 --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "celery-beat.fullname" . }} + labels: + {{- include "celery-beat.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "celery-beat.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + date: "{{ now | unixEpoch }}" + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + labels: + {{- include "celery-beat.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "celery-beat.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: CELERY_MODE + value: {{ quote .Values.env.celeryMode }} + - name: REDIS_HOST + value: {{ quote .Values.env.redisHost }} + - name: REDIS_PORT + value: {{ quote .Values.env.redisPort }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- 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 }} diff --git a/helm/capif/charts/celery-beat/templates/hpa.yaml b/helm/capif/charts/celery-beat/templates/hpa.yaml new file mode 100644 index 00000000..4884b453 --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "celery-beat.fullname" . }} + labels: + {{- include "celery-beat.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "celery-beat.fullname" . }} + 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 }} +{{- end }} diff --git a/helm/capif/charts/celery-beat/templates/ingress.yaml b/helm/capif/charts/celery-beat/templates/ingress.yaml new file mode 100644 index 00000000..aa98da92 --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "celery-beat.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "celery-beat.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-beat/templates/serviceaccount.yaml b/helm/capif/charts/celery-beat/templates/serviceaccount.yaml new file mode 100644 index 00000000..368cfc15 --- /dev/null +++ b/helm/capif/charts/celery-beat/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "celery-beat.serviceAccountName" . }} + labels: + {{- include "celery-beat.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml new file mode 100644 index 00000000..75799c31 --- /dev/null +++ b/helm/capif/charts/celery-beat/values.yaml @@ -0,0 +1,113 @@ +# Default values for celery-beat. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: celery + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +env: + celeryMode: beat + redisHost: redis + redisPort: 6379 + mongoInitdbRootUsername: root + mongoInitdbRootPassword: example + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: 200m + memory: 256Mi + requests: + cpu: 1m + memory: 1Mi + +livenessProbe: +# httpGet: +# path: / +# port: http +readinessProbe: +# tcpSocket: +# port: 8080 +# initialDelaySeconds: 10 +# periodSeconds: 5 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: + - name: capif-invocation-config + configMap: + name: celery-beat-configmap + items: + - key: "config.yaml" + path: "config.yaml" + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: + - name: capif-invocation-config + mountPath: /celery/config.yaml + subPath: config.yaml + +nodeSelector: {} + +tolerations: [] + +affinity: {} -- GitLab From 478d8d084f39f43b5f8bb01e7c825f2fadd9e08e Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 16:46:35 +0200 Subject: [PATCH 02/15] Update volume and volumeMount names in celery-beat chart to 'celery-beat' --- helm/capif/charts/celery-beat/README.md | 4 ++-- helm/capif/charts/celery-beat/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helm/capif/charts/celery-beat/README.md b/helm/capif/charts/celery-beat/README.md index ae8c323f..35b1639a 100644 --- a/helm/capif/charts/celery-beat/README.md +++ b/helm/capif/charts/celery-beat/README.md @@ -56,12 +56,12 @@ A Helm chart for Kubernetes of celery-beat | serviceAccount.name | string | `""` | | | tolerations | list | `[]` | | | volumeMounts[0].mountPath | string | `"/usr/src/app/config.yaml"` | | -| volumeMounts[0].name | string | `"capif-invocation-config"` | | +| volumeMounts[0].name | string | `"celery-beat"` | | | volumeMounts[0].subPath | string | `"config.yaml"` | | | volumes[0].configMap.items[0].key | string | `"config.yaml"` | | | volumes[0].configMap.items[0].path | string | `"config.yaml"` | | | volumes[0].configMap.name | string | `"celery-beat-configmap"` | | -| volumes[0].name | string | `"capif-invocation-config"` | | +| volumes[0].name | string | `"celery-beat"` | | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index 75799c31..aae6fb88 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -93,7 +93,7 @@ autoscaling: # Additional volumes on the output Deployment definition. volumes: - - name: capif-invocation-config + - name: celery-beat configMap: name: celery-beat-configmap items: @@ -102,7 +102,7 @@ volumes: # Additional volumeMounts on the output Deployment definition. volumeMounts: - - name: capif-invocation-config + - name: celery-beat mountPath: /celery/config.yaml subPath: config.yaml -- GitLab From 4d75f4582161144e662555bb94662c6bf61724e5 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 16:46:56 +0200 Subject: [PATCH 03/15] Add initial Helm chart for celery-worker with templates and configuration --- helm/capif/charts/celery-worker/.helmignore | 23 ++++ helm/capif/charts/celery-worker/Chart.yaml | 24 ++++ helm/capif/charts/celery-worker/README.md | 67 +++++++++++ .../charts/celery-worker/templates/NOTES.txt | 8 ++ .../celery-worker/templates/_helpers.tpl | 62 ++++++++++ .../celery-worker/templates/configmap.yaml | 14 +++ .../celery-worker/templates/deployment.yaml | 70 +++++++++++ .../charts/celery-worker/templates/hpa.yaml | 32 +++++ .../celery-worker/templates/ingress.yaml | 61 ++++++++++ .../templates/serviceaccount.yaml | 13 ++ helm/capif/charts/celery-worker/values.yaml | 113 ++++++++++++++++++ 11 files changed, 487 insertions(+) create mode 100644 helm/capif/charts/celery-worker/.helmignore create mode 100644 helm/capif/charts/celery-worker/Chart.yaml create mode 100644 helm/capif/charts/celery-worker/README.md create mode 100644 helm/capif/charts/celery-worker/templates/NOTES.txt create mode 100644 helm/capif/charts/celery-worker/templates/_helpers.tpl create mode 100644 helm/capif/charts/celery-worker/templates/configmap.yaml create mode 100644 helm/capif/charts/celery-worker/templates/deployment.yaml create mode 100644 helm/capif/charts/celery-worker/templates/hpa.yaml create mode 100644 helm/capif/charts/celery-worker/templates/ingress.yaml create mode 100644 helm/capif/charts/celery-worker/templates/serviceaccount.yaml create mode 100644 helm/capif/charts/celery-worker/values.yaml diff --git a/helm/capif/charts/celery-worker/.helmignore b/helm/capif/charts/celery-worker/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/helm/capif/charts/celery-worker/.helmignore @@ -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/ diff --git a/helm/capif/charts/celery-worker/Chart.yaml b/helm/capif/charts/celery-worker/Chart.yaml new file mode 100644 index 00000000..cd71295e --- /dev/null +++ b/helm/capif/charts/celery-worker/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: celery-worker +description: A Helm chart for Kubernetes of celery-worker + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/helm/capif/charts/celery-worker/README.md b/helm/capif/charts/celery-worker/README.md new file mode 100644 index 00000000..1563d79c --- /dev/null +++ b/helm/capif/charts/celery-worker/README.md @@ -0,0 +1,67 @@ +# celery-worker + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) + +A Helm chart for Kubernetes of celery-worker + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| env.capifHostname | string | `"capif"` | | +| env.logLevel | string | `"INFO"` | | +| env.mongoInitdbRootPassword | string | `"example"` | | +| env.mongoInitdbRootUsername | string | `"root"` | | +| env.monitoring | string | `"true"` | | +| env.vaultAccessToken | string | `"dev-only-token"` | | +| env.vaultHostname | string | `"vault"` | | +| env.vaultPort | int | `8200` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"Always"` | | +| image.repository | string | `"celery-worker"` | | +| image.tag | string | `""` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| livenessProbe | string | `nil` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podLabels | object | `{}` | | +| podSecurityContext | object | `{}` | | +| readinessProbe.initialDelaySeconds | int | `10` | | +| readinessProbe.periodSeconds | int | `5` | | +| readinessProbe.tcpSocket.port | int | `8080` | | +| replicaCount | int | `1` | | +| resources.limits.cpu | string | `"100m"` | | +| resources.limits.memory | string | `"128Mi"` | | +| resources.requests.cpu | string | `"100m"` | | +| resources.requests.memory | string | `"128Mi"` | | +| securityContext | object | `{}` | | +| service.port | int | `8080` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.automount | bool | `true` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| tolerations | list | `[]` | | +| volumeMounts[0].mountPath | string | `"/usr/src/app/config.yaml"` | | +| volumeMounts[0].name | string | `"celery-worker"` | | +| volumeMounts[0].subPath | string | `"config.yaml"` | | +| volumes[0].configMap.items[0].key | string | `"config.yaml"` | | +| volumes[0].configMap.items[0].path | string | `"config.yaml"` | | +| volumes[0].configMap.name | string | `"celery-worker-configmap"` | | +| volumes[0].name | string | `"celery-worker"` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) diff --git a/helm/capif/charts/celery-worker/templates/NOTES.txt b/helm/capif/charts/celery-worker/templates/NOTES.txt new file mode 100644 index 00000000..0dc54d5b --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/NOTES.txt @@ -0,0 +1,8 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-worker/templates/_helpers.tpl b/helm/capif/charts/celery-worker/templates/_helpers.tpl new file mode 100644 index 00000000..c545f56e --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "celery-worker.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 "celery-worker.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 "celery-worker.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "celery-worker.labels" -}} +helm.sh/chart: {{ include "celery-worker.chart" . }} +{{ include "celery-worker.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "celery-worker.selectorLabels" -}} +app.kubernetes.io/name: {{ include "celery-worker.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "celery-worker.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "celery-worker.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-worker/templates/configmap.yaml b/helm/capif/charts/celery-worker/templates/configmap.yaml new file mode 100644 index 00000000..20d74ecf --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/configmap.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: celery-worker-configmap +data: + config.yaml: | + mongo: { + 'user': '{{ .Values.env.mongoInitdbRootUsername }}', + 'password': '{{ .Values.env.mongoInitdbRootPassword }}', + 'db': 'capif', + 'notifications_col': 'notifications', + 'host': 'mongo', + 'port': "27017" + } diff --git a/helm/capif/charts/celery-worker/templates/deployment.yaml b/helm/capif/charts/celery-worker/templates/deployment.yaml new file mode 100644 index 00000000..8e3607f8 --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/deployment.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "celery-worker.fullname" . }} + labels: + {{- include "celery-worker.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "celery-worker.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + date: "{{ now | unixEpoch }}" + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + labels: + {{- include "celery-worker.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "celery-worker.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: CELERY_MODE + value: {{ quote .Values.env.celeryMode }} + - name: REDIS_HOST + value: {{ quote .Values.env.redisHost }} + - name: REDIS_PORT + value: {{ quote .Values.env.redisPort }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- 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 }} diff --git a/helm/capif/charts/celery-worker/templates/hpa.yaml b/helm/capif/charts/celery-worker/templates/hpa.yaml new file mode 100644 index 00000000..c89649e8 --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "celery-worker.fullname" . }} + labels: + {{- include "celery-worker.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "celery-worker.fullname" . }} + 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 }} +{{- end }} diff --git a/helm/capif/charts/celery-worker/templates/ingress.yaml b/helm/capif/charts/celery-worker/templates/ingress.yaml new file mode 100644 index 00000000..5d07a917 --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "celery-worker.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "celery-worker.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm/capif/charts/celery-worker/templates/serviceaccount.yaml b/helm/capif/charts/celery-worker/templates/serviceaccount.yaml new file mode 100644 index 00000000..2876baf0 --- /dev/null +++ b/helm/capif/charts/celery-worker/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "celery-worker.serviceAccountName" . }} + labels: + {{- include "celery-worker.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/helm/capif/charts/celery-worker/values.yaml b/helm/capif/charts/celery-worker/values.yaml new file mode 100644 index 00000000..90ac01b3 --- /dev/null +++ b/helm/capif/charts/celery-worker/values.yaml @@ -0,0 +1,113 @@ +# Default values for celery-worker. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: celery + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +env: + celeryMode: worker + redisHost: redis + redisPort: 6379 + mongoInitdbRootUsername: root + mongoInitdbRootPassword: example + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: 200m + memory: 256Mi + requests: + cpu: 1m + memory: 1Mi + +livenessProbe: +# httpGet: +# path: / +# port: http +readinessProbe: +# tcpSocket: +# port: 8080 +# initialDelaySeconds: 10 +# periodSeconds: 5 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: + - name: celery-worker + configMap: + name: celery-worker-configmap + items: + - key: "config.yaml" + path: "config.yaml" + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: + - name: celery-worker + mountPath: /celery/config.yaml + subPath: config.yaml + +nodeSelector: {} + +tolerations: [] + +affinity: {} -- GitLab From dee2b8dcd4db93fcb89ba68bf4b20150c9add778 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 16:49:19 +0200 Subject: [PATCH 04/15] Add celery-beat and celery-worker to chart dependencies --- helm/capif/Chart.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helm/capif/Chart.yaml b/helm/capif/Chart.yaml index 1c49c2c3..89785865 100644 --- a/helm/capif/Chart.yaml +++ b/helm/capif/Chart.yaml @@ -68,6 +68,10 @@ dependencies: version: "*" - name: renderer version: "*" + - name: celery-beat + version: "*" + - name: celery-worker + version: "*" - name: "tempo" condition: tempo.enabled repository: "https://grafana.github.io/helm-charts" -- GitLab From 5b9eca09c4a8aa67dc8e8d7738b4033f57e4c537 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 16:56:48 +0200 Subject: [PATCH 05/15] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index aae6fb88..13696fd0 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -110,4 +110,4 @@ nodeSelector: {} tolerations: [] -affinity: {} +affinity: {} \ No newline at end of file -- GitLab From b110e5272c85ed8b052087ad12044c6b86bda588 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 17:00:57 +0200 Subject: [PATCH 06/15] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index 13696fd0..aae6fb88 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -110,4 +110,4 @@ nodeSelector: {} tolerations: [] -affinity: {} \ No newline at end of file +affinity: {} -- GitLab From be13ffca84b0130608ecf829d99a8f8c9b8ec505 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 17:05:07 +0200 Subject: [PATCH 07/15] Fix formatting in Chart.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/Chart.yaml b/helm/capif/charts/celery-beat/Chart.yaml index 35c2eb3f..140a2ff9 100644 --- a/helm/capif/charts/celery-beat/Chart.yaml +++ b/helm/capif/charts/celery-beat/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.0 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.16.0" +appVersion: "1.16.0" \ No newline at end of file -- GitLab From f4210c03341aeaacba7113bc127fc2219b9a7995 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 17:11:31 +0200 Subject: [PATCH 08/15] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index aae6fb88..13696fd0 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -110,4 +110,4 @@ nodeSelector: {} tolerations: [] -affinity: {} +affinity: {} \ No newline at end of file -- GitLab From 3bfde4a27c345501156b90a132aecfaae5012751 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 17:15:04 +0200 Subject: [PATCH 09/15] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index 13696fd0..aae6fb88 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -110,4 +110,4 @@ nodeSelector: {} tolerations: [] -affinity: {} \ No newline at end of file +affinity: {} -- GitLab From ca25d69165cec9d03587f508da8e283f847fa591 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Mon, 19 May 2025 17:18:34 +0200 Subject: [PATCH 10/15] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-beat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index aae6fb88..13696fd0 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -110,4 +110,4 @@ nodeSelector: {} tolerations: [] -affinity: {} +affinity: {} \ No newline at end of file -- GitLab From b591d400573e7bd52e85b5945a50284d3af80a85 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 May 2025 11:02:16 +0200 Subject: [PATCH 11/15] Add LOG_LEVEL environment variable to celery-beat and celery-worker deployments --- helm/capif/charts/celery-beat/templates/deployment.yaml | 2 ++ helm/capif/charts/celery-beat/values.yaml | 1 + helm/capif/charts/celery-worker/templates/deployment.yaml | 2 ++ helm/capif/charts/celery-worker/values.yaml | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-beat/templates/deployment.yaml b/helm/capif/charts/celery-beat/templates/deployment.yaml index f7094690..4a231223 100644 --- a/helm/capif/charts/celery-beat/templates/deployment.yaml +++ b/helm/capif/charts/celery-beat/templates/deployment.yaml @@ -42,6 +42,8 @@ spec: value: {{ quote .Values.env.redisHost }} - name: REDIS_PORT value: {{ quote .Values.env.redisPort }} + - name: LOG_LEVEL + value: {{ quote .Values.env.logLevel }} livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: diff --git a/helm/capif/charts/celery-beat/values.yaml b/helm/capif/charts/celery-beat/values.yaml index 13696fd0..bd7fc689 100644 --- a/helm/capif/charts/celery-beat/values.yaml +++ b/helm/capif/charts/celery-beat/values.yaml @@ -20,6 +20,7 @@ env: redisPort: 6379 mongoInitdbRootUsername: root mongoInitdbRootPassword: example + logLevel: DEBUG serviceAccount: # Specifies whether a service account should be created diff --git a/helm/capif/charts/celery-worker/templates/deployment.yaml b/helm/capif/charts/celery-worker/templates/deployment.yaml index 8e3607f8..44311740 100644 --- a/helm/capif/charts/celery-worker/templates/deployment.yaml +++ b/helm/capif/charts/celery-worker/templates/deployment.yaml @@ -42,6 +42,8 @@ spec: value: {{ quote .Values.env.redisHost }} - name: REDIS_PORT value: {{ quote .Values.env.redisPort }} + - name: LOG_LEVEL + value: {{ quote .Values.env.logLevel }} livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: diff --git a/helm/capif/charts/celery-worker/values.yaml b/helm/capif/charts/celery-worker/values.yaml index 90ac01b3..9d054bab 100644 --- a/helm/capif/charts/celery-worker/values.yaml +++ b/helm/capif/charts/celery-worker/values.yaml @@ -19,7 +19,8 @@ env: redisHost: redis redisPort: 6379 mongoInitdbRootUsername: root - mongoInitdbRootPassword: example + mongoInitdbRootPassword: + logLevel: DEBUG serviceAccount: # Specifies whether a service account should be created -- GitLab From fe41b29402b869bf328be8f75ba269f0afd368dc Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 May 2025 11:02:41 +0200 Subject: [PATCH 12/15] Add missing MongoDB collection fields to configmap.yaml --- helm/capif/charts/ocf-events/templates/configmap.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helm/capif/charts/ocf-events/templates/configmap.yaml b/helm/capif/charts/ocf-events/templates/configmap.yaml index a928cac5..e599fef3 100644 --- a/helm/capif/charts/ocf-events/templates/configmap.yaml +++ b/helm/capif/charts/ocf-events/templates/configmap.yaml @@ -12,6 +12,8 @@ data: 'certs_col': "certs", 'capif_invokers_col': 'invokerdetails', 'capif_providers_col': 'providerenrolmentdetails', + 'capif_acls_col': 'acls', + 'notifications_col': 'notifications', 'host': 'mongo', 'port': "27017" } -- GitLab From c497438b83de5d74c73d8a0b090448c1695ade2a Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 May 2025 11:11:13 +0200 Subject: [PATCH 13/15] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-worker/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-worker/values.yaml b/helm/capif/charts/celery-worker/values.yaml index 9d054bab..8935d7aa 100644 --- a/helm/capif/charts/celery-worker/values.yaml +++ b/helm/capif/charts/celery-worker/values.yaml @@ -111,4 +111,4 @@ nodeSelector: {} tolerations: [] -affinity: {} +affinity: {} \ No newline at end of file -- GitLab From 5344e80713252bb0735e7ab664d21e094f7a569b Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 May 2025 11:29:00 +0200 Subject: [PATCH 14/15] Add mongoInitdbRootPassword value to celery-worker configuration --- helm/capif/charts/celery-worker/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-worker/values.yaml b/helm/capif/charts/celery-worker/values.yaml index 8935d7aa..dfaf4651 100644 --- a/helm/capif/charts/celery-worker/values.yaml +++ b/helm/capif/charts/celery-worker/values.yaml @@ -19,7 +19,7 @@ env: redisHost: redis redisPort: 6379 mongoInitdbRootUsername: root - mongoInitdbRootPassword: + mongoInitdbRootPassword: example logLevel: DEBUG serviceAccount: -- GitLab From e09664ab2206444ef5d3e94ffda3a2f4cd8cefd5 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 May 2025 16:43:28 +0200 Subject: [PATCH 15/15] Fix formatting in values.yaml by adding a newline at the end of the file --- helm/capif/charts/celery-worker/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/capif/charts/celery-worker/values.yaml b/helm/capif/charts/celery-worker/values.yaml index dfaf4651..c410ac94 100644 --- a/helm/capif/charts/celery-worker/values.yaml +++ b/helm/capif/charts/celery-worker/values.yaml @@ -111,4 +111,4 @@ nodeSelector: {} tolerations: [] -affinity: {} \ No newline at end of file +affinity: {} -- GitLab