Skip to content

Commit

Permalink
fixed wrong template function names
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhuth committed Oct 1, 2024
1 parent f5a9287 commit 1a635ac
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions charts/cluster-api-visualizer/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "cluster-api-visualizerfullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "cluster-api-visualizer.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 the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "cluster-api-visualizerfullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "cluster-api-visualizerfullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "cluster-api-visualizer.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "cluster-api-visualizer.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 "cluster-api-visualizername" . }},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 "cluster-api-visualizer.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
Expand Down
12 changes: 6 additions & 6 deletions charts/cluster-api-visualizer/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "cluster-api-visualizerfullname" . }}
name: {{ include "cluster-api-visualizer.fullname" . }}
labels:
{{- include "cluster-api-visualizerlabels" . | nindent 4 }}
{{- include "cluster-api-visualizer.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "cluster-api-visualizerselectorLabels" . | nindent 6 }}
{{- include "cluster-api-visualizer.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "cluster-api-visualizerselectorLabels" . | nindent 8 }}
{{- include "cluster-api-visualizer.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "cluster-api-visualizerserviceAccountName" . }}
serviceAccountName: {{ include "cluster-api-visualizer.serviceAccountName" . }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- if .values.extraEnv }}
{{- if .Values.extraEnv }}
env:
{{- range .Values.extraEnv }}
{{- if and (.name) (.value) }}
Expand Down
4 changes: 2 additions & 2 deletions charts/cluster-api-visualizer/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "cluster-api-visualizerfullname" . -}}
{{- $fullName := include "cluster-api-visualizer.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") }}
Expand All @@ -17,7 +17,7 @@ kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "cluster-api-visualizerlabels" . | nindent 4 }}
{{- include "cluster-api-visualizer.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
6 changes: 3 additions & 3 deletions charts/cluster-api-visualizer/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "cluster-api-visualizerfullname" . }}
name: {{ include "cluster-api-visualizer.fullname" . }}
labels:
{{- include "cluster-api-visualizerlabels" . | nindent 4 }}
{{- include "cluster-api-visualizer.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "cluster-api-visualizerselectorLabels" . | nindent 4 }}
{{- include "cluster-api-visualizer.selectorLabels" . | nindent 4 }}
4 changes: 2 additions & 2 deletions charts/cluster-api-visualizer/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "cluster-api-visualizerserviceAccountName" . }}
name: {{ include "cluster-api-visualizer.serviceAccountName" . }}
labels:
{{- include "cluster-api-visualizerlabels" . | nindent 4 }}
{{- include "cluster-api-visualizer.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down

0 comments on commit 1a635ac

Please sign in to comment.