Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit 5e78c5d

Browse files
committed
Makefile: Download Kustomize,govm binaries instead of building from source
Building from source needs downloading of all dependent source packages, instead we download the release binaries. Change in Kustomize version resulted in changes to few generated deployment files.
1 parent 4fc2eca commit 5e78c5d

File tree

6 files changed

+222
-230
lines changed

6 files changed

+222
-230
lines changed

Makefile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,13 @@ export CLUSTER ?= pmem-govm
126126
include test/start-stop.make
127127
include test/test.make
128128

129-
# Build kustomize at a certain revision. Depends on go >= 1.11
130-
# because we use module support.
131-
KUSTOMIZE_VERSION=e42933ec54ce9a65f65e125a1ccf482927f0e515
132-
_work/kustomize-$(KUSTOMIZE_VERSION):
133-
tmpdir=`mktemp -d` && \
134-
trap 'rm -r $$tmpdir' EXIT && \
135-
cd $$tmpdir && \
136-
echo "module foo" >go.mod && \
137-
go get sigs.k8s.io/kustomize@$(KUSTOMIZE_VERSION) && \
138-
go build -o $(abspath $@) sigs.k8s.io/kustomize
139-
ln -sf $(@F) _work/kustomize
129+
#Kustomize latest release version
130+
KUSTOMIZE_VERSION=v3.4.0
131+
_work/kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz:
132+
curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz -o $(abspath $@)
133+
134+
_work/kustomize: _work/kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz
135+
tar xzf $< -C _work
140136

141137
# We generate deployment files with kustomize and include the output
142138
# 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
173169
KUSTOMIZE_OUTPUT += deploy/common/pmem-storageclass-late-binding.yaml
174170
KUSTOMIZATION_deploy/common/pmem-storageclass-late-binding.yaml = deploy/kustomize/storageclass-late-binding
175171
kustomize: $(KUSTOMIZE_OUTPUT)
176-
$(KUSTOMIZE_OUTPUT): _work/kustomize-$(KUSTOMIZE_VERSION) $(KUSTOMIZE_INPUT)
172+
$(KUSTOMIZE_OUTPUT): _work/kustomize $(KUSTOMIZE_INPUT)
177173
$< build --load_restrictor none $(KUSTOMIZATION_$@) >$@
178174

179175
# Always re-generate the output files because "git rebase" might have
@@ -189,5 +185,5 @@ clean-kustomize:
189185
.PHONY: test-kustomize $(addprefix test-kustomize-,$(KUSTOMIZE_OUTPUT))
190186
test: test-kustomize
191187
test-kustomize: $(addprefix test-kustomize-,$(KUSTOMIZE_OUTPUT))
192-
$(addprefix test-kustomize-,$(KUSTOMIZE_OUTPUT)): test-kustomize-%: _work/kustomize-$(KUSTOMIZE_VERSION)
188+
$(addprefix test-kustomize-,$(KUSTOMIZE_OUTPUT)): test-kustomize-%: _work/kustomize
193189
@ if ! diff <($< build --load_restrictor none $(KUSTOMIZATION_$*)) $*; then echo "$* was modified manually" && false; fi

deploy/kubernetes-1.14/pmem-csi-direct-testing.yaml

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -136,23 +136,23 @@ subjects:
136136
apiVersion: v1
137137
kind: Service
138138
metadata:
139-
name: pmem-csi-controller-testing
139+
name: pmem-csi-controller
140140
spec:
141141
ports:
142-
- port: 10001
142+
- port: 10000
143143
selector:
144144
app: pmem-csi-controller
145-
type: NodePort
146145
---
147146
apiVersion: v1
148147
kind: Service
149148
metadata:
150-
name: pmem-csi-controller
149+
name: pmem-csi-controller-testing
151150
spec:
152151
ports:
153-
- port: 10000
152+
- port: 10001
154153
selector:
155154
app: pmem-csi-controller
155+
type: NodePort
156156
---
157157
apiVersion: apps/v1
158158
kind: StatefulSet
@@ -246,52 +246,6 @@ spec:
246246
---
247247
apiVersion: apps/v1
248248
kind: DaemonSet
249-
metadata:
250-
name: pmem-csi-node-testing
251-
spec:
252-
selector:
253-
matchLabels:
254-
app: pmem-csi-node-testing
255-
template:
256-
metadata:
257-
labels:
258-
app: pmem-csi-node-testing
259-
spec:
260-
containers:
261-
- args:
262-
- -s
263-
- tcp-listen:9735,fork,reuseaddr
264-
- unix-connect:/pmem-csi/csi.sock
265-
image: alpine/socat:1.0.3
266-
name: socat
267-
securityContext:
268-
privileged: true
269-
volumeMounts:
270-
- mountPath: /pmem-csi
271-
name: plugin-state-dir
272-
- mountPath: /var/lib/kubelet/pods
273-
mountPropagation: Bidirectional
274-
name: mountpoint-dir
275-
- mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv
276-
mountPropagation: Bidirectional
277-
name: staging-dir
278-
hostNetwork: true
279-
volumes:
280-
- hostPath:
281-
path: /var/lib/pmem-csi.intel.com/
282-
type: DirectoryOrCreate
283-
name: plugin-state-dir
284-
- hostPath:
285-
path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv
286-
type: DirectoryOrCreate
287-
name: staging-dir
288-
- hostPath:
289-
path: /var/lib/kubelet/pods
290-
type: DirectoryOrCreate
291-
name: mountpoint-dir
292-
---
293-
apiVersion: apps/v1
294-
kind: DaemonSet
295249
metadata:
296250
name: pmem-csi-node
297251
spec:
@@ -407,6 +361,52 @@ spec:
407361
type: DirectoryOrCreate
408362
name: coverage-dir
409363
---
364+
apiVersion: apps/v1
365+
kind: DaemonSet
366+
metadata:
367+
name: pmem-csi-node-testing
368+
spec:
369+
selector:
370+
matchLabels:
371+
app: pmem-csi-node-testing
372+
template:
373+
metadata:
374+
labels:
375+
app: pmem-csi-node-testing
376+
spec:
377+
containers:
378+
- args:
379+
- -s
380+
- tcp-listen:9735,fork,reuseaddr
381+
- unix-connect:/pmem-csi/csi.sock
382+
image: alpine/socat:1.0.3
383+
name: socat
384+
securityContext:
385+
privileged: true
386+
volumeMounts:
387+
- mountPath: /pmem-csi
388+
name: plugin-state-dir
389+
- mountPath: /var/lib/kubelet/pods
390+
mountPropagation: Bidirectional
391+
name: mountpoint-dir
392+
- mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv
393+
mountPropagation: Bidirectional
394+
name: staging-dir
395+
hostNetwork: true
396+
volumes:
397+
- hostPath:
398+
path: /var/lib/pmem-csi.intel.com/
399+
type: DirectoryOrCreate
400+
name: plugin-state-dir
401+
- hostPath:
402+
path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv
403+
type: DirectoryOrCreate
404+
name: staging-dir
405+
- hostPath:
406+
path: /var/lib/kubelet/pods
407+
type: DirectoryOrCreate
408+
name: mountpoint-dir
409+
---
410410
apiVersion: storage.k8s.io/v1beta1
411411
kind: CSIDriver
412412
metadata:

