Skip to content

Upgrade kustomize and use the set image command to patch the image name and version #242

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

Merged
merged 6 commits into from
Apr 17, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions deploy/kubernetes/base/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ spec:
serviceAccountName: csi-controller-sa
containers:
- name: csi-provisioner
image: MUSTPATCHWITHKUSTOMIZE
image: REPLACEME/csi-provisioner
args:
- "--v=5"
- "--csi-address=/csi/csi.sock"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: csi-attacher
image: MUSTPATCHWITHKUSTOMIZE
image: REPLACEME/csi-attacher
args:
- "--v=5"
- "--csi-address=/csi/csi.sock"
volumeMounts:
- name: socket-dir
mountPath: /csi
- name: gce-pd-driver
image: MUSTPATCHWITHKUSTOMIZE
image: REPLACEME/gcp-compute-persistent-disk-csi-driver
args:
- "--v=5"
- "--endpoint=unix:/csi/csi.sock"
Expand All @@ -51,3 +51,4 @@ spec:
- name: cloud-sa-volume
secret:
secretName: cloud-sa
volumeClaimTemplates: []
4 changes: 2 additions & 2 deletions deploy/kubernetes/base/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
serviceAccountName: csi-node-sa
containers:
- name: csi-driver-registrar
image: MUSTPATCHWITHKUSTOMIZE
image: REPLACEME/csi-node-driver-registrar
args:
- "--v=5"
- "--csi-address=/csi/csi.sock"
Expand All @@ -37,7 +37,7 @@ spec:
- name: gce-pd-driver
securityContext:
privileged: true
image: MUSTPATCHWITHKUSTOMIZE
image: REPLACEME/gcp-compute-persistent-disk-csi-driver
args:
- "--v=5"
- "--endpoint=unix:/csi/csi.sock"
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/install-kustomize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ ! -f "${KUSTOMIZE_PATH}" ]; then

echo "Installing kustomize in ${KUSTOMIZE_PATH}"
opsys=linux # or darwin, or windows
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases/tags/v1.0.8 |\
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases/tags/v2.0.3 |\
grep browser_download |\
grep $opsys |\
cut -d '"' -f 4 |\
Expand Down
17 changes: 17 additions & 0 deletions deploy/kubernetes/overlays/dev/controller_add_snapshotter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: csi-gce-pd-controller
spec:
template:
spec:
containers:
- name: csi-snapshotter
imagePullPolicy: Always
image: quay.io/k8scsi/csi-snapshotter:v1.0.1
args:
- "--v=5"
- "--csi-address=/csi/csi.sock"
volumeMounts:
- name: socket-dir
mountPath: /csi
11 changes: 11 additions & 0 deletions deploy/kubernetes/overlays/dev/controller_always_pull.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: StatefulSet
apiVersion: apps/v1
metadata:
name: csi-gce-pd-controller
spec:
template:
spec:
containers:
- name: gce-pd-driver
imagePullPolicy: Always

28 changes: 0 additions & 28 deletions deploy/kubernetes/overlays/dev/controller_images.yaml

This file was deleted.

21 changes: 19 additions & 2 deletions deploy/kubernetes/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
patches:
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't the dev overlay also have the rbac_add_snapshotter.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rebased dev overlay on top of alpha overlay

- controller_images.yaml
- node_images.yaml
- controller_add_snapshotter.yaml
- controller_always_pull.yaml
- node_always_pull.yaml
images:
- name: REPLACEME/gcp-compute-persistent-disk-csi-driver
# Replace this with your private image name
newName: gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver
newTag: "v0.4.0-gke.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be "latest"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't release any official "latest" tags, so I just put our latest supported image. What I expect developers to do, is to replace both newName and newTag with their own repo and tags.

Copy link
Contributor

Choose a reason for hiding this comment

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

should this instead be not replaced instead. Therefore when someone tries to use a dev overlay without changing anything they get an image pull failure (saying REPLACEME and reminding the user to replace to image) instead of failing silently by just giving them a working image.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We currently use the dev overlay as our alpha features overlay too (for snapshot). I can create a separate overlay for alpha if we want to separate that out

- name: REPLACEME/csi-provisioner
newName: quay.io/k8scsi/csi-provisioner
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we use quay here but GCR elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have a bit of a chicken and egg problem. Currently in order to test a new deployment, we need to modify the staging deployment here, check it in, and then look at the staging test results.

