diff --git a/deploy/kubernetes/controller.yaml b/deploy/kubernetes/manifest.yaml similarity index 71% rename from deploy/kubernetes/controller.yaml rename to deploy/kubernetes/manifest.yaml index 6744224ec9..a64b42cf9e 100644 --- a/deploy/kubernetes/controller.yaml +++ b/deploy/kubernetes/manifest.yaml @@ -1,3 +1,4 @@ +# Controller Service apiVersion: v1 kind: ServiceAccount metadata: @@ -268,3 +269,102 @@ spec: volumes: - name: socket-dir emptyDir: {} + +--- +# Node Service +kind: DaemonSet +apiVersion: apps/v1beta2 +metadata: + name: ebs-csi-node + namespace: kube-system +spec: + selector: + matchLabels: + app: ebs-csi-node + template: + metadata: + labels: + app: ebs-csi-node + spec: + hostNetwork: true + priorityClassName: system-node-critical + tolerations: + - key: CriticalAddonsOnly + operator: Exists + containers: + - name: ebs-plugin + securityContext: + privileged: true + image: amazon/aws-ebs-csi-driver:latest + args: + - --endpoint=$(CSI_ENDPOINT) + - --logtostderr + - --v=5 + env: + - name: CSI_ENDPOINT + value: unix:/csi/csi.sock + volumeMounts: + - name: kubelet-dir + mountPath: /var/lib/kubelet + mountPropagation: "Bidirectional" + - name: plugin-dir + mountPath: /csi + - name: device-dir + mountPath: /dev + ports: + - name: healthz + containerPort: 9808 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: healthz + initialDelaySeconds: 10 + timeoutSeconds: 3 + periodSeconds: 10 + failureThreshold: 5 + - name: node-driver-registrar + image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.2 + args: + - --csi-address=$(ADDRESS) + - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) + - --v=5 + lifecycle: + preStop: + exec: + command: ["/bin/sh", "-c", "rm -rf /registration/ebs.csi.aws.com-reg.sock /csi/csi.sock"] + env: + - name: ADDRESS + value: /csi/csi.sock + - name: DRIVER_REG_SOCK_PATH + value: /var/lib/kubelet/plugins/ebs.csi.aws.com/csi.sock + volumeMounts: + - name: plugin-dir + mountPath: /csi + - name: registration-dir + mountPath: /registration + - name: liveness-probe + image: quay.io/k8scsi/livenessprobe:v1.0.1 + args: + - --csi-address=/csi/csi.sock + - --connection-timeout=3s + volumeMounts: + - name: plugin-dir + mountPath: /csi + volumes: + - name: kubelet-dir + hostPath: + path: /var/lib/kubelet + type: Directory + - name: plugin-dir + hostPath: + path: /var/lib/kubelet/plugins/ebs.csi.aws.com/ + type: DirectoryOrCreate + - name: registration-dir + hostPath: + path: /var/lib/kubelet/plugins_registry/ + type: Directory + - name: device-dir + hostPath: + path: /dev + type: Directory diff --git a/deploy/kubernetes/node.yaml b/deploy/kubernetes/node.yaml deleted file mode 100644 index abce1316ec..0000000000 --- a/deploy/kubernetes/node.yaml +++ /dev/null @@ -1,96 +0,0 @@ -kind: DaemonSet -apiVersion: apps/v1beta2 -metadata: - name: ebs-csi-node - namespace: kube-system -spec: - selector: - matchLabels: - app: ebs-csi-node - template: - metadata: - labels: - app: ebs-csi-node - spec: - hostNetwork: true - priorityClassName: system-node-critical - tolerations: - - key: CriticalAddonsOnly - operator: Exists - containers: - - name: ebs-plugin - securityContext: - privileged: true - image: amazon/aws-ebs-csi-driver:latest - args: - - --endpoint=$(CSI_ENDPOINT) - - --logtostderr - - --v=5 - env: - - name: CSI_ENDPOINT - value: unix:/csi/csi.sock - volumeMounts: - - name: kubelet-dir - mountPath: /var/lib/kubelet - mountPropagation: "Bidirectional" - - name: plugin-dir - mountPath: /csi - - name: device-dir - mountPath: /dev - ports: - - name: healthz - containerPort: 9808 - protocol: TCP - livenessProbe: - httpGet: - path: /healthz - port: healthz - initialDelaySeconds: 10 - timeoutSeconds: 3 - periodSeconds: 10 - failureThreshold: 5 - - name: node-driver-registrar - image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.2 - args: - - --csi-address=$(ADDRESS) - - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) - - --v=5 - lifecycle: - preStop: - exec: - command: ["/bin/sh", "-c", "rm -rf /registration/ebs.csi.aws.com-reg.sock /csi/csi.sock"] - env: - - name: ADDRESS - value: /csi/csi.sock - - name: DRIVER_REG_SOCK_PATH - value: /var/lib/kubelet/plugins/ebs.csi.aws.com/csi.sock - volumeMounts: - - name: plugin-dir - mountPath: /csi - - name: registration-dir - mountPath: /registration - - name: liveness-probe - image: quay.io/k8scsi/livenessprobe:v1.0.1 - args: - - --csi-address=/csi/csi.sock - - --connection-timeout=3s - volumeMounts: - - name: plugin-dir - mountPath: /csi - volumes: - - name: kubelet-dir - hostPath: - path: /var/lib/kubelet - type: Directory - - name: plugin-dir - hostPath: - path: /var/lib/kubelet/plugins/ebs.csi.aws.com/ - type: DirectoryOrCreate - - name: registration-dir - hostPath: - path: /var/lib/kubelet/plugins_registry/ - type: Directory - - name: device-dir - hostPath: - path: /dev - type: Directory diff --git a/docs/README.md b/docs/README.md index d4a34410f9..ed52db2c2c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -91,8 +91,7 @@ kubectl create -f https://raw.githubusercontent.com/kubernetes/csi-api/release-1 Then deploy the driver: ```sh -kubectl apply -f deploy/kubernetes/controller.yaml -kubectl apply -f deploy/kubernetes/node.yaml +kubectl apply -f deploy/kubernetes/manifest.yaml ``` Verify driver is running: diff --git a/hack/run-e2e-test b/hack/run-e2e-test index 5849706e8b..f3dffd61b4 100755 --- a/hack/run-e2e-test +++ b/hack/run-e2e-test @@ -80,14 +80,11 @@ docker push $IMAGE_NAME # Update manifest files cp deploy/kubernetes/*.yaml $TEST_DIR -sed "s/image: amazon\/aws-ebs-csi-driver:.*/image: $AWS_ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com\/aws-ebs-csi-driver:$IMAGE_TAG/g" -i $TEST_DIR/controller.yaml -sed "s/image: amazon\/aws-ebs-csi-driver:.*/image: $AWS_ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com\/aws-ebs-csi-driver:$IMAGE_TAG/g" -i $TEST_DIR/node.yaml +sed "s/image: amazon\/aws-ebs-csi-driver:.*/image: $AWS_ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com\/aws-ebs-csi-driver:$IMAGE_TAG/g" -i $TEST_DIR/manifest.yaml echo "Deploying driver" kubectl create -f https://raw.githubusercontent.com/kubernetes/csi-api/release-1.13/pkg/crd/manifests/csinodeinfo.yaml --validate=false -kubectl apply -f $TEST_DIR/controller.yaml -kubectl apply -f $TEST_DIR/node.yaml -kubectl apply -f $TEST_DIR/secret.yaml +kubectl apply -f $TEST_DIR/manifest.yaml # Run the test go get -u github.com/onsi/ginkgo/ginkgo @@ -96,9 +93,7 @@ ginkgo -p -nodes=$NODES -v --focus="$FOCUS" tests/e2e TEST_PASS=$? echo "Removing driver" -kubectl delete -f $TEST_DIR/controller.yaml -kubectl delete -f $TEST_DIR/node.yaml -kubectl delete -f $TEST_DIR/secret.yaml +kubectl delete -f $TEST_DIR/manifest.yaml echo "Deleting cluster $CLUSTER_NAME" $KOPS_PATH delete cluster --name $CLUSTER_NAME.k8s.local --state $KOPS_STATE_FILE --yes