File tree Expand file tree Collapse file tree 17 files changed +33
-12
lines changed
Expand file tree Collapse file tree 17 files changed +33
-12
lines changed Original file line number Diff line number Diff line change 66 {{- end }}
77{{- end }}
88{{- else if contains "NodePort" .Values.service.type }}
9- export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "podinfo.fullname" . }})
10- export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
9+ export NODE_PORT=$(kubectl get --namespace {{ include "podinfo.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "podinfo.fullname" . }})
10+ export NODE_IP=$(kubectl get nodes --namespace {{ include "podinfo.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
1111 echo http://$NODE_IP:$NODE_PORT
1212{{- else if contains "LoadBalancer" .Values.service.type }}
1313 NOTE: It may take a few minutes for the LoadBalancer IP to be available.
1414 You can watch the status of by running 'kubectl get svc -w {{ template "podinfo.fullname" . }}'
15- export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "podinfo.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
15+ export SERVICE_IP=$(kubectl get svc --namespace {{ include "podinfo.namespace" . }} {{ template "podinfo.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
1616 echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
1717{{- else if contains "ClusterIP" .Values.service.type }}
1818 echo "Visit http://127.0.0.1:8080 to use your application"
19- kubectl -n {{ .Release.Namespace }} port-forward deploy/{{ template "podinfo.fullname" . }} 8080:{{ .Values.service.externalPort }}
19+ kubectl -n {{ include "podinfo.namespace" . }} port-forward deploy/{{ template "podinfo.fullname" . }} 8080:{{ .Values.service.externalPort }}
2020{{- end }}
Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ If release name contains chart name it will be used as a full name.
2323{{- end }}
2424{{- end }}
2525
26+ {{/*
27+ Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
28+ */ }}
29+ {{- define " podinfo.namespace" -}}
30+ {{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix " -" -}}
31+ {{- end -}}
32+
2633{{/*
2734Create chart name and version as used by the chart label.
2835*/ }}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ apiVersion: cert-manager.io/v1
33kind : Certificate
44metadata :
55 name : {{ template "podinfo.fullname" . }}
6+ namespace : {{ include "podinfo.namespace" . }}
67 labels :
78 {{- include "podinfo.labels" . | nindent 4 }}
89spec :
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ apiVersion: apps/v1
22kind : Deployment
33metadata :
44 name : {{ template "podinfo.fullname" . }}
5+ namespace : {{ include "podinfo.namespace" . }}
56 labels :
67 {{- include "podinfo.labels" . | nindent 4 }}
78spec :
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ apiVersion: autoscaling/v2
33kind : HorizontalPodAutoscaler
44metadata :
55 name : {{ template "podinfo.fullname" . }}
6+ namespace : {{ include "podinfo.namespace" . }}
67 labels :
78 {{- include "podinfo.labels" . | nindent 4 }}
89spec :
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ apiVersion: networking.k8s.io/v1
55kind : Ingress
66metadata :
77 name : {{ $fullName }}
8+ namespace : {{ include "podinfo.namespace" . }}
89 labels :
910 {{- include "podinfo.labels" . | nindent 4 }}
1011 {{- with .Values.ingress.additionalLabels }}
Original file line number Diff line number Diff line change 22apiVersion : linkerd.io/v1alpha2
33kind : ServiceProfile
44metadata :
5- name : {{ template "podinfo.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
5+ name : {{ template "podinfo.fullname" . }}.{{ include "podinfo.namespace" . }}.svc.cluster.local
6+ namespace : {{ include "podinfo.namespace" . }}
67 labels :
78 {{- include "podinfo.labels" . | nindent 4 }}
89spec :
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ apiVersion: policy/v1
33kind : PodDisruptionBudget
44metadata :
55 name : {{ include "podinfo.fullname" . }}
6- namespace : {{ .Release.Namespace }}
6+ namespace : {{ include "podinfo.namespace" . }}
77 labels :
88 {{- include "podinfo.labels" . | nindent 4 }}
99spec :
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ apiVersion: v1
33kind : Service
44metadata :
55 name : {{ template "podinfo.fullname" . }}
6+ namespace : {{ include "podinfo.namespace" . }}
67 labels :
78 {{- include "podinfo.labels" . | nindent 4 }}
89{{- with .Values.service.annotations }}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ apiVersion: monitoring.coreos.com/v1
33kind : ServiceMonitor
44metadata :
55 name : {{ template "podinfo.fullname" . }}
6+ namespace : {{ include "podinfo.namespace" . }}
67 labels :
78 {{- include "podinfo.labels" . | nindent 4 }}
89 {{- with .Values.serviceMonitor.additionalLabels }}
1516 interval : {{ .Values.serviceMonitor.interval }}
1617 namespaceSelector :
1718 matchNames :
18- - {{ .Release.Namespace }}
19+ - {{ include "podinfo.namespace" . }}
1920 selector :
2021 matchLabels :
2122 {{- include "podinfo.selectorLabels" . | nindent 6 }}
You can’t perform that action at this time.
0 commit comments