Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving to CNCF cluster #429

Merged
merged 63 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
9183c3c
Initial changes for login
anishakj Jul 27, 2020
c74b35d
made changes for helm2
anishakj Jul 27, 2020
a902cd5
Made the changes
anishakj Jul 27, 2020
47b13e6
Made login changes
anishakj Jul 27, 2020
bf63673
modified travis
anishakj Jul 27, 2020
6e86464
modified travis
anishakj Jul 27, 2020
268860b
Modified job
anishakj Jul 27, 2020
d206796
modified travis
anishakj Jul 27, 2020
877e0bb
Modified packet
anishakj Jul 27, 2020
0a30a72
fixed sudo
anishakj Jul 27, 2020
10fb891
Modified travis
anishakj Jul 27, 2020
3a977ce
modified space
anishakj Jul 27, 2020
72e422c
modified cluster ip
anishakj Jul 27, 2020
e208ca1
increased sleep
anishakj Jul 27, 2020
498ecad
Modified command
anishakj Jul 27, 2020
2157797
Reduced sleep
anishakj Jul 27, 2020
53e06a8
Changed variable name
anishakj Jul 27, 2020
51b9e50
Modified ssh
anishakj Jul 27, 2020
e757921
added sudo
anishakj Jul 27, 2020
50bfbb3
Added ssh keys
anishakj Jul 28, 2020
fe21847
Added logs
anishakj Jul 28, 2020
4108724
Added quotes
anishakj Jul 28, 2020
9114014
Added logs
anishakj Jul 28, 2020
535450e
Added ssh keys
anishakj Jul 28, 2020
db1fb8c
removed sudo
anishakj Jul 28, 2020
832ea56
added more nodes
anishakj Jul 28, 2020
aea4177
removed token
anishakj Jul 28, 2020
dea6edd
Added script for k8 install
anishakj Jul 29, 2020
b0c2e79
modified ssh
anishakj Jul 29, 2020
2830978
modified cmd
anishakj Jul 29, 2020
cbab87e
modified install
anishakj Jul 29, 2020
fa179f8
Fixed error
anishakj Jul 29, 2020
e1ac6e2
Added worker install scripts
anishakj Jul 29, 2020
21a3362
Added joining script
anishakj Jul 29, 2020
4f2359b
Added zookeeper install
anishakj Jul 29, 2020
68c198d
Added bk installation
anishakj Jul 29, 2020
cb498a1
Added certificate install
anishakj Jul 29, 2020
1edf250
fixed helm error
anishakj Jul 29, 2020
9cb0043
added helm update
anishakj Jul 29, 2020
41601df
ADDEd tests
anishakj Jul 29, 2020
701cf58
Removed comment
anishakj Jul 29, 2020
552a9dc
Fixed typo
anishakj Jul 29, 2020
a814907
Fixed typo
anishakj Jul 30, 2020
5c64c2a
exported username
anishakj Jul 30, 2020
6cb1f59
Modified Makefile
anishakj Jul 30, 2020
2741b50
Installing go
anishakj Jul 30, 2020
da17cee
Installing go
anishakj Jul 30, 2020
27886bc
sourcing gvm
anishakj Jul 30, 2020
6aed1d3
Merge branch 'master' of https://github.com/pravega/pravega-operator
anishakj Jul 30, 2020
8b45587
Modified kubernetes master script
anishakj Aug 3, 2020
4dcb568
Commenting out tests for debugging
anishakj Aug 3, 2020
71fec67
Fixed formatting
anishakj Aug 3, 2020
4c54751
Enabling only recreate cluster
anishakj Aug 3, 2020
8757946
Added tests back
anishakj Aug 3, 2020
3e0f6a4
Modified tests
anishakj Aug 4, 2020
8d559a4
Fixed formatting
anishakj Aug 4, 2020
032c469
Commenting upgrade test
anishakj Aug 4, 2020
02af4e5
Uncommented the upgrade test
anishakj Aug 5, 2020
04d8076
Added cleanup
anishakj Aug 5, 2020
552166b
Fixed the typo in variable name
anishakj Aug 5, 2020
7d10110
Added condition back for e2e
anishakj Aug 6, 2020
3e2c596
Addressed review comments
anishakj Aug 6, 2020
7724a14
Changed the repo name
anishakj Aug 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 56 additions & 63 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ jobs:

- stage: unit
name: Unit tests
env:
- HELM_VERSION=v2.12.0
- DEP_VERSION=v0.5.0
install:
- curl -Lo dep https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/
- curl -Lo helm.tar.gz https://storage.googleapis.com/kubernetes-helm/helm-$HELM_VERSION-linux-amd64.tar.gz && tar xfz helm.tar.gz && sudo mv linux-amd64/{helm,tiller} /usr/local/bin/
before_script:
- helm init --client-only
script:
- make test-unit
after_success:
Expand All @@ -45,69 +37,70 @@ jobs:
env:
- KUBECTL_VERSION=v1.15.0
- OPERATOR_SDK_VERSION=v0.17.0
- HELM_VERSION=v2.12.0
- DEP_VERSION=v0.5.0
- CLUSTER_NAME="pravega-operator-travis-$(date +'%Y%m%d%H%M%S')"
- CLUSTER_ZONE=us-west-2
- CLUSTER_SIZE=3
- CLUSTER_NODE_TYPE=m5.xlarge
- CLUSTER_NODE_GROUP=standard-workers
install:
- pip install --upgrade --user awscli
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- curl -Lo dep https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/
- curl -Lo operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/$OPERATOR_SDK_VERSION/operator-sdk-$OPERATOR_SDK_VERSION-x86_64-linux-gnu && chmod +x operator-sdk && sudo mv operator-sdk /usr/local/bin/
- curl -Lo helm.tar.gz https://storage.googleapis.com/kubernetes-helm/helm-$HELM_VERSION-linux-amd64.tar.gz && tar xfz helm.tar.gz && sudo mv linux-amd64/{helm,tiller} /usr/local/bin/
before_script:
- curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
- sudo mv /tmp/eksctl /usr/local/bin
- eksctl version
- aws configure set default.region $CLUSTER_ZONE
- aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
- travis_wait 20 eksctl create cluster --name $CLUSTER_NAME --version 1.15 --nodegroup-name $CLUSTER_NODE_GROUP --node-type $CLUSTER_NODE_TYPE --nodes $CLUSTER_SIZE
- kubectl config view
- kubectl config current-context
- kubectl get nodes -o wide
- kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$GOOGLE_SERVICE_ACCOUNT
# Install Helm Tiller
- kubectl create serviceaccount --namespace kube-system tiller
- kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
- helm init --service-account tiller --wait
# Install NFS provisioner
- helm install stable/nfs-server-provisioner
- kubectl -n default create -f test/e2e/resources/tier2.yaml
- JSONPATH='{.status.phase}'; until kubectl get pvc pravega-tier2 -o jsonpath="$JSONPATH" 2>&1 | grep -q "Bound"; do sleep 1; done
# Install ZooKeeper
- kubectl -n default create -f test/e2e/resources/zookeeper.yaml
- JSONPATH1='{.spec.replicas}'; JSONPATH2='{.status.readyReplicas}'; replicas=$(kubectl get zookeepercluster zk -o jsonpath=$JSONPATH1);ready=$(kubectl get zookeepercluster zk -o jsonpath=$JSONPATH2); echo "REPLICAS=$replicas, READY=$ready"; while [ "$replicas" != "$ready" ]; do sleep 5s; replicas=$(kubectl get zookeepercluster zk -o jsonpath=$JSONPATH1);ready=$(kubectl get zookeepercluster zk -o jsonpath=$JSONPATH2); echo "REPLICAS=$replicas, READY=$ready"; done
# Install Bookkeeper
- kubectl -n default create -f test/e2e/resources/bookkeeper.yaml
script:
- curl -Lo packet-cli https://github.com/packethost/packet-cli/releases/download/0.0.7/packet-linux-amd64 && chmod +x packet-cli && sudo mv packet-cli /usr/local/bin/
- ssh-keygen -f ~/.ssh/id_rsa -P ""
- pub_key=`cat ~/.ssh/id_rsa.pub`
- echo " publc key is $pub_key"
- echo "packet-cli ssh-key create --key \"$(cat ~/.ssh/id_rsa.pub)\" --label \"pravega\""
- packet-cli ssh-key create --key "$(cat ~/.ssh/id_rsa.pub)" --label "pravega-travis"
- packet-cli device create -H $CLUSTER_NAME -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f nrt1
- packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME | awk '{print $2}'
- CLUSTER_ID=`packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME | awk '{print $2}' | tr -d ' '`
- echo "cluster id is $CLUSTER_ID"
- packet-cli device create -H $CLUSTER_NAME"-worker1" -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f nrt1
- packet-cli device create -H $CLUSTER_NAME"-worker2" -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f nrt1
- sleep 300
- CLUSTER_IP=`packet-cli device get -i $CLUSTER_ID -y | grep "\- address:" | head -1 |awk '{print $3}' | tr -d ' '`
- echo "Cluster IP is $CLUSTER_IP"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "sudo apt-get update;sudo apt-get install git -y;git clone https://github.com/pravega/pravega-operator.git; cd pravega-operator;git checkout issue-cncf-cluster"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP /root/pravega-operator/test/e2e/resources/kubernetes_master_install.sh
- CLUSTER_ID1=`packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME"-worker1" | awk '{print $2}' | tr -d ' '`
- CLUSTER_IP1=`packet-cli device get -i $CLUSTER_ID1 -y | grep "\- address:" | head -1 |awk '{print $3}' | tr -d ' '`
- CLUSTER_ID2=`packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME"-worker2" | awk '{print $2}' | tr -d ' '`
- CLUSTER_IP2=`packet-cli device get -i $CLUSTER_ID2 -y | grep "\- address:" | head -1 |awk '{print $3}' | tr -d ' '`
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP1 "sudo apt-get update;sudo apt-get install git -y;git clone https://github.com/pravega/pravega-operator.git; cd pravega-operator;git checkout issue-cncf-cluster"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP2 "sudo apt-get update;sudo apt-get install git -y;git clone https://github.com/pravega/pravega-operator.git; cd pravega-operator;git checkout issue-cncf-cluster"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP1 /root/pravega-operator/test/e2e/resources/kubernetes_slave_install.sh
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP2 /root/pravega-operator/test/e2e/resources/kubernetes_slave_install.sh
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP 'kubeadm token create --print-join-command | head -2' >JOIN
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP1 $(cat JOIN)
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP2 $(cat JOIN)
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl get nodes"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "mkdir /data;kubectl create -f /root/pravega-operator/test/e2e/resources/local-storage.yaml"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "curl -L https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "helm repo add stable https://kubernetes-charts.storage.googleapis.com;helm install stable/nfs-server-provisioner --generate-name;kubectl -n default create -f /root/pravega-operator/test/e2e/resources/tier2.yaml"

- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl create -f /root/pravega-operator/test/e2e/resources/zookeeper.yaml"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl -n default create -f /root/pravega-operator/test/e2e/resources/bookkeeper.yaml"
- sleep 30s
- kubectl -n default create -f test/e2e/resources/bk-version-map.yaml
- kubectl -n default create -f test/e2e/resources/bk-config-map.yaml
- kubectl -n default create -f test/e2e/resources/bk-cluster.yaml
- JPATH1='{.spec.replicas}'; JPATH2='{.status.readyReplicas}'; bk_replicas=$(kubectl get bookkeepercluster pravega -o jsonpath=$JPATH1);bk_ready=$(kubectl get bookkeepercluster pravega -o jsonpath=$JPATH2); echo "REPLICAS=$bk_replicas, READY=$bk_ready"; while [ "$bk_replicas" != "$bk_ready" ]; do sleep 1; bk_replicas=$(kubectl get bookkeepercluster pravega -o jsonpath=$JPATH1); bk_ready=$(kubectl get bookkeepercluster pravega -o jsonpath=$JPATH2); echo "REPLICAS=$bk_replicas, READY=$bk_ready"; done
# Install the ConfigMap for version dependency
- kubectl -n default create -f deploy/version_map.yaml
- kubectl apply -f "https://github.com/jetstack/cert-manager/releases/download/v0.14.1/cert-manager.crds.yaml"
- helm repo add jetstack https://charts.jetstack.io
- helm repo update
- helm install --name cert-manager --namespace cert-manager --version v0.14.1 jetstack/cert-manager --wait
- kubectl create -f deploy/certificate.yaml
- kubectl create -f deploy/webhook.yaml
- kubectl create -f test/e2e/resources/crd.yaml
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl -n default create -f /root/pravega-operator/test/e2e/resources/bk-version-map.yaml"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl -n default create -f /root/pravega-operator/test/e2e/resources/bk-config-map.yaml"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl -n default create -f /root/pravega-operator/test/e2e/resources/bk-cluster.yaml"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl -n default create -f /root/pravega-operator/deploy/version_map.yaml"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl apply -f \"https://github.com/jetstack/cert-manager/releases/download/v0.14.1/cert-manager.crds.yaml\""
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "helm repo add jetstack https://charts.jetstack.io"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "helm repo update"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl create namespace cert-manager;helm install cert-manager jetstack/cert-manager --namespace cert-manager --version v0.14.1 --wait"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl create -f /root/pravega-operator/deploy/certificate.yaml"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl create -f /root/pravega-operator/deploy/webhook.yaml"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl create -f /root/pravega-operator/test/e2e/resources/crd.yaml"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "curl -Lo operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/$OPERATOR_SDK_VERSION/operator-sdk-$OPERATOR_SDK_VERSION-x86_64-linux-gnu && chmod +x operator-sdk && sudo mv operator-sdk /usr/local/bin/"
# Show Pravega dependencies
- kubectl -n default get pod,pvc,svc -o wide
script:
# ping stdout every 5 minutes or Travis kills build
# ref: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received
- while sleep 5m; do kubectl get pods; done &
- make test-e2e
- while sleep 5m; do echo hello; done &
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer);source /root/.gvm/scripts/gvm;gvm install go1.13.8 --binary;gvm use go1.13.8 --default"
- ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "cd /root/pravega-operator;source /root/.gvm/scripts/gvm;make test-e2e"
# kill background echo loop
- echo "killing while sleep loop" && kill %1
after_script:
- eksctl delete cluster --name $CLUSTER_NAME
- SSHKEY=`packet-cli ssh-key get | grep "pravega-travis" | awk '{print $2}' | tr -d ' '`
- echo y | packet-cli ssh-key delete -i $SSHKEY
- echo y | packet-cli device delete -i $CLUSTER_ID
- echo y | packet-cli device delete -i $CLUSTER_ID1
- echo y | packet-cli device delete -i $CLUSTER_ID2

