Skip to content

Commit 1596b01

Browse files
committed
set a default container in deployments
How often have you ssh'd into a prod box only to end up on the linkerd container? It's happened to me too many times. I found this nifty annotation that can alleviate the problem... Unless you're trying to get to the linkerd container, in which case you're back to using `-c linkderd`.
1 parent c303fc9 commit 1596b01

File tree

21 files changed

+42
-21
lines changed

21 files changed

+42
-21
lines changed

charts/tidepool/charts/auth/templates/1-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ spec:
2727
app: auth
2828
app.kubernetes.io/name: {{ include "charts.name" . }}
2929
app.kubernetes.io/instance: {{ .Release.Name }}
30-
{{ if .Values.podAnnotations }}
3130
annotations:
31+
kubectl.kubernetes.io/default-container: auth
32+
{{ if .Values.podAnnotations }}
3233
{{- .Values.podAnnotations | toYaml | nindent 8 }}
3334
{{- end }}
3435
spec:

charts/tidepool/charts/blip/templates/1-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ spec:
2525
app: blip
2626
app.kubernetes.io/name: {{ include "charts.name" . }}
2727
app.kubernetes.io/instance: {{ .Release.Name }}
28-
{{ if .Values.podAnnotations }}
2928
annotations:
29+
kubectl.kubernetes.io/default-container: blip
30+
{{ if .Values.podAnnotations }}
3031
{{- .Values.podAnnotations | toYaml | nindent 8 }}
3132
{{- end }}
3233
spec:

charts/tidepool/charts/blob/templates/1-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ spec:
2222
strategy: {}
2323
template:
2424
metadata:
25-
{{ if .Values.podAnnotations }}
2625
annotations:
26+
kubectl.kubernetes.io/default-container: blob
27+
{{ if .Values.podAnnotations }}
2728
{{- .Values.podAnnotations | toYaml | nindent 8 }}
2829
{{- end }}
2930
labels:

charts/tidepool/charts/clinic-worker/templates/1-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ spec:
2727
app: clinic-worker
2828
app.kubernetes.io/name: {{ include "charts.name" . }}
2929
app.kubernetes.io/instance: {{ .Release.Name }}
30-
{{ if .Values.podAnnotations }}
3130
annotations:
31+
kubectl.kubernetes.io/default-container: clinic-worker
32+
{{ if .Values.podAnnotations }}
3233
{{- .Values.podAnnotations | toYaml | nindent 8 }}
3334
{{- end }}
3435
spec:

charts/tidepool/charts/clinic/templates/1-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ spec:
2727
app: clinic
2828
app.kubernetes.io/name: {{ include "charts.name" . }}
2929
app.kubernetes.io/instance: {{ .Release.Name }}
30-
{{ if .Values.podAnnotations }}
3130
annotations:
31+
kubectl.kubernetes.io/default-container: clinic
32+
{{ if .Values.podAnnotations }}
3233
{{- .Values.podAnnotations | toYaml | nindent 8 }}
3334
{{- end }}
3435
spec:

charts/tidepool/charts/data/templates/1-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ spec:
2727
app: data
2828
app.kubernetes.io/name: {{ include "charts.name" . }}
2929
app.kubernetes.io/instance: {{ .Release.Name }}
30-
{{ if .Values.podAnnotations }}
3130
annotations:
31+
kubectl.kubernetes.io/default-container: data
32+
{{ if .Values.podAnnotations }}
3233
{{- .Values.podAnnotations | toYaml | nindent 8 }}
3334
{{- end }}
3435
spec:

charts/tidepool/charts/devices/templates/1-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ spec:
2121
app: devices
2222
app.kubernetes.io/name: {{ include "charts.name" . }}
2323
app.kubernetes.io/instance: {{ .Release.Name }}
24-
{{ if .Values.podAnnotations }}
2524
annotations:
25+
kubectl.kubernetes.io/default-container: devices
26+
{{ if .Values.podAnnotations }}
2627
{{- .Values.podAnnotations | toYaml | nindent 8 }}
2728
{{- end }}
2829
spec:

charts/tidepool/charts/export/templates/1-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ spec:
2727
app: export
2828
app.kubernetes.io/name: {{ include "charts.name" . }}
2929
app.kubernetes.io/instance: {{ .Release.Name }}
30-
{{ if .Values.podAnnotations }}
3130
annotations:
31+
kubectl.kubernetes.io/default-container: export
32+
{{ if .Values.podAnnotations }}
3233
{{- .Values.podAnnotations | toYaml | nindent 8 }}
3334
{{- end }}
3435
spec:

charts/tidepool/charts/gatekeeper/templates/1-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ spec:
2626
app: gatekeeper
2727
app.kubernetes.io/name: {{ include "charts.name" . }}
2828
app.kubernetes.io/instance: {{ .Release.Name }}
29-
{{ if .Values.podAnnotations }}
3029
annotations:
30+
kubectl.kubernetes.io/default-container: gatekeeper
31+
{{ if .Values.podAnnotations }}
3132
{{- .Values.podAnnotations | toYaml | nindent 8 }}
3233
{{- end }}
3334
spec:

charts/tidepool/charts/highwater/templates/1-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ spec:
2525
app: highwater
2626
app.kubernetes.io/name: {{ include "charts.name" . }}
2727
app.kubernetes.io/instance: {{ .Release.Name }}
28-
{{ if .Values.podAnnotations }}
2928
annotations:
29+
kubectl.kubernetes.io/default-container: highwater
30+
{{ if .Values.podAnnotations }}
3031
{{- .Values.podAnnotations | toYaml | nindent 8 }}
3132
{{- end }}
3233
spec:

0 commit comments

Comments
 (0)