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

Commit

Permalink
Remove init-containers in LVM mode
Browse files Browse the repository at this point in the history
As we are using 'shared/Bidirectional' mounts for LVM driver also, we
could create the needed physical devices(namespaces, volume groups) in
the same driver session. This invalidates the usage of init-containers.

Few advantages of merging the init-containers functionality to driver code:
 - smaller container image size
 - allows us to implement features that are common to both modes(ex:
 pmemPercentage)

FIXES #532
  • Loading branch information
avalluri committed Jun 27, 2020
1 parent 0748a91 commit 5365a34
Show file tree
Hide file tree
Showing 46 changed files with 193 additions and 844 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,14 @@ ARG GOFLAGS=
# image is going to be the same, to avoid unnecessary deployment
# differences.
RUN set -x && \
make VERSION=${VERSION} pmem-csi-driver${BIN_SUFFIX} pmem-vgm${BIN_SUFFIX} pmem-ns-init${BIN_SUFFIX} pmem-csi-operator${BIN_SUFFIX} && \
make VERSION=${VERSION} pmem-csi-driver${BIN_SUFFIX} pmem-csi-operator${BIN_SUFFIX} && \
mkdir -p /usr/local/bin && \
mv _output/pmem-csi-driver${BIN_SUFFIX} /usr/local/bin/pmem-csi-driver && \
mv _output/pmem-vgm${BIN_SUFFIX} /usr/local/bin/pmem-vgm && \
mv _output/pmem-ns-init${BIN_SUFFIX} /usr/local/bin/pmem-ns-init && \
mv _output/pmem-csi-operator${BIN_SUFFIX} /usr/local/bin/pmem-csi-operator && \
if [ "$BIN_SUFFIX" = "-test" ]; then GOOS=linux GO111MODULE=on \
go build -o /usr/local/bin/pmem-dax-check ./test/cmd/pmem-dax-check; fi && \
mkdir -p /usr/local/share/package-licenses && \
hack/copy-modules-license.sh /usr/local/share/package-licenses ./cmd/pmem-csi-driver ./cmd/pmem-vgm ./cmd/pmem-ns-init ./cmd/pmem-csi-operator && \
hack/copy-modules-license.sh /usr/local/share/package-licenses ./cmd/pmem-csi-driver ./cmd/pmem-csi-operator && \
cp /go/LICENSE /usr/local/share/package-licenses/go.LICENSE && \
cp LICENSE /usr/local/share/package-licenses/PMEM-CSI.LICENSE

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
GO_BINARY=go
GO=GOOS=linux GO111MODULE=on $(GO_BINARY)
IMPORT_PATH=github.com/intel/pmem-csi
CMDS=pmem-csi-driver pmem-vgm pmem-ns-init pmem-csi-operator
CMDS=pmem-csi-driver pmem-csi-operator
TEST_CMDS=$(addsuffix -test,$(CMDS))
SHELL=bash
export PWD=$(shell pwd)
Expand Down
13 changes: 0 additions & 13 deletions cmd/pmem-ns-init/main.go

This file was deleted.

12 changes: 0 additions & 12 deletions cmd/pmem-ns-init/main_test.go

This file was deleted.

13 changes: 0 additions & 13 deletions cmd/pmem-vgm/main.go

This file was deleted.

12 changes: 0 additions & 12 deletions cmd/pmem-vgm/main_test.go

This file was deleted.