- stage: deploy
name: Push Docker image
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
SHELL=/bin/bash -o pipefail

PROJECT_NAME=pravega-operator
REPO=tristan1900/$(PROJECT_NAME)
REPO=testpravegaop/$(PROJECT_NAME)
VERSION=$(shell git describe --always --tags --dirty | sed "s/\(.*\)-g`git rev-parse --short HEAD`/\1/")
GIT_SHA=$(shell git rev-parse --short HEAD)
TEST_IMAGE=$(REPO)-testimages:$(VERSION)
GOOS=linux
GOARCH=amd64
DOCKER_TEST_PASS=testpravegaop
DOCKER_TEST_USER=testpravegaop

.PHONY: all build check clean test

Expand Down
10 changes: 8 additions & 2 deletions test/e2e/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ func testCreateRecreateCluster(t *testing.T) {
g.Expect(err).NotTo(HaveOccurred())
f := framework.Global

// A workaround for issue 93
err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace)
g.Expect(err).NotTo(HaveOccurred())

defaultCluster := pravega_e2eutil.NewDefaultCluster(namespace)
defaultCluster.WithDefaults()

Expand All @@ -51,6 +55,10 @@ func testCreateRecreateCluster(t *testing.T) {
err = pravega_e2eutil.WaitForClusterToTerminate(t, f, ctx, pravega)
g.Expect(err).NotTo(HaveOccurred())

// A workaround for issue 93
err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace)
Prabhaker24 marked this conversation as resolved.
Show resolved Hide resolved
g.Expect(err).NotTo(HaveOccurred())

defaultCluster = pravega_e2eutil.NewDefaultCluster(namespace)
defaultCluster.WithDefaults()

Expand All @@ -72,6 +80,4 @@ func testCreateRecreateCluster(t *testing.T) {
err = pravega_e2eutil.WaitForClusterToTerminate(t, f, ctx, pravega)
g.Expect(err).NotTo(HaveOccurred())

err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace)
g.Expect(err).NotTo(HaveOccurred())
}
39 changes: 39 additions & 0 deletions test/e2e/resources/kubernetes_master_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

