diff --git a/helm/chart/vt/templates/NOTES.txt b/helm/chart/vt/templates/NOTES.txt index c0a4631..7ec5dee 100644 --- a/helm/chart/vt/templates/NOTES.txt +++ b/helm/chart/vt/templates/NOTES.txt @@ -19,16 +19,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 "VT.fullname" . }}) + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "vt.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 "VT.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "VT.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "vt.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "vt.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 "VT.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 "vt.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/helm/chart/vt/templates/_helpers.tpl b/helm/chart/vt/templates/_helpers.tpl index 8ecf252..fe29743 100644 --- a/helm/chart/vt/templates/_helpers.tpl +++ b/helm/chart/vt/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "VT.name" -}} +{{- define "vt.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 "VT.fullname" -}} +{{- define "vt.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 "VT.chart" -}} +{{- define "vt.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "VT.labels" -}} -helm.sh/chart: {{ include "VT.chart" . }} -{{ include "VT.selectorLabels" . }} +{{- define "vt.labels" -}} +helm.sh/chart: {{ include "vt.chart" . }} +{{ include "vt.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 "VT.selectorLabels" -}} -app.kubernetes.io/name: {{ include "VT.name" . }} +{{- define "vt.selectorLabels" -}} +app.kubernetes.io/name: {{ include "vt.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} -{{- define "VT.serviceAccountName" -}} +{{- define "vt.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "VT.fullname" .) .Values.serviceAccount.name }} +{{- default (include "vt.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/helm/chart/vt/templates/deployment.yaml b/helm/chart/vt/templates/deployment.yaml index d672367..a287ffe 100644 --- a/helm/chart/vt/templates/deployment.yaml +++ b/helm/chart/vt/templates/deployment.yaml @@ -1,16 +1,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "VT.fullname" . }} + name: {{ include "vt.fullname" . }} labels: - {{- include "VT.labels" . | nindent 4 }} + {{- include "vt.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: - {{- include "VT.selectorLabels" . | nindent 6 }} + {{- include "vt.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -18,7 +18,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "VT.labels" . | nindent 8 }} + {{- include "vt.labels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -27,7 +27,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "VT.serviceAccountName" . }} + serviceAccountName: {{ include "vt.serviceAccountName" . }} {{- with .Values.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/helm/chart/vt/templates/hpa.yaml b/helm/chart/vt/templates/hpa.yaml index 35cef8e..276df60 100644 --- a/helm/chart/vt/templates/hpa.yaml +++ b/helm/chart/vt/templates/hpa.yaml @@ -2,14 +2,14 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: {{ include "VT.fullname" . }} + name: {{ include "vt.fullname" . }} labels: - {{- include "VT.labels" . | nindent 4 }} + {{- include "vt.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "VT.fullname" . }} + name: {{ include "vt.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: diff --git a/helm/chart/vt/templates/httproute.yaml b/helm/chart/vt/templates/httproute.yaml index d35e84b..6f6c47c 100644 --- a/helm/chart/vt/templates/httproute.yaml +++ b/helm/chart/vt/templates/httproute.yaml @@ -1,12 +1,12 @@ {{- if .Values.httpRoute.enabled -}} -{{- $fullName := include "VT.fullname" . -}} +{{- $fullName := include "vt.fullname" . -}} {{- $svcPort := .Values.service.port -}} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: {{ $fullName }} labels: - {{- include "VT.labels" . | nindent 4 }} + {{- include "vt.labels" . | nindent 4 }} {{- with .Values.httpRoute.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/helm/chart/vt/templates/ingress.yaml b/helm/chart/vt/templates/ingress.yaml index 7d67337..7df2d79 100644 --- a/helm/chart/vt/templates/ingress.yaml +++ b/helm/chart/vt/templates/ingress.yaml @@ -2,9 +2,9 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "VT.fullname" . }} + name: {{ include "vt.fullname" . }} labels: - {{- include "VT.labels" . | nindent 4 }} + {{- include "vt.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -35,7 +35,7 @@ spec: {{- end }} backend: service: - name: {{ include "VT.fullname" $ }} + name: {{ include "vt.fullname" $ }} port: number: {{ $.Values.service.port }} {{- end }} diff --git a/helm/chart/vt/templates/service.yaml b/helm/chart/vt/templates/service.yaml index a916ecf..214ab06 100644 --- a/helm/chart/vt/templates/service.yaml +++ b/helm/chart/vt/templates/service.yaml @@ -1,15 +1,13 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "VT.fullname" . }} - labels: - {{- include "VT.labels" . | nindent 4 }} + name: { { include "vt.fullname" . } } + labels: { { - include "vt.labels" . | nindent 4 } } spec: - type: {{ .Values.service.type }} + type: { { .Values.service.type } } ports: - - port: {{ .Values.service.port }} + - port: { { .Values.service.port } } targetPort: http protocol: TCP name: http - selector: - {{- include "VT.selectorLabels" . | nindent 4 }} + selector: { { - include "vt.selectorLabels" . | nindent 4 } } diff --git a/helm/chart/vt/templates/serviceaccount.yaml b/helm/chart/vt/templates/serviceaccount.yaml index 865a808..39c3237 100644 --- a/helm/chart/vt/templates/serviceaccount.yaml +++ b/helm/chart/vt/templates/serviceaccount.yaml @@ -2,9 +2,9 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "VT.serviceAccountName" . }} + name: {{ include "vt.serviceAccountName" . }} labels: - {{- include "VT.labels" . | nindent 4 }} + {{- include "vt.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/helm/chart/vt/templates/tests/test-connection.yaml b/helm/chart/vt/templates/tests/test-connection.yaml index 56eb197..b1196a0 100644 --- a/helm/chart/vt/templates/tests/test-connection.yaml +++ b/helm/chart/vt/templates/tests/test-connection.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "VT.fullname" . }}-test-connection" + name: "{{ include "vt.fullname" . }}-test-connection" labels: - {{- include "VT.labels" . | nindent 4 }} + {{- include "vt.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: @@ -11,5 +11,5 @@ spec: - name: wget image: busybox command: ['wget'] - args: ['{{ include "VT.fullname" . }}:{{ .Values.service.port }}'] + args: ['{{ include "vt.fullname" . }}:{{ .Values.service.port }}'] restartPolicy: Never diff --git a/helm/chart/vt/values.yaml b/helm/chart/vt/values.yaml index 274e0a8..e2a3ab5 100644 --- a/helm/chart/vt/values.yaml +++ b/helm/chart/vt/values.yaml @@ -1,4 +1,4 @@ -# Default values for VT. +# Default values for vt. # This is a YAML-formatted file. # Declare variables to be passed into your templates.