deploy/kubernetes-1.14/pmem-csi-lvm-testing.yaml

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -136,23 +136,23 @@ subjects:
136136
apiVersion: v1
137137
kind: Service
138138
metadata:
139-
name: pmem-csi-controller-testing
139+
name: pmem-csi-controller
140140
spec:
141141
ports:
142-
- port: 10001
142+
- port: 10000
143143
selector:
144144
app: pmem-csi-controller
145-
type: NodePort
146145
---
147146
apiVersion: v1
148147
kind: Service
149148
metadata:
150-
name: pmem-csi-controller
149+
name: pmem-csi-controller-testing
151150
spec:
152151
ports:
153-
- port: 10000
152+
- port: 10001
154153
selector:
155154
app: pmem-csi-controller
155+
type: NodePort
156156
---
157157
apiVersion: apps/v1
158158
kind: StatefulSet
@@ -246,52 +246,6 @@ spec:
246246
---
247247
apiVersion: apps/v1
248248
kind: DaemonSet
249-
metadata:
250-
name: pmem-csi-node-testing
251-
spec:
252-
selector:
253-
matchLabels:
254-
app: pmem-csi-node-testing
255-
template:
256-
metadata:
257-
labels:
258-
app: pmem-csi-node-testing
259-
spec:
260-
containers:
261-
- args:
262-
- -s
263-
- tcp-listen:9735,fork,reuseaddr
264-
- unix-connect:/pmem-csi/csi.sock
265-
image: alpine/socat:1.0.3
266-
name: socat
267-
securityContext:
268-
privileged: true
269-
volumeMounts:
270-
- mountPath: /pmem-csi
271-
name: plugin-state-dir
272-
- mountPath: /var/lib/kubelet/pods
273-
mountPropagation: Bidirectional
274-
name: mountpoint-dir
275-
- mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv
276-
mountPropagation: Bidirectional
277-
name: staging-dir
278-
hostNetwork: true
279-
volumes:
280-
- hostPath:
281-
path: /var/lib/pmem-csi.intel.com/
282-
type: DirectoryOrCreate
283-
name: plugin-state-dir
284-
- hostPath:
285-
path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv
286-
type: DirectoryOrCreate
287-
name: staging-dir
288-
- hostPath:
289-
path: /var/lib/kubelet/pods
290-
type: DirectoryOrCreate
291-
name: mountpoint-dir
292-
---
293-
apiVersion: apps/v1
294-
kind: DaemonSet
295249
metadata:
296250
name: pmem-csi-node
297251
spec:
@@ -444,6 +398,52 @@ spec:
444398
type: DirectoryOrCreate
445399
name: coverage-dir
446400
---
401+
apiVersion: apps/v1
402+
kind: DaemonSet
403+
metadata:
404+
name: pmem-csi-node-testing
405+
spec:
406+
selector:
407+
matchLabels:
408+
app: pmem-csi-node-testing
409+
template:
410+
metadata:
411+
labels:
412+
app: pmem-csi-node-testing
413+
spec:
414+
containers:
415+
- args:
416+
- -s
417+
- tcp-listen:9735,fork,reuseaddr
418+
- unix-connect:/pmem-csi/csi.sock
419+
image: alpine/socat:1.0.3
420+
name: socat
421+
securityContext:
422+
privileged: true
423+
volumeMounts:
424+
- mountPath: /pmem-csi
425+
name: plugin-state-dir
426+
- mountPath: /var/lib/kubelet/pods
427+
mountPropagation: Bidirectional
428+
name: mountpoint-dir
429+
- mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi/pv
430+
mountPropagation: Bidirectional
431+
name: staging-dir
432+
hostNetwork: true
433+
volumes:
434+
- hostPath:
435+
path: /var/lib/pmem-csi.intel.com/
436+
type: DirectoryOrCreate
437+
name: plugin-state-dir
438+
- hostPath:
439+
path: /var/lib/kubelet/plugins/kubernetes.io/csi/pv
440+
type: DirectoryOrCreate
441+
name: staging-dir
442+
- hostPath:
443+
path: /var/lib/kubelet/pods
444+
type: DirectoryOrCreate
445+
name: mountpoint-dir
446+
---
447447
apiVersion: storage.k8s.io/v1beta1
448448
kind: CSIDriver
449449
metadata:

0 commit comments

Comments
 (0)