Skip to content

Commit

Permalink
Merge pull request #159 from MediaMarktSaturn/application-pod-ip
Browse files Browse the repository at this point in the history
[Application] Set status.podIP as APPLICATION_POD_IP env
  • Loading branch information
heubeck authored Nov 5, 2024
2 parents e7c3b75 + 8fea962 commit c47a833
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/application/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ maintainers:
- name: MediaMarktSaturn
url: https://github.com/MediaMarktSaturn
appVersion: 1.0.0
version: 1.27.0
version: 1.28.0
24 changes: 18 additions & 6 deletions charts/application/templates/_podTemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ spec:
{{- end }}
resources:
{{- toYaml (or $i.resources $.Values.initDefaults.resources) | nindent 8 }}
{{- if .env }}
env:
- name: APPLICATION_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- if .env }}
{{- range $k, $v := .env }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if (or $i.configEnvFrom $i.secretEnvFrom )}}
envFrom:
{{- range $c := $i.configEnvFrom }}
Expand Down Expand Up @@ -129,13 +133,17 @@ spec:
{{- end }}
resources:
{{- toYaml (or $s.resources $.Values.sidecarDefaults.resources) | nindent 8 }}
{{- if .env }}
env:
- name: APPLICATION_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- if .env }}
{{- range $k, $v := .env }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if (or $s.configEnvFrom $s.secretEnvFrom )}}
envFrom:
{{- range $c := $s.configEnvFrom }}
Expand Down Expand Up @@ -247,11 +255,15 @@ spec:
- secretRef:
name: {{ include "secret" . }}
{{- end }}
{{- if .Values.serviceAccount.secretName }}
env:
- name: APPLICATION_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
{{- if .Values.serviceAccount.secretName }}
- name: "GOOGLE_APPLICATION_CREDENTIALS"
value: "{{- .Values.serviceAccount.mountPath -}}/key.json"
{{- end }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.container.port }}
Expand Down

0 comments on commit c47a833

Please sign in to comment.