-
Notifications
You must be signed in to change notification settings - Fork 1.6k
local volume provisioner: improve helm chart #789
Conversation
45ad26d
to
9d704dd
Compare
/assign @msau42 |
1a8b012
to
1db9336
Compare
local-volume/helm/README.md
Outdated
| common.useJobForCleaning | Is set to true, provisioner will use jobs-based block cleaning. | bool | `false` | | ||
| common.configMapName | Provisioner ConfigMap name. | str | `local-provisioner-config` | | ||
| classes.[n].name | StorageClass name. | str | `-` | | ||
| classes.[n].hostDir | Path on the host where local volume of this storage class are mounted. | str | `-` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local volumes of this storage class are mounted under
local-volume/helm/README.md
Outdated
| classes.[n].storageClass.reclaimPolicy | Specify reclaimPolicy of storage class, available: Delete/Retain. | str | `Delete` | | ||
| daemonset.name | Provisioner DaemonSet name. | str | `local-volume-provisioner` | | ||
| daemonset.image | Provisioner image. | str | `quay.io/external_storage/local-volume-provisioner:v2.1.0` | | ||
| daemonset.imagePullPolicy | Provisioner DaemonSet image pull policy. | str | `Always` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking it may be better to just use the default imagePullPolicy if not set.
classes: | ||
- name: local-scsi | ||
hostDir: "/mnt/disks/by-uuid/google-local-ssds-scsi-fs" | ||
blockCleanerCommand: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On gce/gke, we actually separate block and preformatted volumes into different directories. So this block cleaning config doesn't do anything. It may be better to put this in a baremetal example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I remove all blockCleanerCommand
sections from other gce/gke example yamls? I never run kubernetes on gce/gke, could you help test these examples if possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I would leave it out for now and add it to the baremetal example instead. I have an issue open on me to integrate and test the block feature on gce/gke
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in d1d0ef9.
blockCleanerCommand: | ||
- "/scripts/quick_reset.sh" | ||
storageClass: | ||
reclaimPolicy: Delete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would leave out reclaim policy if you're going to use the default
7c36e01
to
616d77d
Compare
Updated in 616d77d.
|
427e967
to
d1d0ef9
Compare
Add update-helm-values utility in b210c6c. There is a problem vendoring "k8s.io/helm/pkg/chartutil" package with glide, so I simply copied utilities I need into this repo. They are all k8s code, I think it's fine to copy here. How about fixing it later?
found a related issue here: Masterminds/glide#968 |
8613b32
to
b210c6c
Compare
@@ -0,0 +1,9 @@ | |||
## update helm values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make this directory name be explicit about the before/after versions that this tool supports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It supports its first version to local-volume-provisioner-v2.1.0, so I renamed it to update-helm-values-pre-v2.2.0
. If you have a better name, let me change to it.
common: | ||
# Beta PV.NodeAffinity field is used by default. If running against pre-1.10 | ||
# k8s version, the `useAlphaAPI` flag must be enabled in the configMap. | ||
useAlphaAPI: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave out any default values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: jobsrole | ||
name: local-storage-provisioner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more descriptive name could be "local-storage-provisioner-jobs-role"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
{{- range $tmp, $val := $classPath }} | ||
{{- range $storageClass, $classConfig := $val }} | ||
{{ $storageClass }}: | ||
{{- range $classConfig := . -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to put all this inline with the rest of the spec template instead of at the beginning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I removed variables aliases which I found not necessary too. It's hard to read diff of provisioner.yaml now, you can simply check final version of provisioner.
I also added a helm chart test script here: https://github.com/cofyc/external-storage/tree/refactor_heml_chart/local-volume/helm/test
Updated in e6f6fe9:
|
036a77f
to
e6f6fe9
Compare
I missed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lgtm! Please squash
|
||
{{- if $kubeConfigEnv }} | ||
value: "{{ .Values.daemonset.image }}" | ||
{{- if .Values.daemonset.kubeConfigEnv }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be indented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course.
… for different environments - Create job RBAC when necessary - Able to create StorageClass object and configure it - Add docs and examples for helm chart - By default, don't set imagePullPolicy (will use default kubernetes imagePullPolicy) - Add update-helm-values-pre-v2.2.0 for migrating helm chart values - Inline all template definitions and remove all template varaibles aliases
3958fb0
to
4ac87aa
Compare
/retest |
4ac87aa
to
cc6db8a
Compare
seems like |
/lgtm |
local volume provisioner: improve helm chart
engine
thing, it's better to use differnt values files for different environments.jobsrole
andlocal-storage-provisioner-job-binding
tolocal-storage-provisioner
, and only create them when necessary.