From 52502ca17c7b46f781fdd8c20f5caf050f5c1f55 Mon Sep 17 00:00:00 2001 From: Ian Ibbotson Date: Mon, 30 Sep 2024 12:34:59 +0100 Subject: [PATCH] updated --- README.md | 1 - index.yaml | 15 ++- ki-selfhost-operator-0.1.0.tgz | Bin 0 -> 4204 bytes ki-selfhost-operator/.helmignore | 23 ++++ ki-selfhost-operator/Chart.yaml | 24 ++++ ki-selfhost-operator/templates/NOTES.txt | 22 ++++ ki-selfhost-operator/templates/_helpers.tpl | 62 +++++++++ .../templates/deployment.yaml | 68 ++++++++++ ki-selfhost-operator/templates/hpa.yaml | 32 +++++ ki-selfhost-operator/templates/ingress.yaml | 43 +++++++ ki-selfhost-operator/templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 13 ++ .../templates/tests/test-connection.yaml | 15 +++ ki-selfhost-operator/values.yaml | 121 ++++++++++++++++++ 14 files changed, 451 insertions(+), 3 deletions(-) create mode 100644 ki-selfhost-operator-0.1.0.tgz create mode 100644 ki-selfhost-operator/.helmignore create mode 100644 ki-selfhost-operator/Chart.yaml create mode 100644 ki-selfhost-operator/templates/NOTES.txt create mode 100644 ki-selfhost-operator/templates/_helpers.tpl create mode 100644 ki-selfhost-operator/templates/deployment.yaml create mode 100644 ki-selfhost-operator/templates/hpa.yaml create mode 100644 ki-selfhost-operator/templates/ingress.yaml create mode 100644 ki-selfhost-operator/templates/service.yaml create mode 100644 ki-selfhost-operator/templates/serviceaccount.yaml create mode 100644 ki-selfhost-operator/templates/tests/test-connection.yaml create mode 100644 ki-selfhost-operator/values.yaml diff --git a/README.md b/README.md index 871243a..886088a 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,5 @@ Update chart with helm package quire - helm repo index . diff --git a/index.yaml b/index.yaml index 5963b57..45bdcf9 100644 --- a/index.yaml +++ b/index.yaml @@ -1,9 +1,20 @@ apiVersion: v1 entries: + ki-selfhost-operator: + - apiVersion: v2 + appVersion: 1.16.0 + created: "2024-09-30T12:34:45.877036811+01:00" + description: A Helm chart for Kubernetes + digest: b4621081cb2124d4ca4cf1f8bb5ef020a2af262b47ed6c71153be7268e568c6d + name: ki-selfhost-operator + type: application + urls: + - ki-selfhost-operator-0.1.0.tgz + version: 0.1.0 quire: - apiVersion: v2 appVersion: native-0.1 - created: "2024-08-09T15:34:51.49589606+01:00" + created: "2024-09-30T12:34:45.87735185+01:00" description: A Helm chart to provision a Quire instance digest: a5ca256454d9b5f0b77e77fd8dadfd90cf3d078f3afb189cf1abcaa46355d7fa name: quire @@ -11,4 +22,4 @@ entries: urls: - quire-0.1.0.tgz version: 0.1.0 -generated: "2024-08-09T15:34:51.495125462+01:00" +generated: "2024-09-30T12:34:45.876545086+01:00" diff --git a/ki-selfhost-operator-0.1.0.tgz b/ki-selfhost-operator-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..8d978fcd51de7968a8e7bb87ed55b64065e6616d GIT binary patch literal 4204 zcmV-y5R>m8iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH;dZyUFg`Fa0}IoS_sbKRBXICii=aPT>Kea0n@5T|)4ilU%) zM-pp_+>%_`s^k0H5B%6qtt>fqoxFSI5B4sXoEZ)|9~=&KPD6!kG80ONB11{Ekp1Hs zkvdwEIeT&+WiS{F4)*u$|G{9;{y*3o96lND9~>UM7#utw?mrm}U+f*ccmjia!M>s7 zN)!2HaA#cY!TpOAlF?5n6%{;&#a=+Ntb83t!-HrLq^J@}Gi~dR;2+55keCGm6CvS$ z@-a$|8dbo_9AoHOP=Q`%7z4>NMiXKn1&ad9AR0!4;A^wt-?nth|AMd_)x9Zzo8^Bv z7#{Am<^RRrqx?Te*@4$MAvx3FCfy2k*P@7m9r!q-3aA1CKOen&8%~6r6Rk0Y31w&+ zyvBqPiLfA&k}*RCTEG|~BT8WklxqP?kxS4x&lu6DqM(3#K^X&u8uSc7qE!{kfN2~kMe3&Mng? zbec;HGm(a73JB#W`-YCtQV@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?A74T))zP8Ww z|EX;7|7RJw`!%2q{{P-!aPWBk|CLH>cfH1kZtN0jNm`3NzghT)kn~Su1=&cXN4^Eh zZ*k{fDf?(MzCPf@f$iD_nfjHTkk!jyIF3fbTFpnO^Ssu^cd93~t?N{^@tsghn$%g= zJ;OJr#}&Fa^f}ufy!8&6X1`M6jxkA=mo*MS-8MT=HGH*iWPy@QvG#H8khi0}WuZ25 z;)V>sFJy+xM13fJY(f9G9gTV{4_!9c|03V&PCmdU`#;=o-~T^696Z|p2Pqpe`NEd* zukNHo=P%uvN)azSab3S9liw8?@&hF8INC}KZOxWsec8ls3Q#Gs2{tfQA zGA7A6@-%M6hiaGmn&sAVwYwU8@)ti=Y5{mYAEUJJcQ*&JI-IOW2jgF+Y_R{uwEva% ze{itZk^l8*{~x3@e*dR1axxW5TF|NYkQ zf9>tP7(9QJ|A#1@Vm%URhb;GQY5c?1vgzHYOs|M&uShkwd6JwVlNBQ&zkjRLp3$&4tT0P-uumc>Y?uPMqnZyab#MGJQ z|M)(F_na+3aNE<61Q|;EgCkK8y*~TxObdy@4)`qfPseAFQmKMyN_F4s)p_)pol ze~XIQv~T_tuWG^j6`(Om&hyOvhM@|cMd~68o<(DF9z2Wm+&l|Or@^!T4R+uYkyPXg zPF}xJL6k}HJ0?1aXo{ronoIF}5G_<9QtUrQJs!(rc`V;@`M&@F0RR90UI8`$TmS$e C&OK8A literal 0 HcmV?d00001 diff --git a/ki-selfhost-operator/.helmignore b/ki-selfhost-operator/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/ki-selfhost-operator/.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/ki-selfhost-operator/Chart.yaml b/ki-selfhost-operator/Chart.yaml new file mode 100644 index 0000000..e823479 --- /dev/null +++ b/ki-selfhost-operator/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: ki-selfhost-operator +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: 0.1.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: "1.16.0" diff --git a/ki-selfhost-operator/templates/NOTES.txt b/ki-selfhost-operator/templates/NOTES.txt new file mode 100644 index 0000000..4c5e776 --- /dev/null +++ b/ki-selfhost-operator/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 "ki-selfhost-operator.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 "ki-selfhost-operator.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "ki-selfhost-operator.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 "ki-selfhost-operator.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/ki-selfhost-operator/templates/_helpers.tpl b/ki-selfhost-operator/templates/_helpers.tpl new file mode 100644 index 0000000..c0ef5f6 --- /dev/null +++ b/ki-selfhost-operator/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "ki-selfhost-operator.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 "ki-selfhost-operator.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 "ki-selfhost-operator.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "ki-selfhost-operator.labels" -}} +helm.sh/chart: {{ include "ki-selfhost-operator.chart" . }} +{{ include "ki-selfhost-operator.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "ki-selfhost-operator.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ki-selfhost-operator.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "ki-selfhost-operator.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "ki-selfhost-operator.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/ki-selfhost-operator/templates/deployment.yaml b/ki-selfhost-operator/templates/deployment.yaml new file mode 100644 index 0000000..e288215 --- /dev/null +++ b/ki-selfhost-operator/templates/deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "ki-selfhost-operator.fullname" . }} + labels: + {{- include "ki-selfhost-operator.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "ki-selfhost-operator.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "ki-selfhost-operator.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "ki-selfhost-operator.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- 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/ki-selfhost-operator/templates/hpa.yaml b/ki-selfhost-operator/templates/hpa.yaml new file mode 100644 index 0000000..a8804e5 --- /dev/null +++ b/ki-selfhost-operator/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "ki-selfhost-operator.fullname" . }} + labels: + {{- include "ki-selfhost-operator.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "ki-selfhost-operator.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/ki-selfhost-operator/templates/ingress.yaml b/ki-selfhost-operator/templates/ingress.yaml new file mode 100644 index 0000000..366599b --- /dev/null +++ b/ki-selfhost-operator/templates/ingress.yaml @@ -0,0 +1,43 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "ki-selfhost-operator.fullname" . }} + labels: + {{- include "ki-selfhost-operator.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- with .Values.ingress.className }} + ingressClassName: {{ . }} + {{- 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 }} + {{- with .pathType }} + pathType: {{ . }} + {{- end }} + backend: + service: + name: {{ include "ki-selfhost-operator.fullname" $ }} + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/ki-selfhost-operator/templates/service.yaml b/ki-selfhost-operator/templates/service.yaml new file mode 100644 index 0000000..4cf2e14 --- /dev/null +++ b/ki-selfhost-operator/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "ki-selfhost-operator.fullname" . }} + labels: + {{- include "ki-selfhost-operator.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "ki-selfhost-operator.selectorLabels" . | nindent 4 }} diff --git a/ki-selfhost-operator/templates/serviceaccount.yaml b/ki-selfhost-operator/templates/serviceaccount.yaml new file mode 100644 index 0000000..25f3f51 --- /dev/null +++ b/ki-selfhost-operator/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "ki-selfhost-operator.serviceAccountName" . }} + labels: + {{- include "ki-selfhost-operator.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/ki-selfhost-operator/templates/tests/test-connection.yaml b/ki-selfhost-operator/templates/tests/test-connection.yaml new file mode 100644 index 0000000..011a0df --- /dev/null +++ b/ki-selfhost-operator/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "ki-selfhost-operator.fullname" . }}-test-connection" + labels: + {{- include "ki-selfhost-operator.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "ki-selfhost-operator.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/ki-selfhost-operator/values.yaml b/ki-selfhost-operator/values.yaml new file mode 100644 index 0000000..9dbd239 --- /dev/null +++ b/ki-selfhost-operator/values.yaml @@ -0,0 +1,121 @@ +# Default values for ki-selfhost-operator. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ +replicaCount: 1 + +image: + repository: docker.libsdev.k-int.com/knowledgeintegration/ki-selfhost-operator + pullPolicy: Latest + # Overrides the image tag whose default is the chart appVersion. + tag: "v1" + +# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +imagePullSecrets: [] +# This is to override the chart name. +nameOverride: "" +fullnameOverride: "" + +#This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "ki-selfhost-operator" + +# This is for setting Kubernetes Annotations to a Pod. +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +podAnnotations: {} +# This is for setting Kubernetes Labels to a Pod. +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ +service: + # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + type: ClusterIP + # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports + port: 80 + +# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +livenessProbe: + httpGet: + path: / + port: http +readinessProbe: + httpGet: + path: / + port: http + +#This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {}