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

Helm chart 1.0 #194

Merged
merged 15 commits into from
Aug 5, 2021
Merged

Helm chart 1.0 #194

merged 15 commits into from
Aug 5, 2021

Conversation

wongma7
Copy link
Contributor

@wongma7 wongma7 commented Jun 17, 2021

Is this a bug fix or adding new feature? fixes #191

What is this PR about? / Why do we need it?

What testing is done?

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 17, 2021
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 17, 2021
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 15, 2021
@wongma7 wongma7 force-pushed the helmchart1.0 branch 4 times, most recently from e94dd40 to 295421f Compare July 15, 2021 23:45
@wongma7
Copy link
Contributor Author

wongma7 commented Jul 16, 2021

/test pull-aws-fsx-csi-driver-e2e

@wongma7
Copy link
Contributor Author

wongma7 commented Jul 16, 2021

/test pull-aws-fsx-csi-driver-e2e

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 16, 2021
@wongma7 wongma7 changed the title WIP: Helm chart 1.0 Helm chart 1.0 Jul 16, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 16, 2021
@wongma7
Copy link
Contributor Author

wongma7 commented Jul 17, 2021

• Failure [604.565 seconds]
[fsx-csi-e2e] Dynamic Provisioning with s3 data repository
/home/prow/go/src/github.com/kubernetes-sigs/aws-fsx-csi-driver/tests/e2e/dynamic_provisioning_test.go:111
should create a volume on demand with s3 as data repository [It]
/home/prow/go/src/github.com/kubernetes-sigs/aws-fsx-csi-driver/tests/e2e/dynamic_provisioning_test.go:151

https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_aws-fsx-csi-driver/194/pull-aws-fsx-csi-driver-e2e/1416172104553861120

/retest

Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
replicas: {{ .Values.controller.replicaCount }}
selector:
matchLabels:
app: fsx-csi-controller

Choose a reason for hiding this comment

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

Adding this will cause upgrade issues since matchLabels is immutable. It looks like maybe it is being added to ensure that is continues to be included on the kustomize manifests. If that is the case, I would move if from here to an else in the selectorLabels helper template.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll test out the upgrade case, since I am bumping major version of helm chart I am not sure without testing how helm deals with it. I just cargo culted how ebs does it TBH: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/charts/aws-ebs-csi-driver/templates/controller.yaml#L12

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this change is safe because helm somehow knows to delete and recreate the deployment which also deletes and recreates the pods..

  1. I installed the current helm chart v0.1.0 using the README command
    a. (I manually edited the deployment and daemonset to have hostNetwork and to point to image 0.4.0 instead of 0.3.0 because they were crashlooping as I have instance metadata disabled)
  2. I ran helm upgrade --install aws-fsx-csi-driver ./charts/aws-fsx-csi-driver
  3. helm recreated the deployment
k get deployment
NAME                 READY   UP-TO-DATE   AVAILABLE   AGE
fsx-csi-controller   1/1     1            1           57s

Copy link

Choose a reason for hiding this comment

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

I didn't notice that the name of the deployment was changing. That explains the delete and create behavior.

spec:
replicas: 2
selector:
matchLabels:
app: fsx-csi-controller
app.kubernetes.io/name: aws-fsx-csi-driver

Choose a reason for hiding this comment

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

I don't know if this is a concern but this will need intervention on a new apply since matchLabels are immutable.

Copy link

Choose a reason for hiding this comment

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

This may still be the case since the deployment name isn't changing. Did you test the upgrade with kustomize?

spec:
selector:
matchLabels:
app: fsx-csi-node
app.kubernetes.io/name: aws-fsx-csi-driver

Choose a reason for hiding this comment

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

I don't know if this is a concern but this will need intervention on a new apply since matchLabels are immutable.

@wongma7
Copy link
Contributor Author

wongma7 commented Aug 3, 2021

I resolved comments I think have been addressed by latest 5 commits, the one open question is how to deal with matchLabels which I will test out. appreciate the thorough review

Copy link

@krmichel krmichel left a comment

Choose a reason for hiding this comment

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

Let me know what you think about trying to validate that the service account exists. Did you test the kustomize based upgrade? It looks like the names of those resources are changing. I haven't used kustomize but based on past kubectl behavior it seems like the match labels could be an issue.

