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

Commit

Permalink
Makefile: Download kustomize binary instead of building from source
Browse files Browse the repository at this point in the history
Building kustomize from source needs download all dependent source packages,
instead we download the release binary.
  • Loading branch information
avalluri committed Nov 13, 2019
1 parent 4fc2eca commit dbad5c4
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 217 deletions.
22 changes: 9 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
102 changes: 51 additions & 51 deletions deploy/kubernetes-1.14/pmem-csi-direct-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
102 changes: 51 additions & 51 deletions deploy/kubernetes-1.14/pmem-csi-lvm-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Loading

0 comments on commit dbad5c4

Please sign in to comment.