Add more fields to daemonjob crd spec.

Change-Id: I1690035c7e35887245bbdcfdc97b19409fd6ab8a
This commit is contained in:
Luna Das 2020-03-11 22:28:28 +05:30 committed by Chris Wedgwood
parent d0f808a64e
commit 55beab680f
5 changed files with 24 additions and 5 deletions

View File

@ -70,6 +70,10 @@ spec:
type: string
imagePullPolicy:
type: string
args:
type: array
items:
type: string
command:
type: array
items:
@ -353,6 +357,8 @@ spec:
type: boolean
stdin:
type: boolean
hostNetwork:
type: boolean
terminationGracePeriodSeconds:
type: integer
status:

View File

@ -24,7 +24,6 @@ metadata:
name: daemonjob-controller
annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 4 }}
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
namespace: {{ .Release.Namespace }}
labels:
{{ tuple $envAll "daemonjob-controller" "controller" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
@ -37,10 +36,13 @@ spec:
metadata:
annotations:
{{ dict "envAll" $envAll "podName" "daemonjob-controller" "containerNames" (list "controller") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
labels:
{{ tuple $envAll "daemonjob-controller" "controller" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
spec:
serviceAccountName: {{ $serviceAccountName }}
nodeSelector:
{{ .Values.labels.daemonjob_controller.node_selector_key }}: {{ .Values.labels.daemonjob_controller.node_selector_value | quote }}
containers:
- name: controller
{{ tuple $envAll "python" | include "helm-toolkit.snippets.image" | indent 8 }}

View File

@ -27,6 +27,11 @@ images:
- dep_check
- image_repo_sync
labels:
daemonjob_controller:
node_selector_key: openstack-control-plane
node_selector_value: enabled
crds:
group_name: ctl.example.com
group_version: v1

View File

@ -64,12 +64,8 @@ spec:
{{ tuple $envAll "metacontroller" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
serviceName: {{ tuple "metacontroller" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
podManagementPolicy: "Parallel"
affinity:
{{ tuple $envAll "metacontroller" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 4 }}
replicas: {{ .Values.pod.replicas.metacontroller }}
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.server.timeout | default "30" }}
nodeSelector:
{{ .Values.labels.server.node_selector_key }}: {{ .Values.labels.server.node_selector_value | quote }}
template:
metadata:
labels:
@ -79,6 +75,8 @@ spec:
spec:
{{ dict "envAll" . "application" "metacontroller" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
serviceAccountName: {{ $serviceAccountName }}
nodeSelector:
{{ .Values.labels.server.node_selector_key }}: {{ .Values.labels.server.node_selector_value | quote }}
containers:
- name: metacontroller
{{ tuple $envAll "metacontroller" | include "helm-toolkit.snippets.image" | indent 8 }}

View File

@ -56,7 +56,14 @@ apiVersion: ctl.example.com/v1
kind: DaemonJob
metadata:
name: hello-world
annotations:
imageregistry: "https://hub.docker.com/"
labels:
app: hello-world
spec:
selector:
matchLabels:
app: hello-world
template:
metadata:
labels:
@ -90,6 +97,7 @@ until [[ "$(kubectl get $dj hello-world -o 'jsonpath={.status.conditions[0].stat
else
daemonset_pod_status=$(kubectl get pods | awk '/hello-world-dj/{print $3}')
if [ $daemonset_pod_status == 'Init:0/1' ]; then
kubectl describe dj hello-world
init_container_status=$(kubectl get pod $daemonset_pod -o 'jsonpath={.status.initContainerStatuses[0].state.running}')
if [ ! -z "$init_container_status" ]; then
expected_log=$(kubectl logs $daemonset_pod -c hello-world)