Skip to content

Commit

Permalink
Merge pull request #64 from devops-ia/fix/63-parametrize-readychecker…
Browse files Browse the repository at this point in the history
…-image

fix: parametrize readyChecker image base
  • Loading branch information
ialejandro authored Sep 16, 2024
2 parents a020923 + 38140d0 commit 1b72068
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
12 changes: 9 additions & 3 deletions charts/opencti/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,13 @@ helm show values opencti/opencti
| rabbitmq.enabled | bool | `true` | Enable or disable RabbitMQ subchart |
| readinessProbe | object | `{"enabled":true,"failureThreshold":3,"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":1}` | Configure readinessProbe checker </br> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-startup-probes |
| readinessProbeCustom | object | `{}` | Custom readinessProbe |
| readyChecker | object | `{"enabled":true,"retries":30,"services":[{"name":"elasticsearch","port":9200},{"name":"minio","port":9000},{"name":"rabbitmq","port":5672},{"name":"redis-master","port":6379}],"timeout":5}` | Enable or disable ready-checker |
| readyChecker | object | `{"enabled":true,"pullPolicy":"IfNotPresent","repository":"busybox","retries":30,"services":[{"name":"elasticsearch","port":9200},{"name":"minio","port":9000},{"name":"rabbitmq","port":5672},{"name":"redis-master","port":6379}],"tag":"latest","timeout":5}` | Enable or disable ready-checker |
| readyChecker.enabled | bool | `true` | Enable or disable ready-checker |
| readyChecker.pullPolicy | string | `"IfNotPresent"` | Pull policy for the image |
| readyChecker.repository | string | `"busybox"` | Repository of the image |
| readyChecker.retries | int | `30` | Number of retries before giving up |
| readyChecker.services | list | `[{"name":"elasticsearch","port":9200},{"name":"minio","port":9000},{"name":"rabbitmq","port":5672},{"name":"redis-master","port":6379}]` | List services |
| readyChecker.tag | string | `"latest"` | Overrides the image tag |
| readyChecker.timeout | int | `5` | Timeout for each check |
| redis | object | `{"architecture":"standalone","auth":{"enabled":false},"enabled":true,"master":{"count":1,"persistence":{"enabled":false}},"replica":{"persistence":{"enabled":false},"replicaCount":1}}` | Redis subchart deployment </br> Ref: https://github.com/bitnami/charts/blob/main/bitnami/redis/values.yaml |
| redis.enabled | bool | `true` | Enable or disable Redis subchart |
Expand All @@ -147,7 +150,7 @@ helm show values opencti/opencti
| topologySpreadConstraints | list | `[]` | Control how Pods are spread across your cluster </br> Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#example-multiple-topologyspreadconstraints |
| volumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition |
| volumes | list | `[]` | Additional volumes on the output Deployment definition |
| worker | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80},"enabled":true,"env":{"WORKER_LOG_LEVEL":"info","WORKER_TELEMETRY_ENABLED":true},"envFromSecrets":{},"image":{"pullPolicy":"IfNotPresent","repository":"opencti/worker","tag":""},"lifecycle":{},"networkPolicy":{"egress":[],"enabled":false,"ingress":[],"policyTypes":[]},"nodeSelector":{},"podDisruptionBudget":{"enabled":false,"maxUnavailable":1,"minAvailable":null},"readyChecker":{"enabled":true,"retries":30,"timeout":5},"replicaCount":1,"resources":{},"serviceMonitor":{"enabled":false,"interval":"30s","metricRelabelings":[],"relabelings":[],"scrapeTimeout":"10s"},"terminationGracePeriodSeconds":30,"tolerations":[],"topologySpreadConstraints":[],"volumeMounts":[],"volumes":[]}` | OpenCTI worker deployment configuration </br> Ref: https://docs.opencti.io/latest/deployment/overview/#workers |
| worker | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80},"enabled":true,"env":{"WORKER_LOG_LEVEL":"info","WORKER_TELEMETRY_ENABLED":true},"envFromSecrets":{},"image":{"pullPolicy":"IfNotPresent","repository":"opencti/worker","tag":""},"lifecycle":{},"networkPolicy":{"egress":[],"enabled":false,"ingress":[],"policyTypes":[]},"nodeSelector":{},"podDisruptionBudget":{"enabled":false,"maxUnavailable":1,"minAvailable":null},"readyChecker":{"enabled":true,"pullPolicy":"IfNotPresent","repository":"busybox","retries":30,"tag":"latest","timeout":5},"replicaCount":1,"resources":{},"serviceMonitor":{"enabled":false,"interval":"30s","metricRelabelings":[],"relabelings":[],"scrapeTimeout":"10s"},"terminationGracePeriodSeconds":30,"tolerations":[],"topologySpreadConstraints":[],"volumeMounts":[],"volumes":[]}` | OpenCTI worker deployment configuration </br> Ref: https://docs.opencti.io/latest/deployment/overview/#workers |
| worker.affinity | object | `{}` | Affinity for pod assignment </br> Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity |
| worker.autoscaling | object | `{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80}` | Autoscaling with CPU or memory utilization percentage </br> Ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ |
| worker.enabled | bool | `true` | Enable or disable worker |
Expand All @@ -163,9 +166,12 @@ helm show values opencti/opencti
| worker.networkPolicy.policyTypes | list | `[]` | Policy types |
| worker.nodeSelector | object | `{}` | Node labels for pod assignment </br> Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector |
| worker.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":null}` | Pod Disruption Budget </br> Ref: https://kubernetes.io/docs/reference/kubernetes-api/policy-resources/pod-disruption-budget-v1/ |
| worker.readyChecker | object | `{"enabled":true,"retries":30,"timeout":5}` | Enable or disable ready-checker waiting server is ready |
| worker.readyChecker | object | `{"enabled":true,"pullPolicy":"IfNotPresent","repository":"busybox","retries":30,"tag":"latest","timeout":5}` | Enable or disable ready-checker waiting server is ready |
| worker.readyChecker.enabled | bool | `true` | Enable or disable ready-checker |
| worker.readyChecker.pullPolicy | string | `"IfNotPresent"` | Pull policy for the image |
| worker.readyChecker.repository | string | `"busybox"` | Repository of the image |
| worker.readyChecker.retries | int | `30` | Number of retries before giving up |
| worker.readyChecker.tag | string | `"latest"` | Overrides the image tag |
| worker.readyChecker.timeout | int | `5` | Timeout for each check |
| worker.replicaCount | int | `1` | Number of replicas for the service |
| worker.resources | object | `{}` | The resources limits and requested </br> Ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
Expand Down
5 changes: 3 additions & 2 deletions charts/opencti/templates/connector/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ spec:
initContainers:
- name: ready-checker-server
{{- if $.Values.global.imageRegistry }}
image: "{{ $.Values.global.imageRegistry }}/busybox"
image: "{{ $.Values.global.imageRegistry }}/{{ .readyChecker.image | default "busybox" }}:{{ .readyChecker.tag | default "latest" }}"
{{- else }}
image: busybox
image: {{ .readyChecker.repository | default "busybox" }}:{{ .readyChecker.tag | default "latest" }}
imagePullPolicy: {{ .readyChecker.pullPolicy | default "IfNotPresent" }}
{{- end }}
command:
- 'sh'
Expand Down
5 changes: 3 additions & 2 deletions charts/opencti/templates/server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ spec:
{{- range $service := .Values.readyChecker.services }}
- name: ready-checker-{{ $service.name }}
{{- if $.Values.global.imageRegistry }}
image: "{{ $.Values.global.imageRegistry }}/busybox"
image: "{{ $.Values.global.imageRegistry }}/{{ $.Values.readyChecker.repository }}:{{ $.Values.readyChecker.tag }}"
{{- else }}
image: busybox
image: {{ $.Values.readyChecker.repository }}:{{ $.Values.readyChecker.tag }}
{{- end }}
imagePullPolicy: {{ $.Values.readyChecker.pullPolicy }}
command:
- 'sh'
- '-c'
Expand Down
5 changes: 3 additions & 2 deletions charts/opencti/templates/worker/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ spec:
initContainers:
- name: ready-checker-server
{{- if $.Values.global.imageRegistry }}
image: "{{ $.Values.global.imageRegistry }}/busybox"
image: "{{ $.Values.global.imageRegistry }}/{{ $.Values.worker.readyChecker.repository }}:{{ $.Values.worker.readyChecker.tag }}"
{{- else }}
image: busybox
image: {{ $.Values.worker.readyChecker.repository }}:{{ $.Values.worker.readyChecker.tag }}
{{- end }}
imagePullPolicy: {{ $.Values.worker.readyChecker.pullPolicy }}
command:
- 'sh'
- '-c'
Expand Down
17 changes: 16 additions & 1 deletion charts/opencti/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ startupProbeCustom: {}
readyChecker:
# -- Enable or disable ready-checker
enabled: true
# -- Repository of the image
repository: busybox
# -- Pull policy for the image
pullPolicy: IfNotPresent
# -- Overrides the image tag
tag: latest
# -- Number of retries before giving up
retries: 30
# -- Timeout for each check
Expand Down Expand Up @@ -365,8 +371,11 @@ connectors: []
# # -- Pod annotations
# podAnnotations: {}
# # -- Enable or disable ready-checker waiting server is ready
# readyChecker:
# readyChecker: {}
# # enabled: true
# # repository: busybox
# # pullPolicy: IfNotPresent
# # tag: latest
# # retries: 30
# # timeout: 5
# # -- Lifecycle configuration
Expand Down Expand Up @@ -422,6 +431,12 @@ worker:
readyChecker:
# -- Enable or disable ready-checker
enabled: true
# -- Repository of the image
repository: busybox
# -- Pull policy for the image
pullPolicy: IfNotPresent
# -- Overrides the image tag
tag: latest
# -- Number of retries before giving up
retries: 30
# -- Timeout for each check
Expand Down

0 comments on commit 1b72068

Please sign in to comment.