Skip to content

Commit

Permalink
fix: Explicitly Define Service Account Token in Pod Spec
Browse files Browse the repository at this point in the history
This commit addresses the issue described in GitHub titansoft-pte-ltd#31 where pods were unable to find the specified ConfigMap. By explicitly defining the service account token in the Pod specification, we ensure that the token is available to the Pod, thereby mitigating the issue.

Related: titansoft-pte-ltd#31
  • Loading branch information
keithharvey committed Sep 3, 2023
1 parent bdf0891 commit 05e5e55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions deploy-example/kubernetes-manifest/1_rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kind: ServiceAccount
metadata:
name: imagepullsecret-patcher
namespace: imagepullsecret-patcher
annotations:
kubernetes.io/service-account.name: imagepullsecret-patcher-token
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
11 changes: 9 additions & 2 deletions deploy-example/kubernetes-manifest/2_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ spec:
labels:
name: imagepullsecret-patcher
spec:
automountServiceAccountToken: true
serviceAccountName: imagepullsecret-patcher
containers:
- name: imagepullsecret-patcher
Expand All @@ -42,6 +41,9 @@ spec:
- name: src-dockerconfigjson
mountPath: "/app/secrets"
readOnly: true
- name: sa-token
mountPath: "/var/run/secrets/kubernetes.io/serviceaccount"
readOnly: true
resources:
requests:
cpu: 0.1
Expand All @@ -51,5 +53,10 @@ spec:
memory: 30Mi
volumes:
- name: src-dockerconfigjson
secret:
secret:
secretName: image-pull-secret-src
- name: sa-token
projected:
sources:
- serviceAccountToken:
path: token

0 comments on commit 05e5e55

Please sign in to comment.