diff options
Diffstat (limited to 'helmcharts/dp-trace-telemetry/helm/templates/deployment.yaml')
| -rw-r--r-- | helmcharts/dp-trace-telemetry/helm/templates/deployment.yaml | 233 |
1 files changed, 233 insertions, 0 deletions
diff --git a/helmcharts/dp-trace-telemetry/helm/templates/deployment.yaml b/helmcharts/dp-trace-telemetry/helm/templates/deployment.yaml new file mode 100644 index 00000000..502392af --- /dev/null +++ b/helmcharts/dp-trace-telemetry/helm/templates/deployment.yaml @@ -0,0 +1,233 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dp-trace-telemetry + labels: + app: dp-trace-telemetry + component: dp-trace-telemetry + annotations: + configmap.reloader.stakater.com/reload: dp-trace-telemetry-{{ .Release.Name }} + +spec: + replicas: 1 + selector: + matchLabels: + app: dp-trace-telemetry + strategy: + type: Recreate + template: + metadata: + labels: + app: dp-trace-telemetry + serviceFunction: {{.Release.Name}} + component: dp-trace-telemetry + annotations: + kubectl.kubernetes.io/default-container: dp-trace-telemetry + prometheus.io/port: "9005" + prometheus.io/scrape: "true" + spec: + serviceAccountName: {{ .Release.Name }} + shareProcessNamespace: true + tolerations: + - key: node-role.kubernetes.io/control-plane + operator: Exists + effect: NoSchedule + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule + containers: + - name: inotify-dynamic-conf + image: "registry.gdnt-cloud.website/tsg/os/dp-trace-telemetry:{{ .Chart.AppVersion }}" + imagePullPolicy: Never + command: + - "bash" + - "-ec" + - | + /usr/local/bin/j2 -f yaml /templates/dp_trace_dy.conf.j2 /templates/values.yaml -o /opt/tsg/dp_trace_telemetry/share_conf/dp_trace_dy.conf + WATCH_DIR="/templates/values.yaml" + while inotifywait -r -e modify,create "$WATCH_DIR"; do + echo "send HUB signal to dp_trace" + /usr/local/bin/j2 -f yaml /templates/dp_trace_dy.conf.j2 /templates/values.yaml -o /opt/tsg/dp_trace_telemetry/share_conf/dp_trace_dy.conf + pkill -1 dp-trace-telemetry + echo "signal send" + done + volumeMounts: + - name: dp-trace-dy + mountPath: "/templates/values.yaml" + subPath: "values.yaml" + - name: share-config + mountPath: /opt/tsg/dp_trace_telemetry/share_conf/ + lifecycle: + postStart: + exec: + command: + - "bash" + - "-ec" + - | + while true; do + if [ -f "/opt/tsg/dp_trace_telemetry/share_conf/dp_trace_dy.conf" ]; then + echo "File /opt/tsg/dp_trace_telemetry/share_conf/dp_trace_dy.conf exists. Exiting." + exit 0 + fi + echo "File /opt/tsg/dp_trace_telemetry/share_conf/dp_trace_dy.conf does not exist. Sleeping for 2 seconds." + sleep 2 + done + - name: dp-trace-telemetry + image: "registry.gdnt-cloud.website/tsg/os/dp-trace-telemetry:{{ .Chart.AppVersion }}" + imagePullPolicy: Never + workingDir: /opt/tsg/dp_trace_telemetry/ + command: + - "bash" + - "-ec" + - | + ln -sf /opt/tsg/dp_trace_telemetry/share_conf/dp_trace_dy.conf /opt/tsg/dp_trace_telemetry/etc/dp_trace_dy.conf + /usr/local/bin/entrypoint.sh \ + {{- if .Values.datapath_trace.debug.enable_prestart_script }} + --enable_prestart \ + {{- end }} + {{- if .Values.datapath_trace.debug.enable_interactive_startup }} + --enable_interactive_startup \ + {{- end }} + || echo "Failed to start." + volumeMounts: + - name: dp-trace-telemetry-configs-volume + mountPath: "/templates/values.yaml" + subPath: "values.yaml" + - name: dp-telemetry-daemon + mountPath: /var/lib/dp_telemetry_daemon + - name: share-config + mountPath: /opt/tsg/dp_trace_telemetry/share_conf/ + - name: localtime-node + mountPath: /etc/localtime + readOnly: true + - name: opt-tsg-mrzcpd + mountPath: /opt/tsg/mrzcpd + mountPropagation: HostToContainer + readOnly: false + - name: var-run-mrzcpd + mountPath: /var/run/mrzcpd + readOnly: false + - name: var-run-dpdk + mountPath: /var/run/dpdk + readOnly: false + - name: profile-mrzcpd + mountPath: /etc/profile.d/mrzcpd.sh + readOnly: true + - name: ldconfig-mrzcpd + mountPath: /etc/ld.so.conf.d/mrzcpd.conf + readOnly: true + {{- if .Values.datapath_trace.debug.enable_mount_host_filesystem }} + - name: host-root + mountPath: /host + {{- end }} + {{- if .Values.datapath_trace.debug.enable_prestart_script }} + - name: prestart-dir + mountPath: /tmp/prestart + - name: dp-trace-prestart + mountPath: /opt/tsg/scripts/prestart.sh + {{- end }} + env: + - name: SLED_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + - name: DEPLOYMENT_NAME + value: dp-trace-telemetry + securityContext: + privileged: true + ports: + - containerPort: 9086 +{{- if .Values.datapath_trace.debug.enable_liveness_probe }} + livenessProbe: + httpGet: + httpHeaders: + - name: Custom-Header + value: Awesome + path: /probe + port: 9086 + initialDelaySeconds: 30 + periodSeconds: 3 + successThreshold: 1 + timeoutSeconds: 10 + startupProbe: + httpGet: + httpHeaders: + - name: Custom-Header + value: Awesome + path: /probe + port: 9086 + initialDelaySeconds: 30 + periodSeconds: 3 + successThreshold: 1 + timeoutSeconds: 10 +{{- end }} + initContainers: + - name: init-packet-io-engine-ready + image: "registry.gdnt-cloud.website/tsg/os/dp-trace-telemetry:{{ .Chart.AppVersion }}" + imagePullPolicy: Never + command: + - "bash" + - "-ec" + - | + until [ $(curl -s -o /dev/null -w "%{http_code}" http://${NODE_IP}:9086/probe) -eq 200 ]; do echo waiting for packet-io-engine ready; sleep 2; done + env: + - name: NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + - name: init-default-svc + image: "registry.gdnt-cloud.website/tsg/os/dp-trace-telemetry:{{ .Chart.AppVersion }}" + imagePullPolicy: Never + command: + - "bash" + - "-ec" + - | + until nslookup kubernetes.default.svc; do echo waiting for kubernetes service; sleep 2; done + volumes: + - name: share-config + emptyDir: {} + - name: dp-trace-telemetry-configs-volume + configMap: + name: dp-trace-telemetry-{{ .Release.Name }} + - name: prestart-dir + hostPath: + path: /etc/tsg-os/{{ .Release.Name }}/ + type: DirectoryOrCreate + - name: dp-trace-prestart + hostPath: + {{- if .Values.datapath_trace.debug.prestart_script }} + path: {{ .Values.datapath_trace.debug.prestart_script }} + {{- else }} + path: /etc/tsg-os/{{ .Release.Name }}/dp_trace_prestart_script.sh + {{- end }} + type: FileOrCreate + - name: opt-tsg-mrzcpd + hostPath: + path: /opt/tsg/mrzcpd + - name: var-run-mrzcpd + hostPath: + path: /var/run/mrzcpd + - name: var-run-dpdk + hostPath: + path: /var/run/dpdk + - name: profile-mrzcpd + hostPath: + path: /etc/profile.d/mrzcpd.sh + type: File + - name: ldconfig-mrzcpd + hostPath: + path: /etc/ld.so.conf.d/mrzcpd.conf + type: File + - name: localtime-node + hostPath: + path: /etc/localtime + - name: dp-telemetry-daemon + hostPath: + path: /var/lib/dp_telemetry_daemon + type: DirectoryOrCreate + - name: dp-trace-dy + configMap: + name: dp-trace-telemetry-reload-{{ .Release.Name }} + - name: host-root + hostPath: + path: / |
