Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gate controller creation behind helm value #296

Merged
merged 1 commit into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
Create the name of the service account to use
*/}}
{{- define "aws-efs-csi-driver.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "aws-efs-csi-driver.fullname" .) .Values.serviceAccount.name }}
{{- if .Values.serviceAccount.controller.create -}}
{{ default (include "aws-efs-csi-driver.fullname" .) .Values.serviceAccount.controller.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{ default "default" .Values.serviceAccount.controller.name }}
{{- end -}}
{{- end -}}
4 changes: 4 additions & 0 deletions helm/templates/controller.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.controller.create }}
# Controller Service
kind: Deployment
apiVersion: apps/v1
Expand Down Expand Up @@ -34,7 +35,9 @@ spec:
{{- with .Values.nodeSelector }}
{{- . | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.serviceAccount.controller.create }}
serviceAccountName: {{ include "aws-efs-csi-driver.serviceAccountName" . }}
{{- end }}
priorityClassName: system-cluster-critical
tolerations:
- operator: Exists
Expand Down Expand Up @@ -95,3 +98,4 @@ spec:
volumes:
- name: socket-dir
emptyDir: {}
{{- end }}
6 changes: 3 additions & 3 deletions helm/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{- if .Values.serviceAccount.create -}}
{{- if .Values.serviceAccount.controller.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "aws-efs-csi-driver.serviceAccountName" . }}
namespace: kube-system
labels:
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
{{- with .Values.serviceAccount.annotations }}
{{- with .Values.serviceAccount.controller.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down Expand Up @@ -56,4 +56,4 @@ roleRef:
kind: ClusterRole
name: efs-csi-external-provisioner-role
apiGroup: rbac.authorization.k8s.io
{{- end }}
{{- end }}
25 changes: 16 additions & 9 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ fullnameOverride: ""

podAnnotations: {}

resources: {}
resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
Expand All @@ -50,7 +51,8 @@ node:

logLevel: 5

hostAliases: {}
hostAliases:
{}
# for cross VPC EFS, you need to poison or overwrite the DNS for the efs volume as per
# https://docs.aws.amazon.com/efs/latest/ug/efs-different-vpc.html#wt6-efs-utils-step3
# implementing the suggested solution found here:
Expand All @@ -61,17 +63,22 @@ hostAliases: {}
# region: us-east-2

dnsPolicy: ""
dnsConfig: {}
dnsConfig:
{}
# Example config which uses the AWS nameservers
# dnsPolicy: "None"
# dnsConfig:
# nameservers:
# - 169.254.169.253

serviceAccount:
# Specifies whether a service account should be created
create: true
annotations: {}
## Enable if EKS IAM for SA is used
# eks.amazonaws.com/role-arn: arn:aws:iam::111122223333:role/efs-csi-role
name: efs-csi-controller-sa
controller:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I'm thinking if this is considered a breaking change. Users might need to update their setup.

We need to update the chart version regardless, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we are going to go to 1.x.x

# Specifies whether a service account should be created
create: false
annotations: {}
## Enable if EKS IAM for SA is used
# eks.amazonaws.com/role-arn: arn:aws:iam::111122223333:role/efs-csi-role
name: efs-csi-controller-sa

controller:
create: false
4 changes: 3 additions & 1 deletion tester/e2e-test-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ install: |
wget https://get.helm.sh/$helm_name
tar xvzf $helm_name
mv $OS_ARCH/helm /usr/local/bin/helm

AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
IMAGE_TAG={{TEST_ID}}
IMAGE_NAME=$AWS_ACCOUNT_ID.dkr.ecr.us-west-2.amazonaws.com/aws-efs-csi-driver

helm install aws-efs-csi-driver \
--set image.repository=$IMAGE_NAME \
--set image.tag=$IMAGE_TAG \
--set controller.create=true \
--set serviceAccount.controller.create=true \
./helm

uninstall: |
Expand Down