Skip to content

Commit

Permalink
Solve fsGroup issue
Browse files Browse the repository at this point in the history
* Respect recent api changes and Move most of securityContext to pod level,
  only readOnlyRootFilesystem is stayed on container one

* Solves
```
Error: UPGRADE FAILED: error validating "": error validating data: ValidationError(Deployment.spec.template.spec.containers[0].securityContext): unknown field "fsGroup" in io.k8s.api.core.v1.SecurityContext
```
on eks reference deployment

* Fixes #293

Signed-off-by: Yury Tsarev <yury.tsarev@absa.africa>
  • Loading branch information
ytsarev committed Feb 28, 2021
1 parent 3a561ea commit 8b92f61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions chart/k8gb/templates/external-dns/external-dns-ns1.yaml
Expand Up @@ -15,6 +15,10 @@ spec:
app: external-dns-ns1
spec:
serviceAccountName: external-dns
securityContext:
fsGroup: 65534 # For ExternalDNS to be able to read Kubernetes and AWS token files
runAsUser: 1000
runAsNonRoot: true
containers:
- name: external-dns
image: {{ .Values.externaldns.image }}
Expand All @@ -41,8 +45,5 @@ spec:
memory: "128Mi"
cpu: "500m"
securityContext:
runAsUser: 1000
runAsNonRoot: true
readOnlyRootFilesystem: true
fsGroup: 65534 # For ExternalDNS to be able to read Kubernetes and AWS token files
{{ end }}
7 changes: 4 additions & 3 deletions chart/k8gb/templates/external-dns/external-dns-route53.yaml
Expand Up @@ -15,6 +15,10 @@ spec:
app: external-dns-route53
spec:
serviceAccountName: external-dns
securityContext:
fsGroup: 65534 # For ExternalDNS to be able to read Kubernetes and AWS token files
runAsUser: 1000
runAsNonRoot: true
containers:
- name: external-dns
image: {{ .Values.externaldns.image }}
Expand All @@ -35,8 +39,5 @@ spec:
memory: "128Mi"
cpu: "500m"
securityContext:
fsGroup: 65534 # For ExternalDNS to be able to read Kubernetes and AWS token files
runAsUser: 1000
runAsNonRoot: true
readOnlyRootFilesystem: true
{{ end }}

0 comments on commit 8b92f61

Please sign in to comment.