Ideally, I want to be able to validate a new deployment in a pull job first before needing to check it in. So I want to use the dev overlay for that, but the pull jobs cannot access gke-staging images, so we need to use public images.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I'll rename this template to pull instead of dev to make it more obvious what it's purpose is for

newTag: "v1.0.1"
- name: REPLACEME/csi-attacher
newName: quay.io/k8scsi/csi-attacher
newTag: "v1.0.1"
- name: REPLACEME/csi-node-driver-registrar
newName: quay.io/k8scsi/csi-node-driver-registrar
newTag: "v1.0.1"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ spec:
containers:
- name: gce-pd-driver
imagePullPolicy: Always
image: gcr.io/dyzz-csi-staging/csi/gce-pd-driver:latest
- name: csi-driver-registrar
image: gcr.io/gke-release/csi-node-driver-registrar:v1.0.1-gke.0

14 changes: 0 additions & 14 deletions deploy/kubernetes/overlays/prow-gke-head/controller_images.yaml

This file was deleted.

18 changes: 15 additions & 3 deletions deploy/kubernetes/overlays/prow-gke-head/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
patches:
- controller_images.yaml
- node_images.yaml
images:
- name: REPLACEME/gcp-compute-persistent-disk-csi-driver
newName: gcr.io/gke-release-staging/gcp-compute-persistent-disk-csi-driver
newTag: "latest"
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make more sense to rename this overlay prow-gke-release-staging or something like that?

Copy link
Contributor

Choose a reason for hiding this comment

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

wait nevermind, thats another overlay. prow-gke-release-staging-latest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed all prow-gke overlays

- name: REPLACEME/csi-provisioner
newName: gcr.io/gke-release-staging/csi-provisioner
newTag: "latest"
- name: REPLACEME/csi-attacher
newName: gcr.io/gke-release-staging/csi-attacher
newTag: "latest"
- name: REPLACEME/csi-node-driver-registrar
newName: gcr.io/gke-release-staging/csi-node-driver-registrar
newTag: "latest"
12 changes: 0 additions & 12 deletions deploy/kubernetes/overlays/prow-gke-head/node_images.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions deploy/kubernetes/overlays/prow-gke-staging/controller_images.yaml

This file was deleted.

18 changes: 15 additions & 3 deletions deploy/kubernetes/overlays/prow-gke-staging/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
patches:
- controller_images.yaml
- node_images.yaml
images:
- name: REPLACEME/gcp-compute-persistent-disk-csi-driver
newName: gcr.io/gke-release-staging/gcp-compute-persistent-disk-csi-driver
newTag: "v0.4.0-gke.0"
- name: REPLACEME/csi-provisioner
newName: gcr.io/gke-release-staging/csi-provisioner
newTag: "v1.0.1-gke.0"
- name: REPLACEME/csi-attacher
newName: gcr.io/gke-release-staging/csi-attacher
newTag: "v1.0.1-gke.0"
- name: REPLACEME/csi-node-driver-registrar
newName: gcr.io/gke-release-staging/csi-node-driver-registrar
newTag: "v1.0.1-gke.0"
12 changes: 0 additions & 12 deletions deploy/kubernetes/overlays/prow-gke-staging/node_images.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions deploy/kubernetes/overlays/prow-head-template/README.md

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions deploy/kubernetes/overlays/prow-head-template/node_images.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions deploy/kubernetes/overlays/stable/controller_images.yaml

This file was deleted.

18 changes: 15 additions & 3 deletions deploy/kubernetes/overlays/stable/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
patches:
- controller_images.yaml
- node_images.yaml
images:
- name: REPLACEME/gcp-compute-persistent-disk-csi-driver
newName: gcr.io/gke-release/csi/gce-pd-driver
newTag: "v0.4.0-gke.0"
- name: REPLACEME/csi-provisioner
newName: gcr.io/gke-release/csi-provisioner
newTag: "v1.0.1-gke.0"
- name: REPLACEME/csi-attacher
newName: gcr.io/gke-release/csi-attacher
newTag: "v1.0.1-gke.0"
- name: REPLACEME/csi-node-driver-registrar
newName: gcr.io/gke-release/csi-node-driver-registrar
newTag: "v1.0.1-gke.0"
12 changes: 0 additions & 12 deletions deploy/kubernetes/overlays/stable/node_images.yaml

This file was deleted.

Loading