Add init container to divingbell-apt daemonset

Enables wait for divingbell-exec prior running.

Change-Id: I597d9805fa4cf0920ae811af8ad8f7e4f1f4feef
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
This commit is contained in:
Ruslan Aliev 2023-07-09 14:09:57 -05:00
parent 9ef6046f33
commit 9b60647453
10 changed files with 32 additions and 10 deletions

View File

@ -47,7 +47,7 @@ spec:
{{ .Values.labels.apparmor.node_selector_key }}: {{ .Values.labels.apparmor.node_selector_value }}
containers:
- name: {{ $daemonset }}
image: {{ .Values.images.divingbell }}
image: {{ .Values.images.tags.divingbell }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.apparmor | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
{{ dict "envAll" $envAll "application" "divingbell" "container" "apparmor" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 8 }}

View File

@ -52,9 +52,13 @@ spec:
hostIPC: true
nodeSelector:
{{ .Values.labels.apt.node_selector_key }}: {{ .Values.labels.apt.node_selector_value }}
serviceAccountName: "divingbell-apt"
initContainers:
{{- tuple $envAll "divingbell-apt" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
{{ dict "envAll" $envAll | include "helm-toolkit.snippets.kubernetes_apparmor_loader_init_container" | indent 8 }}
containers:
- name: {{ $daemonset }}
image: {{ .Values.images.divingbell }}
image: {{ .Values.images.tags.divingbell }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.apt | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
{{ dict "envAll" $envAll "application" "divingbell" "container" "apt" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 8 }}
@ -84,6 +88,9 @@ spec:
{{- end }}
{{- end }}
{{- if .Values.manifests.daemonset_apt }}
{{- $envAll := . }}
{{- $serviceAccountName := "divingbell-apt" }}
{{ tuple $envAll "divingbell-apt" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
{{- $daemonset := "apt" }}
{{- $secretName := "divingbell-apt" }}
{{- $daemonset_yaml := list $daemonset $secretName . | include "divingbell.daemonset.apt" | toString | fromYaml }}

View File

@ -47,7 +47,7 @@ spec:
{{ .Values.labels.ethtool.node_selector_key }}: {{ .Values.labels.ethtool.node_selector_value }}
containers:
- name: {{ $daemonset }}
image: {{ .Values.images.divingbell }}
image: {{ .Values.images.tags.divingbell }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.ethtool | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
{{ dict "envAll" $envAll "application" "divingbell" "container" "ethtool" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 8 }}

View File

@ -54,7 +54,7 @@ spec:
{{ .Values.labels.exec.node_selector_key }}: {{ .Values.labels.exec.node_selector_value }}
containers:
- name: {{ $daemonset }}
image: {{ .Values.images.divingbell }}
image: {{ .Values.images.tags.divingbell }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.exec | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
{{ dict "envAll" $envAll "application" "divingbell" "container" "exec" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 8 }}

View File

@ -47,7 +47,7 @@ spec:
{{ .Values.labels.limits.node_selector_key }}: {{ .Values.labels.limits.node_selector_value }}
containers:
- name: {{ $daemonset }}
image: {{ .Values.images.divingbell }}
image: {{ .Values.images.tags.divingbell }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.limits | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
{{ dict "envAll" $envAll "application" "divingbell" "container" "limits" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 8 }}

View File

@ -47,7 +47,7 @@ spec:
{{ .Values.labels.mounts.node_selector_key }}: {{ .Values.labels.mounts.node_selector_value }}
containers:
- name: {{ $daemonset }}
image: {{ .Values.images.divingbell }}
image: {{ .Values.images.tags.divingbell }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.mounts | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
{{ dict "envAll" $envAll "application" "divingbell" "container" "mounts" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 8 }}

View File

@ -47,7 +47,7 @@ spec:
{{ .Values.labels.perm.node_selector_key }}: {{ .Values.labels.perm.node_selector_value }}
containers:
- name: {{ $daemonset }}
image: {{ .Values.images.divingbell }}
image: {{ .Values.images.tags.divingbell }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.perm | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
{{ dict "envAll" $envAll "application" "divingbell" "container" "perm" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 8 }}

View File

@ -47,7 +47,7 @@ spec:
{{ .Values.labels.sysctl.node_selector_key }}: {{ .Values.labels.sysctl.node_selector_value }}
containers:
- name: {{ $daemonset }}
image: {{ .Values.images.divingbell }}
image: {{ .Values.images.tags.divingbell }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.sysctl | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
{{ dict "envAll" $envAll "application" "divingbell" "container" "sysctl" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 8 }}

View File

@ -46,7 +46,7 @@ spec:
{{ .Values.labels.uamlite.node_selector_key }}: {{ .Values.labels.uamlite.node_selector_value }}
containers:
- name: {{ $daemonset }}
image: {{ .Values.images.divingbell }}
image: {{ .Values.images.tags.divingbell }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.uamlite | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
command:

View File

@ -18,8 +18,14 @@
# name: value
images:
divingbell: 'ubuntu:18.04'
tags:
dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0
divingbell: 'ubuntu:18.04'
pull_policy: IfNotPresent
local_registry:
active: false
exclude:
- dep_check
conf:
chroot_mnt_path: '/mnt'
@ -278,6 +284,15 @@ pod:
periodSeconds: 10
failureThreshold: 1200
dependencies:
static:
divingbell-apt:
pod:
- requireSameNode: true
labels:
application: divingbell
component: exec
network_policy:
divingbell:
ingress: