From 9cbe822f817f7856090b3ed0994a4bcc9aa1927b Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Tue, 2 Apr 2019 09:59:57 +0000 Subject: [PATCH] Add Readme and deploy roles --- README.md | 86 +++++++- ansible/group_vars/all.yaml | 25 ++- ansible/roles/create_config/tasks/main.yaml | 53 ++++- ansible/roles/deploy/defaults/main.yaml | 1 + ansible/roles/deploy/tasks/main.yaml | 229 ++++++++++++++++++++ ansible/roles/deploy_zk/tasks/main.yaml | 14 ++ ansible/roles/get_status/tasks/main.yaml | 8 +- ansible/zuul.yaml | 6 + build/Dockerfile | 4 +- deploy/crds/zuul-ci_v1alpha1_zuul_cr.yaml | 4 + deploy/{role.yaml => rbac.yaml} | 35 +++ deploy/role_binding.yaml | 12 + deploy/service_account.yaml | 4 - 13 files changed, 463 insertions(+), 18 deletions(-) create mode 100644 ansible/roles/deploy/defaults/main.yaml create mode 100644 ansible/roles/deploy/tasks/main.yaml create mode 100644 ansible/roles/deploy_zk/tasks/main.yaml rename deploy/{role.yaml => rbac.yaml} (56%) delete mode 100644 deploy/service_account.yaml diff --git a/README.md b/README.md index ce46686..6ee6d16 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,86 @@ -# zuul-operator A Zuul Operator PoC +======= + +## Requirements: + +* [OKD](https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz) +* [SDK](https://github.com/operator-framework/operator-sdk#quick-start) +* [Zookeeper Operator](https://github.com/pravega/zookeeper-operator#install-the-operator) + +## Prepare cluster + +```shell +sudo -i oc cluster up +sudo chown root:fedora /var/run/docker.sock + +oc login -u developer -p dev +docker login -u developer -p $(oc whoami -t) $(oc registry info) + +# Log as admin to install crd +sudo cat /root/.kube/config > ~/.kube/config +oc login -u system:admin +oc project default +``` + +## Install Zookeeper Operator + +Perhaps this should be part of the zuul operator + +```shell +oc create -f https://raw.githubusercontent.com/pravega/zookeeper-operator/master/deploy/crds/zookeeper_v1beta1_zookeepercluster_crd.yaml +oc create -f https://raw.githubusercontent.com/pravega/zookeeper-operator/master/deploy/default_ns/rbac.yaml +oc create -f https://raw.githubusercontent.com/pravega/zookeeper-operator/master/deploy/default_ns/operator.yaml +``` + + +## Install Zuul Operator + +```shell +operator-sdk build 172.30.1.1:5000/myproject/zuul-operator:latest +docker push 172.30.1.1:5000/myproject/zuul-operator:latest + +oc create -f deploy/crds/zuul-ci_v1alpha1_zuul_crd.yaml +oc create -f deploy/rbac.yaml +oc create -f deploy/operator.yaml +``` + +Look for operator pod and check it's output + +```shell +$ oc get pods +NAME READY STATUS RESTARTS AGE +zuul-operator-c64756f66-rbdmg 2/2 Running 0 3s +$ oc logs zuul-operator-c64756f66-rbdmg -c operator +... +{"level":"info","ts":1554197305.5853095,"logger":"cmd","msg":"Go Version: go1.10.3"} +{"level":"info","ts":1554197305.5854425,"logger":"cmd","msg":"Go OS/Arch: linux/amd64"} +{"level":"info","ts":1554197305.5854564,"logger":"cmd","msg":"Version of operator-sdk: v0.6.0"} +{"level":"info","ts":1554197305.5855,"logger":"cmd","msg":"Watching namespace.","Namespace":"default"} +... +``` + + +## Usage + +``` +$ oc apply -f - <