From eaf496d703093fb8a5614ab13eae1f9d7be7a69f Mon Sep 17 00:00:00 2001 From: thaoduc Date: Wed, 8 Oct 2025 14:34:13 +0700 Subject: [PATCH] vnb --- lbl-02/.helmignore | 23 +++ lbl-02/Chart.yaml | 24 +++ lbl-02/lbl-02-0.1.0.tgz | Bin 0 -> 4942 bytes lbl-02/templates/NOTES.txt | 35 +++++ lbl-02/templates/_helpers.tpl | 62 ++++++++ lbl-02/templates/deployment.yaml | 78 ++++++++++ lbl-02/templates/hpa.yaml | 32 ++++ lbl-02/templates/httproute.yaml | 38 +++++ lbl-02/templates/ingress.yaml | 43 ++++++ lbl-02/templates/service.yaml | 15 ++ lbl-02/templates/serviceaccount.yaml | 13 ++ lbl-02/templates/tests/test-connection.yaml | 15 ++ lbl-02/values.yaml | 161 ++++++++++++++++++++ 13 files changed, 539 insertions(+) create mode 100644 lbl-02/.helmignore create mode 100644 lbl-02/Chart.yaml create mode 100644 lbl-02/lbl-02-0.1.0.tgz create mode 100644 lbl-02/templates/NOTES.txt create mode 100644 lbl-02/templates/_helpers.tpl create mode 100644 lbl-02/templates/deployment.yaml create mode 100644 lbl-02/templates/hpa.yaml create mode 100644 lbl-02/templates/httproute.yaml create mode 100644 lbl-02/templates/ingress.yaml create mode 100644 lbl-02/templates/service.yaml create mode 100644 lbl-02/templates/serviceaccount.yaml create mode 100644 lbl-02/templates/tests/test-connection.yaml create mode 100644 lbl-02/values.yaml diff --git a/lbl-02/.helmignore b/lbl-02/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/lbl-02/.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/lbl-02/Chart.yaml b/lbl-02/Chart.yaml new file mode 100644 index 0000000..e0ff032 --- /dev/null +++ b/lbl-02/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: lbl-02 +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/lbl-02/lbl-02-0.1.0.tgz b/lbl-02/lbl-02-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..4d637dd97aedd83958a42dacfcd6c3a0b0ca26d9 GIT binary patch literal 4942 zcmV-U6S3?ciwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PK8wZ`-)C`2MX=F+ZmVef%ofPSd6ku(-%=dv=4{rbd$O!D6u} zXlZP7Lz7yPa^g*MKl=qAddp7Qrsufd2uupo3e1UJAAbuQb%jDWIx<~ z8;wSz7khj5|7bL7{~wL_$3KjpkM_rV0-$v~*goG?71yz8Y71 za{nfcWb^|{MFo#xwHuHuD=){<_(e1dQdEhgnYQ;1;Adn@NQ}6^Oi1{ze2S8zMip?f z#2B1F1$v!f3?$1KO^6vAtO~fJXdI1#?>+JRW}Dal6=6B5Z)5;HIncekVed%Ju0 z`hOQ~2VUchGLLyM^P*TAm zA>2ToiJYgfK#4Idw9ZsK9G;a{D57GRibM?)!4u518lDSz#so?2EiDCODAlk+Hw^sm zR|ahiztoW{|=}8Y0cLA%*fe5bjaUq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@GYRfl|apnN^?R3oj&ThvVx*OBls5h;7`#L9Uef*$$P3opWRUbbHwWLX% zE&c1Zy}Gq9U)5Ow=P!e%`>gDsV?~nX)gc9opzhurs2aZ7GqOTS=2&~UamqKNyk+FC z<;0c(-Y;Z^t0ccGe%yfmFVA;%?Z4KUwDmo=<^`^^|1Vy2@;~GK`})s2Y1dYA775@7 z#_}EcmqXjEVmUyq60--Y7jiYWKw-Ab$T0WQ)@&z zx{6}d(l$3v%v~Rt_xJ|~xHy+rGOl)f?h60|Oi6NvJgpWEnwgiDJQgi0G6SWGG#;NL zoiDUIyz(`s{YI^0|BHIbTigR&WB+$Y`_J3;A1_At`TsjA5|-!E)12W zsrD+pKB|=pH|iqiR=>r>J_ zPW1kT`v1b#@&AQL+@1d)J>P4e|J!@Mf1m%mlh*kDXW`0yb=3FD-s#e`ZY<@my^{;8 zczU~8bJ>(hb*|mp%bpi+jkkNvGJ(&n3E2C48_G@k?@PvR#SC1h|0dXP>i>)J-uPbs z@1otPwy(VlXd4RO{bu%JOBKa!ZUR~}xy8Le`8mSo>`%oR@;)LbN9)QuQLPJ`v3h=OaJ%x?$7_M=opT}a_HkUR|Iga_zumpj{rRsuX*)0>TBCHImvs^V z=L__oBc^-~8A;CEN2H7IK;@bHf~Hy^V=!l8T7E(ADM(~Q(-qn*N$o!2X|Mwv=k9|B zk23q&Hvg?c_u zUq^lrP5+WZ`?t8Um=DdL;!>^numUtC$yuJ+FPf|1Nu%TTlC+00030 M|8Q2?asX%m0IwOVVgLXD literal 0 HcmV?d00001 diff --git a/lbl-02/templates/NOTES.txt b/lbl-02/templates/NOTES.txt new file mode 100644 index 0000000..0670a08 --- /dev/null +++ b/lbl-02/templates/NOTES.txt @@ -0,0 +1,35 @@ +1. Get the application URL by running these commands: +{{- if .Values.httpRoute.enabled }} +{{- if .Values.httpRoute.hostnames }} + export APP_HOSTNAME={{ .Values.httpRoute.hostnames | first }} +{{- else }} + export APP_HOSTNAME=$(kubectl get --namespace {{(first .Values.httpRoute.parentRefs).namespace | default .Release.Namespace }} gateway/{{ (first .Values.httpRoute.parentRefs).name }} -o jsonpath="{.spec.listeners[0].hostname}") + {{- end }} +{{- if and .Values.httpRoute.rules (first .Values.httpRoute.rules).matches (first (first .Values.httpRoute.rules).matches).path.value }} + echo "Visit http://$APP_HOSTNAME{{ (first (first .Values.httpRoute.rules).matches).path.value }} to use your application" + + NOTE: Your HTTPRoute depends on the listener configuration of your gateway and your HTTPRoute rules. + The rules can be set for path, method, header and query parameters. + You can check the gateway configuration with 'kubectl get --namespace {{(first .Values.httpRoute.parentRefs).namespace | default .Release.Namespace }} gateway/{{ (first .Values.httpRoute.parentRefs).name }} -o yaml' +{{- end }} +{{- else 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 "lbl-02.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 "lbl-02.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "lbl-02.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 "lbl-02.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/lbl-02/templates/_helpers.tpl b/lbl-02/templates/_helpers.tpl new file mode 100644 index 0000000..5829600 --- /dev/null +++ b/lbl-02/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "lbl-02.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 "lbl-02.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 "lbl-02.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "lbl-02.labels" -}} +helm.sh/chart: {{ include "lbl-02.chart" . }} +{{ include "lbl-02.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "lbl-02.selectorLabels" -}} +app.kubernetes.io/name: {{ include "lbl-02.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "lbl-02.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "lbl-02.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/lbl-02/templates/deployment.yaml b/lbl-02/templates/deployment.yaml new file mode 100644 index 0000000..4eeb0db --- /dev/null +++ b/lbl-02/templates/deployment.yaml @@ -0,0 +1,78 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "lbl-02.fullname" . }} + labels: + {{- include "lbl-02.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "lbl-02.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "lbl-02.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "lbl-02.serviceAccountName" . }} + {{- with .Values.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + {{- with .Values.livenessProbe }} + livenessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.readinessProbe }} + readinessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- 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/lbl-02/templates/hpa.yaml b/lbl-02/templates/hpa.yaml new file mode 100644 index 0000000..fe14870 --- /dev/null +++ b/lbl-02/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "lbl-02.fullname" . }} + labels: + {{- include "lbl-02.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "lbl-02.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/lbl-02/templates/httproute.yaml b/lbl-02/templates/httproute.yaml new file mode 100644 index 0000000..b607f7e --- /dev/null +++ b/lbl-02/templates/httproute.yaml @@ -0,0 +1,38 @@ +{{- if .Values.httpRoute.enabled -}} +{{- $fullName := include "lbl-02.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }} + labels: + {{- include "lbl-02.labels" . | nindent 4 }} + {{- with .Values.httpRoute.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- with .Values.httpRoute.parentRefs }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.httpRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + {{- range .Values.httpRoute.rules }} + {{- with .matches }} + - matches: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .filters }} + filters: + {{- toYaml . | nindent 8 }} + {{- end }} + backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + weight: 1 + {{- end }} +{{- end }} diff --git a/lbl-02/templates/ingress.yaml b/lbl-02/templates/ingress.yaml new file mode 100644 index 0000000..366ab53 --- /dev/null +++ b/lbl-02/templates/ingress.yaml @@ -0,0 +1,43 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "lbl-02.fullname" . }} + labels: + {{- include "lbl-02.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 "lbl-02.fullname" $ }} + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/lbl-02/templates/service.yaml b/lbl-02/templates/service.yaml new file mode 100644 index 0000000..e8157f8 --- /dev/null +++ b/lbl-02/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "lbl-02.fullname" . }} + labels: + {{- include "lbl-02.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "lbl-02.selectorLabels" . | nindent 4 }} diff --git a/lbl-02/templates/serviceaccount.yaml b/lbl-02/templates/serviceaccount.yaml new file mode 100644 index 0000000..fba7327 --- /dev/null +++ b/lbl-02/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "lbl-02.serviceAccountName" . }} + labels: + {{- include "lbl-02.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/lbl-02/templates/tests/test-connection.yaml b/lbl-02/templates/tests/test-connection.yaml new file mode 100644 index 0000000..adf3b8a --- /dev/null +++ b/lbl-02/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "lbl-02.fullname" . }}-test-connection" + labels: + {{- include "lbl-02.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "lbl-02.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/lbl-02/values.yaml b/lbl-02/values.yaml new file mode 100644 index 0000000..5b997e8 --- /dev/null +++ b/lbl-02/values.yaml @@ -0,0 +1,161 @@ +# Default values for lbl-02. +# 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 + +# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ +image: + repository: heartexlabs/label-studio + # This sets the pull policy for images. + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +# This is for the secrets 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: "" + +# 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: lbl-studio.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: lbl-studio-tls + # hosts: + # - lbl-studio.local + +# -- Expose the service via gateway-api HTTPRoute +# Requires Gateway API resources and suitable controller installed within the cluster +# (see: https://gateway-api.sigs.k8s.io/guides/) +httpRoute: + # HTTPRoute enabled. + enabled: false + # HTTPRoute annotations. + annotations: {} + # Which Gateways this Route is attached to. + parentRefs: + - name: gateway + sectionName: http + # namespace: default + # Hostnames matching HTTP header. + hostnames: + - lbl-studio.local + # List of rules and filters applied. + rules: + - matches: + - path: + type: PathPrefix + value: /headers + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: My-Overwrite-Header + # value: this-is-the-only-value + # remove: + # - User-Agent + # - matches: + # - path: + # type: PathPrefix + # value: /echo + # headers: + # - name: version + # value: v2 + +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: {}