From 9e356b419e9032292e28000eb040612c4d65ad1e Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Sat, 19 Feb 2022 09:27:41 +0000 Subject: [PATCH] chart: Add default-logs-container annotation to controller pods so that you can run `kubectl logs` on controller pods without the specifying the container name. It is especially useful when you want to run kubectl-logs on all ARC pods across controller-manager and github-webhook-server like: ``` kubectl -n actions-runner-system logs -l app.kubernetes.io/name=actions-runner-controller ``` That was previously impossible due to that the selector matches pods from both controller-manager and github-webhook-server and kubectl does not provide a way to specify container names for respective pods. --- charts/actions-runner-controller/templates/deployment.yaml | 1 + .../templates/githubwebhook.deployment.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/charts/actions-runner-controller/templates/deployment.yaml b/charts/actions-runner-controller/templates/deployment.yaml index 8885a6a5..0b9ed7d4 100644 --- a/charts/actions-runner-controller/templates/deployment.yaml +++ b/charts/actions-runner-controller/templates/deployment.yaml @@ -14,6 +14,7 @@ spec: metadata: {{- with .Values.podAnnotations }} annotations: + kubectl.kubernetes.io/default-logs-container: "manager" {{- toYaml . | nindent 8 }} {{- end }} labels: diff --git a/charts/actions-runner-controller/templates/githubwebhook.deployment.yaml b/charts/actions-runner-controller/templates/githubwebhook.deployment.yaml index 3776fb09..6dbb428c 100644 --- a/charts/actions-runner-controller/templates/githubwebhook.deployment.yaml +++ b/charts/actions-runner-controller/templates/githubwebhook.deployment.yaml @@ -15,6 +15,7 @@ spec: metadata: {{- with .Values.githubWebhookServer.podAnnotations }} annotations: + kubectl.kubernetes.io/default-logs-container: "github-webhook-server" {{- toYaml . | nindent 8 }} {{- end }} labels: