From 2b1cc777b5be9bbdeddbcb2e3c6b9225b739792a Mon Sep 17 00:00:00 2001 From: titver968 Date: Tue, 4 Mar 2025 11:36:36 +0100 Subject: [PATCH] tatort name hinzugefuegt --- tatort/templates/NOTES.txt | 8 ++++---- tatort/templates/_helpers.tpl | 20 ++++++++++---------- tatort/templates/hpa.yaml | 6 +++--- tatort/templates/ingress.yaml | 4 ++-- tatort/templates/service.yaml | 6 +++--- tatort/templates/serviceaccount.yaml | 4 ++-- tatort/templates/tests/test-connection.yaml | 6 +++--- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tatort/templates/NOTES.txt b/tatort/templates/NOTES.txt index 9268168..7292535 100644 --- a/tatort/templates/NOTES.txt +++ b/tatort/templates/NOTES.txt @@ -6,16 +6,16 @@ {{- 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 "..fullname" . }}) + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "tatort.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 "..fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "..fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "tatort.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "tatort.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 "..name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "tatort.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 diff --git a/tatort/templates/_helpers.tpl b/tatort/templates/_helpers.tpl index 7fc608d..e92e60f 100644 --- a/tatort/templates/_helpers.tpl +++ b/tatort/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "..name" -}} +{{- define "tatort.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ 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 "..fullname" -}} +{{- define "tatort.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "..chart" -}} +{{- define "tatort.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "..labels" -}} -helm.sh/chart: {{ include "..chart" . }} -{{ include "..selectorLabels" . }} +{{- define "tatort.labels" -}} +helm.sh/chart: {{ include "tatort.chart" . }} +{{ include "tatort.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "..selectorLabels" -}} -app.kubernetes.io/name: {{ include "..name" . }} +{{- define "tatort.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tatort.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} -{{- define "..serviceAccountName" -}} +{{- define "tatort.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "..fullname" .) .Values.serviceAccount.name }} +{{- default (include "tatort.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/tatort/templates/hpa.yaml b/tatort/templates/hpa.yaml index 4cc3c5f..06c6551 100644 --- a/tatort/templates/hpa.yaml +++ b/tatort/templates/hpa.yaml @@ -2,14 +2,14 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: {{ include "..fullname" . }} + name: {{ include "tatort.fullname" . }} labels: - {{- include "..labels" . | nindent 4 }} + {{- include "tatort.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "..fullname" . }} + name: {{ include "tatort.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: diff --git a/tatort/templates/ingress.yaml b/tatort/templates/ingress.yaml index 2af0f61..74a1c43 100644 --- a/tatort/templates/ingress.yaml +++ b/tatort/templates/ingress.yaml @@ -1,5 +1,5 @@ {{- if .Values.ingress.enabled -}} -{{- $fullName := include "..fullname" . -}} +{{- $fullName := include "tatort.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") }} @@ -17,7 +17,7 @@ kind: Ingress metadata: name: {{ $fullName }} labels: - {{- include "..labels" . | nindent 4 }} + {{- include "tatort.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/tatort/templates/service.yaml b/tatort/templates/service.yaml index 806ad98..ee9577c 100644 --- a/tatort/templates/service.yaml +++ b/tatort/templates/service.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "..fullname" . }} + name: {{ include "tatort.fullname" . }} labels: - {{- include "..labels" . | nindent 4 }} + {{- include "tatort.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: @@ -12,4 +12,4 @@ spec: protocol: TCP name: http selector: - {{- include "..selectorLabels" . | nindent 4 }} + {{- include "tatort.selectorLabels" . | nindent 4 }} diff --git a/tatort/templates/serviceaccount.yaml b/tatort/templates/serviceaccount.yaml index d77af33..d3dfd45 100644 --- a/tatort/templates/serviceaccount.yaml +++ b/tatort/templates/serviceaccount.yaml @@ -2,9 +2,9 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "..serviceAccountName" . }} + name: {{ include "tatort.serviceAccountName" . }} labels: - {{- include "..labels" . | nindent 4 }} + {{- include "tatort.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/tatort/templates/tests/test-connection.yaml b/tatort/templates/tests/test-connection.yaml index 5216f9d..e7ec09b 100644 --- a/tatort/templates/tests/test-connection.yaml +++ b/tatort/templates/tests/test-connection.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "..fullname" . }}-test-connection" + name: "{{ include "tatort.fullname" . }}-test-connection" labels: - {{- include "..labels" . | nindent 4 }} + {{- include "tatort.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: @@ -11,5 +11,5 @@ spec: - name: wget image: busybox command: ['wget'] - args: ['{{ include "..fullname" . }}:{{ .Values.service.port }}'] + args: ['{{ include "tatort.fullname" . }}:{{ .Values.service.port }}'] restartPolicy: Never