Skip to content
This repository was archived by the owner on Aug 14, 2021. It is now read-only.

Commit 0eb8ef0

Browse files
author
Amit Kumar Das
authored
Merge pull request #32 from kmova/release
Setup minikube ci and remove the hard-coding for maya-apiserver-service.
2 parents 07fdd43 + 573f7ba commit 0eb8ef0

File tree

7 files changed

+119
-4
lines changed

7 files changed

+119
-4
lines changed

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
11
language: go
2+
env:
3+
- CHANGE_MINIKUBE_NONE_USER=true
24
go:
35
- 1.8.3
46
services: docker
57

68
install: true
79

10+
before_script:
11+
# Download kubectl, which is a requirement for using minikube.
12+
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.7.5/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
13+
# Download minikube.
14+
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
15+
- sudo minikube start --vm-driver=none --kubernetes-version=v1.7.5
16+
# Fix the kubectl context, as it's often stale.
17+
- minikube update-context
18+
# Wait for Kubernetes to be up and ready.
19+
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
20+
# Download and initialize helm.
21+
- ./openebs/ci/ubuntu-compile-nsenter.sh && sudo cp .tmp/util-linux-2.30.2/nsenter /usr/bin
22+
- curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
23+
- chmod 700 get_helm.sh
24+
- ./get_helm.sh
25+
- helm init
26+
827
script:
928
- ./openebs-build.sh
29+
# Verify that minkube is setup
30+
- kubectl cluster-info
31+
- kubectl get deployment
32+
- ./openebs-ci.sh
1033

1134
after_success:
1235
- ./openebs-deploy.sh

openebs-build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
SRC_REPO="$GOPATH/src/github.com/openebs"
17+
SRC_REPO=`pwd`
1818
DST_REPO="$GOPATH/src/github.com/kubernetes-incubator"
1919

2020
mkdir -p $DST_REPO
21-
cp -R $SRC_REPO/external-storage $DST_REPO
21+
cp -R $SRC_REPO/../external-storage $DST_REPO
2222
cd $DST_REPO/external-storage
2323
make openebs
2424

openebs-ci.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# Copyright 2017 The OpenEBS Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
DST_REPO="$GOPATH/src/github.com/kubernetes-incubator"
18+
export DST_REPO
19+
20+
export DIMAGE="openebs/openebs-k8s-provisioner"
21+
cd $DST_REPO/external-storage/
22+
make push-openebs-provisioner
23+
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
24+
25+
$DST_REPO/external-storage/openebs/ci/travis-ci.sh
26+
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
27+

openebs/ci/helm_install_openebs.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
kubectl -n kube-system create sa tiller
4+
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
5+
kubectl -n kube-system patch deploy/tiller-deploy -p '{"spec": {"template": {"spec": {"serviceAccountName": "tiller"}}}}'
6+
7+
#Replace this with logic to wait till helm is initialized
8+
sleep 30
9+
kubectl get pods --all-namespaces
10+
11+
helm repo add openebs-charts https://openebs.github.io/charts/
12+
helm repo update
13+
helm install openebs-charts/openebs --set apiserver.imageTag="0.5.2",apiserver.replicas="1",provisioner.imageTag="ci",provisioner.replicas="1",jiva.replicas="1",rbacEnable="false"
14+
15+
#Replace this with logic to wait/verify openebs control plane is initialized
16+
sleep 30
17+
kubectl get pods --all-namespaces -o yaml
18+
kubectl get svc --all-namespaces -o yaml

openebs/ci/travis-ci.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Copyright 2017 The OpenEBS Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
$DST_REPO/external-storage/openebs/ci/helm_install_openebs.sh
18+
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env sh
2+
#
3+
# Copyright 2017 The Jaeger Authors
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
# in compliance with the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software distributed under the License
11+
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
# or implied. See the License for the specific language governing permissions and limitations under
13+
# the License.
14+
#
15+
16+
set -e
17+
18+
sudo apt-get update
19+
sudo apt-get install libncurses5-dev libslang2-dev gettext zlib1g-dev libselinux1-dev debhelper lsb-release pkg-config po-debconf autoconf automake autopoint libtool
20+
mkdir .tmp || true
21+
wget https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-2.30.2.tar.gz -qO - | tar -xz -C .tmp/
22+
cd .tmp/util-linux-2.30.2 && ./autogen.sh && ./configure && make nsenter
23+

openebs/pkg/v1/maya_api.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,16 @@ func (v OpenEBSVolume) GetMayaClusterIP(client kubernetes.Interface) (string, er
6161
}
6262

6363
glog.Info("OpenEBS volume provisioner namespace ", namespace)
64+
6465
//Fetch the Maya ClusterIP using the Maya API Server Service
65-
sc, err := client.CoreV1().Services(namespace).Get("maya-apiserver-service", metav1.GetOptions{})
66+
mayaAPIServiceName := os.Getenv("OPENEBS_MAYA_SERVICE_NAME")
67+
if mayaAPIServiceName == "" {
68+
mayaAPIServiceName = "maya-apiserver-service"
69+
}
70+
71+
sc, err := client.CoreV1().Services(namespace).Get(mayaAPIServiceName, metav1.GetOptions{})
6672
if err != nil {
67-
glog.Errorf("Error getting maya-apiserver IP Address: %v", err)
73+
glog.Errorf("Error getting IP Address for service - %s : %v", mayaAPIServiceName, err)
6874
}
6975

7076
clusterIP = sc.Spec.ClusterIP

0 commit comments

Comments
 (0)