sudo apt-get update
echo "update done"
sudo apt install docker.io -y
echo "docker install"
sudo systemctl enable --now docker
sudo apt-get install nfs-common -y
sudo rm /lib/systemd/system/nfs-common.service
sudo systemctl daemon-reload
sudo systemctl start nfs-common
sudo systemctl status nfs-common
apt-get update && apt-get install -y \
apt-transport-https ca-certificates curl software-properties-common gnupg2
echo "installed certs"
sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" \
| sudo tee -a /etc/apt/sources.list.d/kubernetes.list \
&& sudo apt-get update
sudo apt-get update \
&& sudo apt-get install -yq \
kubelet \
kubeadm \
kubernetes-cni
sudo apt-mark hold kubelet kubeadm kubectl
UUID=`cat /etc/fstab | grep swap | awk '{print $1}' | tr -d "#UUID="`
sed -i '2 s/^/#/' /etc/fstab
echo "swapoff UUID=$UUID"
swapoff UUID=$UUID
IP=`ifconfig bond0:0 | grep "inet" | awk '{print $2}'`
sudo kubeadm init --apiserver-advertise-address=$IP
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl get nodes
kubectl apply -f https://docs.projectcalico.org/v3.14/manifests/calico.yaml
kubectl get nodes
sudo apt-get install binutils bison gcc -y
mkdir /export
29 changes: 29 additions & 0 deletions test/e2e/resources/kubernetes_slave_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

sudo apt-get update
echo "update done"
sudo apt-get install nfs-common -y
sudo rm /lib/systemd/system/nfs-common.service
sudo systemctl daemon-reload
sudo systemctl start nfs-common
sudo systemctl status nfs-common
sudo apt install docker.io -y
echo "docker install"
sudo systemctl enable --now docker
apt-get update && apt-get install -y \
apt-transport-https ca-certificates curl software-properties-common gnupg2
echo "installed certs"
sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" \
| sudo tee -a /etc/apt/sources.list.d/kubernetes.list \
&& sudo apt-get update
sudo apt-get update \
&& sudo apt-get install -yq \
kubelet \
kubeadm \
kubernetes-cni
sudo apt-mark hold kubelet kubeadm kubectl
UUID=`cat /etc/fstab | grep swap | awk '{print $1}' | tr -d "#UUID="`
sed -i '2 s/^/#/' /etc/fstab
echo "swapoff UUID=$UUID"
swapoff UUID=$UUID
114 changes: 114 additions & 0 deletions test/e2e/resources/local-storage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
apiVersion: v1
kind: Namespace
metadata:
name: local-path-storage
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: local-path-provisioner-service-account
namespace: local-path-storage
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: local-path-provisioner-role
rules:
- apiGroups: [""]
resources: ["nodes", "persistentvolumeclaims"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["endpoints", "persistentvolumes", "pods"]
verbs: ["*"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: local-path-provisioner-bind
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: local-path-provisioner-role
subjects:
- kind: ServiceAccount
name: local-path-provisioner-service-account
namespace: local-path-storage
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: local-path-provisioner
namespace: local-path-storage
spec:
replicas: 1
selector:
matchLabels:
app: local-path-provisioner
template:
metadata:
labels:
app: local-path-provisioner
spec:
serviceAccountName: local-path-provisioner-service-account
containers:
- name: local-path-provisioner
image: rancher/local-path-provisioner:v0.0.14
imagePullPolicy: IfNotPresent
command:
- local-path-provisioner
- --debug
- start
- --config
- /etc/config/config.json
volumeMounts:
- name: config-volume
mountPath: /etc/config/
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumes:
- name: config-volume
configMap:
name: local-path-config
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: standard
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: rancher.io/local-path
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Delete
---
kind: ConfigMap
apiVersion: v1
metadata:
name: local-path-config
namespace: local-path-storage
data:
config.json: |-
{
"nodePathMap":[
{
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
"paths":["/data"]
}
]
}
setup: |-
#!/bin/sh
path=$1
mkdir -m 0777 -p ${path}
teardown: |-
#!/bin/sh
path=$1
rm -rf ${path}
7 changes: 4 additions & 3 deletions test/e2e/scale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func testScaleCluster(t *testing.T) {
g.Expect(err).NotTo(HaveOccurred())
f := framework.Global

// A workaround for issue 93
err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace)
g.Expect(err).NotTo(HaveOccurred())

defaultCluster := pravega_e2eutil.NewDefaultCluster(namespace)
defaultCluster.WithDefaults()
pravega, err := pravega_e2eutil.CreateCluster(t, f, ctx, defaultCluster)
Expand Down Expand Up @@ -81,7 +85,4 @@ func testScaleCluster(t *testing.T) {
err = pravega_e2eutil.WaitForClusterToTerminate(t, f, ctx, pravega)
g.Expect(err).NotTo(HaveOccurred())

// A workaround for issue 93
err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace)
g.Expect(err).NotTo(HaveOccurred())
}
Loading