I would seem my comment about the validation is part of a resolved conversation so you might have to look for it :(

annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Copy link

Choose a reason for hiding this comment

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

Personally, I would just add the annotation to controller.serviceAccount.annotations, which is what I did for the EBS chart. I do, however, see what you are saying about some users potentially wanting to use a pre-existing service account.

If this chart isn't creating a service account and therefore expects that one already exists it might be worth using the lookup function to validate that it does exist and fail if it doesn't.
https://helm.sh/docs/chart_template_guide/functions_and_pipelines/#using-the-lookup-function

spec:
replicas: 2
selector:
matchLabels:
app: fsx-csi-controller
app.kubernetes.io/name: aws-fsx-csi-driver
Copy link

Choose a reason for hiding this comment

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

This may still be the case since the deployment name isn't changing. Did you test the upgrade with kustomize?

@wongma7
Copy link
Contributor Author

wongma7 commented Aug 4, 2021

latest commit gives lookup function a try. it seems to work but the error message is quite ugly, I'm not sure if I called fail correctly?

$ helm upgrade --install aws-fsx-csi-driver  ./charts/aws-fsx-csi-driver --set controller.serviceAccount.create=false
Release "aws-fsx-csi-driver" does not exist. Installing it now.
Error: template: aws-fsx-csi-driver/templates/controller-serviceaccount.yaml:15:8: executing "aws-fsx-csi-driver/templates/controller-serviceaccount.yaml" at <fail (printf "create serviceaccount %s/%s or set .controller.serviceaccount.create true" .Release.Namespace .Values.controller.serviceAccount.name)>: error calling fail: create serviceaccount default/fsx-csi-controller-sa or set .controller.serviceaccount.create true
~/g/s/g/k/aws-fsx-csi-driver (helmchart1.0|✚1) [1] $ k create serviceaccount fsx-csi-controller-sa
serviceaccount/fsx-csi-controller-sa created
~/g/s/g/k/aws-fsx-csi-driver (helmchart1.0|✚1) $ helm upgrade --install aws-fsx-csi-driver  ./charts/aws-fsx-csi-driver --set controller.serviceAccount.create=false
Release "aws-fsx-csi-driver" does not exist. Installing it now.
NAME: aws-fsx-csi-driver
LAST DEPLOYED: Wed Aug  4 12:59:31 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None

@wongma7
Copy link
Contributor Author

wongma7 commented Aug 4, 2021

the kustomize upgrade indeed failed to apply. however it worked with --force, I suppose I can add this to the readme installation instructions as upgrade note, same as for helm (working on that now)

@krmichel
Copy link

krmichel commented Aug 5, 2021

latest commit gives lookup function a try. it seems to work but the error message is quite ugly, I'm not sure if I called fail correctly?

$ helm upgrade --install aws-fsx-csi-driver  ./charts/aws-fsx-csi-driver --set controller.serviceAccount.create=false
Release "aws-fsx-csi-driver" does not exist. Installing it now.
Error: template: aws-fsx-csi-driver/templates/controller-serviceaccount.yaml:15:8: executing "aws-fsx-csi-driver/templates/controller-serviceaccount.yaml" at <fail (printf "create serviceaccount %s/%s or set .controller.serviceaccount.create true" .Release.Namespace .Values.controller.serviceAccount.name)>: error calling fail: create serviceaccount default/fsx-csi-controller-sa or set .controller.serviceaccount.create true
~/g/s/g/k/aws-fsx-csi-driver (helmchart1.0|✚1) [1] $ k create serviceaccount fsx-csi-controller-sa
serviceaccount/fsx-csi-controller-sa created
~/g/s/g/k/aws-fsx-csi-driver (helmchart1.0|✚1) $ helm upgrade --install aws-fsx-csi-driver  ./charts/aws-fsx-csi-driver --set controller.serviceAccount.create=false
Release "aws-fsx-csi-driver" does not exist. Installing it now.
NAME: aws-fsx-csi-driver
LAST DEPLOYED: Wed Aug  4 12:59:31 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None

Looks like a correct use of fail.

@nckturner
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 5, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: krmichel, nckturner, wongma7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 70a9ac3 into kubernetes-sigs:master Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm chart 1.0
4 participants