32 changes: 16 additions & 16 deletions deploy/bindata_generated.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deploy/kubernetes-1.15/direct/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
env:
- name: KUBE_NODE_NAME
valueFrom:
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes-1.15/direct/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
- -v=5
- -testEndpoint
- -coverprofile=/var/lib/pmem-csi-coverage/pmem-csi-driver-node-*.out
Expand Down
31 changes: 1 addition & 30 deletions deploy/kubernetes-1.15/lvm/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
env:
- name: KUBE_NODE_NAME
valueFrom:
Expand Down Expand Up @@ -357,36 +358,6 @@ spec:
name: pmem-state-dir
- mountPath: /registration
name: registration-dir
initContainers:
- command:
- /usr/local/bin/pmem-ns-init
- -v=3
env:
- name: TERMINATION_LOG_PATH
value: /tmp/pmem-ns-init-termination-log
image: intel/pmem-csi-driver:canary
imagePullPolicy: IfNotPresent
name: pmem-ns-init
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /tmp/pmem-ns-init-termination-log
volumeMounts:
- mountPath: /sys
name: sys-dir
- command:
- /usr/local/bin/pmem-vgm
- -v=3
env:
- name: TERMINATION_LOG_PATH
value: /tmp/pmem-vgm-termination-log
image: intel/pmem-csi-driver:canary
imagePullPolicy: IfNotPresent
name: pmem-vgm
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /tmp/pmem-vgm-termination-log
nodeSelector:
storage: pmem
volumes:
Expand Down
40 changes: 1 addition & 39 deletions deploy/kubernetes-1.15/lvm/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
- -v=5
- -testEndpoint
- -coverprofile=/var/lib/pmem-csi-coverage/pmem-csi-driver-node-*.out
Expand Down Expand Up @@ -411,45 +412,6 @@ spec:
name: pmem-state-dir
- mountPath: /registration
name: registration-dir
initContainers:
- command:
- /usr/local/bin/pmem-ns-init
- -v=3
- -v=5
- -coverprofile=/var/lib/pmem-csi-coverage/pmem-ns-init-*.out
env:
- name: TERMINATION_LOG_PATH
value: /tmp/pmem-ns-init-termination-log
image: intel/pmem-csi-driver-test:canary
imagePullPolicy: IfNotPresent
name: pmem-ns-init
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /tmp/pmem-ns-init-termination-log
volumeMounts:
- mountPath: /sys
name: sys-dir
- mountPath: /var/lib/pmem-csi-coverage
name: coverage-dir
- command:
- /usr/local/bin/pmem-vgm
- -v=3
- -v=5
- -coverprofile=/var/lib/pmem-csi-coverage/pmem-vgm-*.out
env:
- name: TERMINATION_LOG_PATH
value: /tmp/pmem-vgm-termination-log
image: intel/pmem-csi-driver-test:canary
imagePullPolicy: IfNotPresent
name: pmem-vgm
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /tmp/pmem-vgm-termination-log
volumeMounts:
- mountPath: /var/lib/pmem-csi-coverage
name: coverage-dir
nodeSelector:
storage: pmem
volumes:
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes-1.15/pmem-csi-direct-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
- -v=5
- -testEndpoint
- -coverprofile=/var/lib/pmem-csi-coverage/pmem-csi-driver-node-*.out
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes-1.15/pmem-csi-direct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
env:
- name: KUBE_NODE_NAME
valueFrom:
Expand Down
40 changes: 1 addition & 39 deletions deploy/kubernetes-1.15/pmem-csi-lvm-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
- -v=5
- -testEndpoint
- -coverprofile=/var/lib/pmem-csi-coverage/pmem-csi-driver-node-*.out
Expand Down Expand Up @@ -411,45 +412,6 @@ spec:
name: pmem-state-dir
- mountPath: /registration
name: registration-dir
initContainers:
- command:
- /usr/local/bin/pmem-ns-init
- -v=3
- -v=5
- -coverprofile=/var/lib/pmem-csi-coverage/pmem-ns-init-*.out
env:
- name: TERMINATION_LOG_PATH
value: /tmp/pmem-ns-init-termination-log
image: intel/pmem-csi-driver-test:canary
imagePullPolicy: IfNotPresent
name: pmem-ns-init
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /tmp/pmem-ns-init-termination-log
volumeMounts:
- mountPath: /sys
name: sys-dir
- mountPath: /var/lib/pmem-csi-coverage
name: coverage-dir
- command:
- /usr/local/bin/pmem-vgm
- -v=3
- -v=5
- -coverprofile=/var/lib/pmem-csi-coverage/pmem-vgm-*.out
env:
- name: TERMINATION_LOG_PATH
value: /tmp/pmem-vgm-termination-log
image: intel/pmem-csi-driver-test:canary
imagePullPolicy: IfNotPresent
name: pmem-vgm
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /tmp/pmem-vgm-termination-log
volumeMounts:
- mountPath: /var/lib/pmem-csi-coverage
name: coverage-dir
nodeSelector:
storage: pmem
volumes:
Expand Down
31 changes: 1 addition & 30 deletions deploy/kubernetes-1.15/pmem-csi-lvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
env:
- name: KUBE_NODE_NAME
valueFrom:
Expand Down Expand Up @@ -357,36 +358,6 @@ spec:
name: pmem-state-dir
- mountPath: /registration
name: registration-dir
initContainers:
- command:
- /usr/local/bin/pmem-ns-init
- -v=3
env:
- name: TERMINATION_LOG_PATH
value: /tmp/pmem-ns-init-termination-log
image: intel/pmem-csi-driver:canary
imagePullPolicy: IfNotPresent
name: pmem-ns-init
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /tmp/pmem-ns-init-termination-log
volumeMounts:
- mountPath: /sys
name: sys-dir
- command:
- /usr/local/bin/pmem-vgm
- -v=3
env:
- name: TERMINATION_LOG_PATH
value: /tmp/pmem-vgm-termination-log
image: intel/pmem-csi-driver:canary
imagePullPolicy: IfNotPresent
name: pmem-vgm
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /tmp/pmem-vgm-termination-log
nodeSelector:
storage: pmem
volumes:
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes-1.16/direct/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
env:
- name: KUBE_NODE_NAME
valueFrom:
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes-1.16/direct/testing/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
- -v=5
- -testEndpoint
- -coverprofile=/var/lib/pmem-csi-coverage/pmem-csi-driver-node-*.out
Expand Down
31 changes: 1 addition & 30 deletions deploy/kubernetes-1.16/lvm/pmem-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ spec:
- -keyFile=/certs/tls.key
- -statePath=/var/lib/$(PMEM_CSI_DRIVER_NAME)
- -drivername=$(PMEM_CSI_DRIVER_NAME)
- -pmemPercentage=100
env:
- name: KUBE_NODE_NAME
valueFrom:
Expand Down Expand Up @@ -357,36 +358,6 @@ spec:
name: pmem-state-dir
- mountPath: /registration
name: registration-dir
initContainers:
- command:
- /usr/local/bin/pmem-ns-init
- -v=3
env:
- name: TERMINATION_LOG_PATH
value: /tmp/pmem-ns-init-termination-log
image: intel/pmem-csi-driver:canary
imagePullPolicy: IfNotPresent
name: pmem-ns-init
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /tmp/pmem-ns-init-termination-log
volumeMounts:
- mountPath: /sys
name: sys-dir
- command:
- /usr/local/bin/pmem-vgm
- -v=3
env:
- name: TERMINATION_LOG_PATH
value: /tmp/pmem-vgm-termination-log
image: intel/pmem-csi-driver:canary
imagePullPolicy: IfNotPresent
name: pmem-vgm
securityContext:
privileged: true
runAsUser: 0
terminationMessagePath: /tmp/pmem-vgm-termination-log
nodeSelector:
storage: pmem
volumes:
Expand Down
Loading

0 comments on commit 5365a34

Please sign in to comment.