From 9c1ab2c43d90dac54197871d8d64d430caa92ad4 Mon Sep 17 00:00:00 2001 From: Ju Young Kim Date: Thu, 31 Oct 2024 11:41:29 -0400 Subject: [PATCH] PILOT-6142: Add FileOps service helm charts (#141) * helm-charts: add fileops service * docs: build index for helm repo for fileops service * pr_feed: update values.yaml file * add httptarget for fileops readiness probe * add livenessProbe and pr_feed --- docs/fileops-service-1.0.0.tgz | Bin 0 -> 4256 bytes docs/index.yaml | 11 ++ fileops-service/.helmignore | 23 +++ fileops-service/Chart.yaml | 24 +++ fileops-service/templates/NOTES.txt | 22 +++ fileops-service/templates/_helpers.tpl | 62 ++++++ fileops-service/templates/deployment.yaml | 183 ++++++++++++++++++ fileops-service/templates/ingress.yaml | 61 ++++++ fileops-service/templates/service.yaml | 15 ++ fileops-service/templates/serviceaccount.yaml | 18 ++ .../templates/tests/test-connection.yaml | 15 ++ fileops-service/values.yaml | 107 ++++++++++ 12 files changed, 541 insertions(+) create mode 100644 docs/fileops-service-1.0.0.tgz create mode 100644 fileops-service/.helmignore create mode 100644 fileops-service/Chart.yaml create mode 100644 fileops-service/templates/NOTES.txt create mode 100644 fileops-service/templates/_helpers.tpl create mode 100644 fileops-service/templates/deployment.yaml create mode 100644 fileops-service/templates/ingress.yaml create mode 100644 fileops-service/templates/service.yaml create mode 100644 fileops-service/templates/serviceaccount.yaml create mode 100644 fileops-service/templates/tests/test-connection.yaml create mode 100644 fileops-service/values.yaml diff --git a/docs/fileops-service-1.0.0.tgz b/docs/fileops-service-1.0.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..2e795d6bec424761fbbeecf6ebbfe55af2cff7f1 GIT binary patch literal 4256 zcmV;R5MS>fiwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH;bbK*FY`?LRwJ||!8%-mui?{(E&6+@W$a+3iH*zCTb2V+e{r7sn2U1+0wDF-kuXCj1^h9 zKRsJ(G#ZVQqa*dd(P$L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_91y!NO}-lM(Y0wuPqxWh^*^fl zeu^2`s{hA@_rDGr2Pdbm`u`Gbr-H)b#Vfi9W*z#9^2c)FV<|`&I@)yoS%vY@%J^v`%-Oh1Vp47ipE}f1lbF%A)Un!qp05qd$|pN+;g{XafDF8%&r^Y~T&U!v_np9q1>Q$N@jZamz~(Su3gxVGcXz$ex< znITVp2apH8^0tA`(RE?w(nTk%tW=#Hz z)z#m)V?L|PKk-+-^y(?139+sNU;WG=*WMZY#@F5%6LPJ+GsHrErp%dX@BUlcgDb)u z8gRHc?{LkC3Z^u}v60k6a7O>sj3u|IjrG@P$!mLUukD|?{Z9Y@0RR8)QeHOzTmS%W Cl}{f4 literal 0 HcmV?d00001 diff --git a/docs/index.yaml b/docs/index.yaml index 66cf5fde..1008c22e 100644 --- a/docs/index.yaml +++ b/docs/index.yaml @@ -1897,6 +1897,17 @@ entries: urls: - https://pilotdataplatform.github.io/helm-charts/entityinfo-service-0.1.0.tgz version: 0.1.0 + fileops-service: + - apiVersion: v2 + appVersion: "252" + created: "2024-10-28T01:05:00.195099-04:00" + description: A Helm chart for Kubernetes + digest: b414b15a1bdd5e74fceaafe8ebb5c93edc2e3c85a10ea17caf7a44e7964c8c1a + name: fileops-service + type: application + urls: + - https://pilotdataplatform.github.io/helm-charts/fileops-service-1.0.0.tgz + version: 1.0.0 fluentd: - annotations: category: Analytics diff --git a/fileops-service/.helmignore b/fileops-service/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/fileops-service/.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/fileops-service/Chart.yaml b/fileops-service/Chart.yaml new file mode 100644 index 00000000..77fa4297 --- /dev/null +++ b/fileops-service/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: fileops-service +description: A Helm chart for Kubernetes + +# 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: 1.0.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: "252" diff --git a/fileops-service/templates/NOTES.txt b/fileops-service/templates/NOTES.txt new file mode 100644 index 00000000..47e6e88c --- /dev/null +++ b/fileops-service/templates/NOTES.txt @@ -0,0 +1,22 @@ +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 }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "fileops-service.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "fileops-service.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "fileops-service.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "fileops-service.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/fileops-service/templates/_helpers.tpl b/fileops-service/templates/_helpers.tpl new file mode 100644 index 00000000..7957cb06 --- /dev/null +++ b/fileops-service/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "fileops-service.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 "fileops-service.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 "fileops-service.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "fileops-service.labels" -}} +helm.sh/chart: {{ include "fileops-service.chart" . }} +{{ include "fileops-service.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "fileops-service.selectorLabels" -}} +app.kubernetes.io/name: {{ include "fileops-service.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "fileops-service.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "fileops-service.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/fileops-service/templates/deployment.yaml b/fileops-service/templates/deployment.yaml new file mode 100644 index 00000000..ec7db4c1 --- /dev/null +++ b/fileops-service/templates/deployment.yaml @@ -0,0 +1,183 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "fileops-service.fullname" . }} + labels: + {{- include "fileops-service.labels" . | nindent 4 }} + {{- with .Values.deploymentAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + {{- if .Values.updateStrategy }} + strategy: + {{- toYaml .Values.updateStrategy | nindent 4 }} + {{- end }} + selector: + matchLabels: + {{- include "fileops-service.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "fileops-service.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.serviceAccount.create }} + serviceAccountName: {{ .Values.serviceAccount.name }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.command }} + {{- with .Values.command }} + command: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- end }} + {{- if .Values.args }} + {{- with .Values.args }} + args: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.container.port }} + env: + - name: port + value: {{ .Values.appConfig.port | quote }} + - name: env + value: {{ .Values.appConfig.env | quote }} + - name: CONFIG_CENTER_ENABLED + value: {{ .Values.appConfig.config_center_enabled | quote }} + - name: CONFIG_CENTER_BASE_URL + value: {{ .Values.appConfig.config_center_base_url | quote }} + # log levels + - name: LOG_LEVEL_DEFAULT + value: {{ .Values.appConfig.LOG_LEVEL_DEFAULT | quote}} + - name: LOG_LEVEL_FILE + value: {{ .Values.appConfig.LOG_LEVEL_FILE | quote}} + - name: LOG_LEVEL_STDOUT + value: {{ .Values.appConfig.LOG_LEVEL_STDOUT | quote}} + - name: LOG_LEVEL_STDERR + value: {{ .Values.appConfig.LOG_LEVEL_STDERR | quote }} + - name: CORE_ZONE_LABEL + value: "Core" + - name: GREEN_ZONE_LABEL + value: "Greenroom" + - name: DOWNLOAD_TOKEN_EXPIRE_AT + value: {{ .Values.appConfig.DOWNLOAD_TOKEN_EXPIRE_AT | quote }} + #if core or greenroom +{{- if contains "core" .Values.appConfig.namespace }} + - name: ROOT_PATH + value: "/core-data" +{{- else }} + - name: ROOT_PATH + value: "/data/core-storage" +{{- end}} + #if tenant id is not set +{{- if not .Values.appConfig.tenant_id }} + - name: APPROVAL_SERVICE + value: "http://approval.utility:8000" + - name: DATAOPS_SERVICE + value: "http://dataops.utility:5063" + - name: DATASET_SERVICE + value: "http://dataset.utility:5081" + - name: PROJECT_SERVICE + value: "http://project.utility:5064" + - name: METADATA_SERVICE + value: "http://metadata.utility:5066" + - name: KAFKA_URL + value: "kafka.utility:9092" + - name: KAFKA_ACTIVITY_TOPIC + value: "metadata.items.activity" +{{- else }} + - name: APPROVAL_SERVICE + value: "http://approval.{{ .Values.appConfig.tenant_id }}-utility:8000" + - name: DATAOPS_SERVICE + value: "http://dataops.{{ .Values.appConfig.tenant_id }}-utility:5063" + - name: DATASET_SERVICE + value: "http://dataset.{{ .Values.appConfig.tenant_id }}-utility:5081" + - name: PROJECT_SERVICE + value: "http://project.{{ .Values.appConfig.tenant_id }}-utility:5064" + - name: METADATA_SERVICE + value: "http://metadata.{{ .Values.appConfig.tenant_id }}-utility:5066" + - name: KAFKA_URL + value: "kafka.datastores:9092" + - name: KAFKA_ACTIVITY_TOPIC + value: "{{ .Values.appConfig.tenant_id}}.metadata.items.activity" +{{- end}} + # redis + - name: REDIS_DB + value: {{ .Values.appConfig.REDIS_DB | quote }} +{{- if not .Values.appConfig.tenant_id }} + - name: REDIS_HOST + value: {{ .Values.appConfig.REDIS_HOST | quote }} +{{- else }} + - name: REDIS_HOST + value: "redis-master.{{ .Values.appConfig.tenant_id }}-redis" +{{- end }} + - name: REDIS_PORT + value: {{ .Values.appConfig.REDIS_PORT | quote }} + # telemetry + - name: OPEN_TELEMETRY_ENABLED + value: {{ .Values.appConfig.OPEN_TELEMETRY_ENABLED | quote }} + - name: OPEN_TELEMETRY_HOST + value: {{ .Values.appConfig.OPEN_TELEMETRY_HOST | quote }} + - name: OPEN_TELEMETRY_PORT + value: {{ .Values.appConfig.OPEN_TELEMETRY_PORT | quote }} + +{{- if .Values.extraEnv }} + {{- range $key, $value := .Values.extraEnv }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} +{{- end }} +{{- with .Values.extraEnvYaml }} + {{- toYaml . | nindent 10 }} +{{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- if .Values.volumes }} + volumeMounts: + - mountPath: {{ .Values.volumes.mountPath }} + name: {{ .Values.volumes.name }} + {{- end }} + {{- if .Values.readinessProbe }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + {{- end }} + {{- if .Values.livenessProbe }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + {{- end }} + {{- if .Values.volumes }} + volumes: + - name: {{ .Values.volumes.name }} + persistentVolumeClaim: + claimName: {{ .Values.volumes.claimName }} + {{- 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/fileops-service/templates/ingress.yaml b/fileops-service/templates/ingress.yaml new file mode 100644 index 00000000..71cb60dc --- /dev/null +++ b/fileops-service/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "fileops-service.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 "fileops-service.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/fileops-service/templates/service.yaml b/fileops-service/templates/service.yaml new file mode 100644 index 00000000..fe255cfb --- /dev/null +++ b/fileops-service/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "fileops-service.fullname" . }} + labels: + {{- include "fileops-service.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.targetPort }} + protocol: TCP + name: {{ include "fileops-service.fullname" . }} + selector: + {{- include "fileops-service.selectorLabels" . | nindent 4 }} diff --git a/fileops-service/templates/serviceaccount.yaml b/fileops-service/templates/serviceaccount.yaml new file mode 100644 index 00000000..ed6e2d52 --- /dev/null +++ b/fileops-service/templates/serviceaccount.yaml @@ -0,0 +1,18 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +{{- if .Values.imagePullSecrets }} +imagePullSecrets: +{{- range $key, $secret := .Values.imagePullSecrets }} + - name: {{ $secret.name }} +{{- end }} +{{- end }} +kind: ServiceAccount +metadata: + name: {{ include "fileops-service.serviceAccountName" . }} + labels: + {{- include "fileops-service.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/fileops-service/templates/tests/test-connection.yaml b/fileops-service/templates/tests/test-connection.yaml new file mode 100644 index 00000000..dd22d12e --- /dev/null +++ b/fileops-service/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "fileops-service.fullname" . }}-test-connection" + labels: + {{- include "fileops-service.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "fileops-service.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/fileops-service/values.yaml b/fileops-service/values.yaml new file mode 100644 index 00000000..06151357 --- /dev/null +++ b/fileops-service/values.yaml @@ -0,0 +1,107 @@ +# Default values for upload-service. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: fileops + tag: 252 + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + +appConfig: + port: 5078 + env: "dev" + config_center_enabled: false + config_center_base_url: http://common.utility:5062/ + namespace: "" + + ROOT_PATH: "/data/core-storage" + + LOG_LEVEL_DEFAULT: 30 # WARN + LOG_LEVEL_FILE: 30 # WARN + LOG_LEVEL_STDOUT: 30 # WARN + LOG_LEVEL_STDERR: 40 # ERROR + + REDIS_HOST: "redis-master.redis" + REDIS_PORT: "6379" + REDIS_DB: "0" + + DOWNLOAD_TOKEN_EXPIRE_AT: "86400" + + OPEN_TELEMETRY_ENABLED: "True" + OPEN_TELEMETRY_HOST: "127.0.0.1" + OPEN_TELEMETRY_PORT: "6831" + + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: + +container: + port: 5078 + +initContainers: {} + +deploymentAnnotations: {} + +podAnnotations: {} + +podSecurityContext: {} + +securityContext: {} + +service: + type: ClusterIP + port: 5078 + targetPort: 5078 + +ingress: + enabled: false + +resources: + requests: + cpu: "100m" + memory: "100Mi" + limits: + cpu: "300m" + memory: "300Mi" + +autoscaling: + enabled: false + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +readinessProbe: + httpGet: + path: /v1/health + port: 5078 + initialDelaySeconds: 5 + periodSeconds: 10 + +livenessProbe: + httpGet: + path: /v1/health + port: 5078 + initialDelaySeconds: 5 + periodSeconds: 10 + +updateStrategy: {} + +extraEnv: {} + +extraEnvYaml: {} + +hostAliases: {}