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 2 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
8 changes: 5 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,5 @@ spec:
- name: cloud-sa-volume
secret:
secretName: cloud-sa
# This is needed due to https://github.com/kubernetes-sigs/kustomize/issues/504
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 names and tags
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: 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"
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.

1 change: 1 addition & 0 deletions deploy/kubernetes/overlays/prow-pull/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
These overlays are intended to be only used by prow for CI testing.
17 changes: 17 additions & 0 deletions deploy/kubernetes/overlays/prow-pull/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
images:
- name: REPLACEME/gcp-compute-persistent-disk-csi-driver
newName: gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver
newTag: "v0.4.0-gke.0"
- 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.

the pull job should be using the gke release versions of sidecars right? and the REPLACEME/gcp-compute-persistent-disk-csi-driver should actually be replaced by a pull request specific built container?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally the pull job should use the gke versions of sidecars, however, we have a chicken and egg problem when we want to test a new version of a sidecar but it's not available in gke-release yet. For example, enabling topology.

The other option, is to not test new sidecar features in the pull job (only test stable features), and only switch over pull jobs when we change stable. Actually, the pull job could just use the stable overlay.

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"
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