From dbad5c4289a1f6f34d20993af65d575d09330c53 Mon Sep 17 00:00:00 2001 From: Amarnath Valluri Date: Wed, 13 Nov 2019 14:21:23 +0200 Subject: [PATCH] Makefile: Download kustomize binary instead of building from source Building kustomize from source needs download all dependent source packages, instead we download the release binary. --- Makefile | 22 ++-- .../pmem-csi-direct-testing.yaml | 102 +++++++++--------- .../kubernetes-1.14/pmem-csi-lvm-testing.yaml | 102 +++++++++--------- .../pmem-csi-direct-testing.yaml | 102 +++++++++--------- .../kubernetes-1.16/pmem-csi-lvm-testing.yaml | 102 +++++++++--------- 5 files changed, 213 insertions(+), 217 deletions(-) diff --git a/Makefile b/Makefile index f5a866ba12..c464f8bcf8 100644 --- a/Makefile +++ b/Makefile @@ -126,17 +126,13 @@ export CLUSTER ?= pmem-govm include test/start-stop.make include test/test.make -# Build kustomize at a certain revision. Depends on go >= 1.11 -# because we use module support. -KUSTOMIZE_VERSION=e42933ec54ce9a65f65e125a1ccf482927f0e515 -_work/kustomize-$(KUSTOMIZE_VERSION): - tmpdir=`mktemp -d` && \ - trap 'rm -r $$tmpdir' EXIT && \ - cd $$tmpdir && \ - echo "module foo" >go.mod && \ - go get sigs.k8s.io/kustomize@$(KUSTOMIZE_VERSION) && \ - go build -o $(abspath $@) sigs.k8s.io/kustomize - ln -sf $(@F) _work/kustomize +#Kustomize latest release version +KUSTOMIZE_VERSION=v3.4.0 +_work/kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz: + curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz -o $(abspath $@) + +_work/kustomize: _work/kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz + tar xzf $< -C _work # We generate deployment files with kustomize and include the output # in the git repo because not all users will have kustomize or it @@ -173,7 +169,7 @@ KUSTOMIZATION_deploy/common/pmem-storageclass-cache.yaml = deploy/kustomize/stor KUSTOMIZE_OUTPUT += deploy/common/pmem-storageclass-late-binding.yaml KUSTOMIZATION_deploy/common/pmem-storageclass-late-binding.yaml = deploy/kustomize/storageclass-late-binding kustomize: $(KUSTOMIZE_OUTPUT) -$(KUSTOMIZE_OUTPUT): _work/kustomize-$(KUSTOMIZE_VERSION) $(KUSTOMIZE_INPUT) +$(KUSTOMIZE_OUTPUT): _work/kustomize $(KUSTOMIZE_INPUT) $< build --load_restrictor none $(KUSTOMIZATION_$@) >$@ # Always re-generate the output files because "git rebase" might have @@ -189,5 +185,5 @@ clean-kustomize: .PHONY: test-kustomize $(addprefix test-kustomize-,$(KUSTOMIZE_OUTPUT)) test: test-kustomize test-kustomize: $(addprefix test-kustomize-,$(KUSTOMIZE_OUTPUT)) -$(addprefix test-kustomize-,$(KUSTOMIZE_OUTPUT)): test-kustomize-%: _work/kustomize-$(KUSTOMIZE_VERSION) +$(addprefix test-kustomize-,$(KUSTOMIZE_OUTPUT)): test-kustomize-%: _work/kustomize @ if ! diff <($< build --load_restrictor none $(KUSTOMIZATION_$*)) $*; then echo "$* was modified manually" && false; fi diff --git a/deploy/kubernetes-1.14/pmem-csi-direct-testing.yaml b/deploy/kubernetes-1.14/pmem-csi-direct-testing.yaml index 7798896404..5f843a81e8 100644 --- a/deploy/kubernetes-1.14/pmem-csi-direct-testing.yaml +++ b/deploy/kubernetes-1.14/pmem-csi-direct-testing.yaml @@ -136,23 +136,23 @@ subjects: apiVersion: v1 kind: Service metadata: - name: pmem-csi-controller-testing + name: pmem-csi-controller spec: ports: - - port: 10001 + - port: 10000 selector: app: pmem-csi-controller - type: NodePort --- apiVersion: v1 kind: Service metadata: - name: pmem-csi-controller + name: pmem-csi-controller-testing spec: ports: - - port: 10000 + - port: 10001 selector: app: pmem-csi-controller + type: NodePort --- apiVersion: apps/v1 kind: StatefulSet @@ -246,52 +246,6 @@ spec: --- apiVersion: apps/v1 kind: DaemonSet -metadata: - name: pmem-csi-node-testing -spec: - selector: - matchLabels: - app: pmem-csi-node-testing - template: - metadata: - labels: - app: pmem-csi-node-testing - spec: - containers: - - args: - - -s - - tcp-listen:9735,fork,reuseaddr - - unix-connect:/pmem-csi/csi.sock - image: alpine/socat:1.0.3 - name: socat - securityContext: - privileged: true - volumeMounts: - - mountPath: /pmem-csi - name: plugin-state-dir - - mountPath: /var/lib/kubelet/pods - mountPropagation: Bidirectional - name: mountpoint-dir - - mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv - mountPropagation: Bidirectional - name: staging-dir - hostNetwork: true - volumes: - - hostPath: - path: /var/lib/pmem-csi.intel.com/ - type: DirectoryOrCreate - name: plugin-state-dir - - hostPath: - path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv - type: DirectoryOrCreate - name: staging-dir - - hostPath: - path: /var/lib/kubelet/pods - type: DirectoryOrCreate - name: mountpoint-dir ---- -apiVersion: apps/v1 -kind: DaemonSet metadata: name: pmem-csi-node spec: @@ -407,6 +361,52 @@ spec: type: DirectoryOrCreate name: coverage-dir --- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: pmem-csi-node-testing +spec: + selector: + matchLabels: + app: pmem-csi-node-testing + template: + metadata: + labels: + app: pmem-csi-node-testing + spec: + containers: + - args: + - -s + - tcp-listen:9735,fork,reuseaddr + - unix-connect:/pmem-csi/csi.sock + image: alpine/socat:1.0.3 + name: socat + securityContext: + privileged: true + volumeMounts: + - mountPath: /pmem-csi + name: plugin-state-dir + - mountPath: /var/lib/kubelet/pods + mountPropagation: Bidirectional + name: mountpoint-dir + - mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv + mountPropagation: Bidirectional + name: staging-dir + hostNetwork: true + volumes: + - hostPath: + path: /var/lib/pmem-csi.intel.com/ + type: DirectoryOrCreate + name: plugin-state-dir + - hostPath: + path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv + type: DirectoryOrCreate + name: staging-dir + - hostPath: + path: /var/lib/kubelet/pods + type: DirectoryOrCreate + name: mountpoint-dir +--- apiVersion: storage.k8s.io/v1beta1 kind: CSIDriver metadata: diff --git a/deploy/kubernetes-1.14/pmem-csi-lvm-testing.yaml b/deploy/kubernetes-1.14/pmem-csi-lvm-testing.yaml index 5e6395366a..41b3858139 100644 --- a/deploy/kubernetes-1.14/pmem-csi-lvm-testing.yaml +++ b/deploy/kubernetes-1.14/pmem-csi-lvm-testing.yaml @@ -136,23 +136,23 @@ subjects: apiVersion: v1 kind: Service metadata: - name: pmem-csi-controller-testing + name: pmem-csi-controller spec: ports: - - port: 10001 + - port: 10000 selector: app: pmem-csi-controller - type: NodePort --- apiVersion: v1 kind: Service metadata: - name: pmem-csi-controller + name: pmem-csi-controller-testing spec: ports: - - port: 10000 + - port: 10001 selector: app: pmem-csi-controller + type: NodePort --- apiVersion: apps/v1 kind: StatefulSet @@ -246,52 +246,6 @@ spec: --- apiVersion: apps/v1 kind: DaemonSet -metadata: - name: pmem-csi-node-testing -spec: - selector: - matchLabels: - app: pmem-csi-node-testing - template: - metadata: - labels: - app: pmem-csi-node-testing - spec: - containers: - - args: - - -s - - tcp-listen:9735,fork,reuseaddr - - unix-connect:/pmem-csi/csi.sock - image: alpine/socat:1.0.3 - name: socat - securityContext: - privileged: true - volumeMounts: - - mountPath: /pmem-csi - name: plugin-state-dir - - mountPath: /var/lib/kubelet/pods - mountPropagation: Bidirectional - name: mountpoint-dir - - mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv - mountPropagation: Bidirectional - name: staging-dir - hostNetwork: true - volumes: - - hostPath: - path: /var/lib/pmem-csi.intel.com/ - type: DirectoryOrCreate - name: plugin-state-dir - - hostPath: - path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv - type: DirectoryOrCreate - name: staging-dir - - hostPath: - path: /var/lib/kubelet/pods - type: DirectoryOrCreate - name: mountpoint-dir ---- -apiVersion: apps/v1 -kind: DaemonSet metadata: name: pmem-csi-node spec: @@ -444,6 +398,52 @@ spec: type: DirectoryOrCreate name: coverage-dir --- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: pmem-csi-node-testing +spec: + selector: + matchLabels: + app: pmem-csi-node-testing + template: + metadata: + labels: + app: pmem-csi-node-testing + spec: + containers: + - args: + - -s + - tcp-listen:9735,fork,reuseaddr + - unix-connect:/pmem-csi/csi.sock + image: alpine/socat:1.0.3 + name: socat + securityContext: + privileged: true + volumeMounts: + - mountPath: /pmem-csi + name: plugin-state-dir + - mountPath: /var/lib/kubelet/pods + mountPropagation: Bidirectional + name: mountpoint-dir + - mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv + mountPropagation: Bidirectional + name: staging-dir + hostNetwork: true + volumes: + - hostPath: + path: /var/lib/pmem-csi.intel.com/ + type: DirectoryOrCreate + name: plugin-state-dir + - hostPath: + path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv + type: DirectoryOrCreate + name: staging-dir + - hostPath: + path: /var/lib/kubelet/pods + type: DirectoryOrCreate + name: mountpoint-dir +--- apiVersion: storage.k8s.io/v1beta1 kind: CSIDriver metadata: diff --git a/deploy/kubernetes-1.16/pmem-csi-direct-testing.yaml b/deploy/kubernetes-1.16/pmem-csi-direct-testing.yaml index 37e4ed8f54..e773fd0608 100644 --- a/deploy/kubernetes-1.16/pmem-csi-direct-testing.yaml +++ b/deploy/kubernetes-1.16/pmem-csi-direct-testing.yaml @@ -136,23 +136,23 @@ subjects: apiVersion: v1 kind: Service metadata: - name: pmem-csi-controller-testing + name: pmem-csi-controller spec: ports: - - port: 10001 + - port: 10000 selector: app: pmem-csi-controller - type: NodePort --- apiVersion: v1 kind: Service metadata: - name: pmem-csi-controller + name: pmem-csi-controller-testing spec: ports: - - port: 10000 + - port: 10001 selector: app: pmem-csi-controller + type: NodePort --- apiVersion: apps/v1 kind: StatefulSet @@ -246,52 +246,6 @@ spec: --- apiVersion: apps/v1 kind: DaemonSet -metadata: - name: pmem-csi-node-testing -spec: - selector: - matchLabels: - app: pmem-csi-node-testing - template: - metadata: - labels: - app: pmem-csi-node-testing - spec: - containers: - - args: - - -s - - tcp-listen:9735,fork,reuseaddr - - unix-connect:/pmem-csi/csi.sock - image: alpine/socat:1.0.3 - name: socat - securityContext: - privileged: true - volumeMounts: - - mountPath: /pmem-csi - name: plugin-state-dir - - mountPath: /var/lib/kubelet/pods - mountPropagation: Bidirectional - name: mountpoint-dir - - mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv - mountPropagation: Bidirectional - name: staging-dir - hostNetwork: true - volumes: - - hostPath: - path: /var/lib/pmem-csi.intel.com/ - type: DirectoryOrCreate - name: plugin-state-dir - - hostPath: - path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv - type: DirectoryOrCreate - name: staging-dir - - hostPath: - path: /var/lib/kubelet/pods - type: DirectoryOrCreate - name: mountpoint-dir ---- -apiVersion: apps/v1 -kind: DaemonSet metadata: name: pmem-csi-node spec: @@ -407,6 +361,52 @@ spec: type: DirectoryOrCreate name: coverage-dir --- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: pmem-csi-node-testing +spec: + selector: + matchLabels: + app: pmem-csi-node-testing + template: + metadata: + labels: + app: pmem-csi-node-testing + spec: + containers: + - args: + - -s + - tcp-listen:9735,fork,reuseaddr + - unix-connect:/pmem-csi/csi.sock + image: alpine/socat:1.0.3 + name: socat + securityContext: + privileged: true + volumeMounts: + - mountPath: /pmem-csi + name: plugin-state-dir + - mountPath: /var/lib/kubelet/pods + mountPropagation: Bidirectional + name: mountpoint-dir + - mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv + mountPropagation: Bidirectional + name: staging-dir + hostNetwork: true + volumes: + - hostPath: + path: /var/lib/pmem-csi.intel.com/ + type: DirectoryOrCreate + name: plugin-state-dir + - hostPath: + path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv + type: DirectoryOrCreate + name: staging-dir + - hostPath: + path: /var/lib/kubelet/pods + type: DirectoryOrCreate + name: mountpoint-dir +--- apiVersion: storage.k8s.io/v1beta1 kind: CSIDriver metadata: diff --git a/deploy/kubernetes-1.16/pmem-csi-lvm-testing.yaml b/deploy/kubernetes-1.16/pmem-csi-lvm-testing.yaml index fe8346a58e..c22f91099b 100644 --- a/deploy/kubernetes-1.16/pmem-csi-lvm-testing.yaml +++ b/deploy/kubernetes-1.16/pmem-csi-lvm-testing.yaml @@ -136,23 +136,23 @@ subjects: apiVersion: v1 kind: Service metadata: - name: pmem-csi-controller-testing + name: pmem-csi-controller spec: ports: - - port: 10001 + - port: 10000 selector: app: pmem-csi-controller - type: NodePort --- apiVersion: v1 kind: Service metadata: - name: pmem-csi-controller + name: pmem-csi-controller-testing spec: ports: - - port: 10000 + - port: 10001 selector: app: pmem-csi-controller + type: NodePort --- apiVersion: apps/v1 kind: StatefulSet @@ -246,52 +246,6 @@ spec: --- apiVersion: apps/v1 kind: DaemonSet -metadata: - name: pmem-csi-node-testing -spec: - selector: - matchLabels: - app: pmem-csi-node-testing - template: - metadata: - labels: - app: pmem-csi-node-testing - spec: - containers: - - args: - - -s - - tcp-listen:9735,fork,reuseaddr - - unix-connect:/pmem-csi/csi.sock - image: alpine/socat:1.0.3 - name: socat - securityContext: - privileged: true - volumeMounts: - - mountPath: /pmem-csi - name: plugin-state-dir - - mountPath: /var/lib/kubelet/pods - mountPropagation: Bidirectional - name: mountpoint-dir - - mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv - mountPropagation: Bidirectional - name: staging-dir - hostNetwork: true - volumes: - - hostPath: - path: /var/lib/pmem-csi.intel.com/ - type: DirectoryOrCreate - name: plugin-state-dir - - hostPath: - path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv - type: DirectoryOrCreate - name: staging-dir - - hostPath: - path: /var/lib/kubelet/pods - type: DirectoryOrCreate - name: mountpoint-dir ---- -apiVersion: apps/v1 -kind: DaemonSet metadata: name: pmem-csi-node spec: @@ -444,6 +398,52 @@ spec: type: DirectoryOrCreate name: coverage-dir --- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: pmem-csi-node-testing +spec: + selector: + matchLabels: + app: pmem-csi-node-testing + template: + metadata: + labels: + app: pmem-csi-node-testing + spec: + containers: + - args: + - -s + - tcp-listen:9735,fork,reuseaddr + - unix-connect:/pmem-csi/csi.sock + image: alpine/socat:1.0.3 + name: socat + securityContext: + privileged: true + volumeMounts: + - mountPath: /pmem-csi + name: plugin-state-dir + - mountPath: /var/lib/kubelet/pods + mountPropagation: Bidirectional + name: mountpoint-dir + - mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv + mountPropagation: Bidirectional + name: staging-dir + hostNetwork: true + volumes: + - hostPath: + path: /var/lib/pmem-csi.intel.com/ + type: DirectoryOrCreate + name: plugin-state-dir + - hostPath: + path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv + type: DirectoryOrCreate + name: staging-dir + - hostPath: + path: /var/lib/kubelet/pods + type: DirectoryOrCreate + name: mountpoint-dir +--- apiVersion: storage.k8s.io/v1beta1 kind: CSIDriver metadata: