From 3f5b14640c210c7947bf0160a22280f1ef899dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20S=C4=99k?= Date: Fri, 11 Jan 2019 11:50:53 +0100 Subject: [PATCH] Update docs --- deploy/crds/virtuslab_v1alpha1_jenkins_cr.yaml | 2 +- docs/developer-guide.md | 8 +++++--- docs/getting-started.md | 16 ++++++++++++---- docs/installation.md | 14 ++++++++------ 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/deploy/crds/virtuslab_v1alpha1_jenkins_cr.yaml b/deploy/crds/virtuslab_v1alpha1_jenkins_cr.yaml index e135937d..6672061d 100644 --- a/deploy/crds/virtuslab_v1alpha1_jenkins_cr.yaml +++ b/deploy/crds/virtuslab_v1alpha1_jenkins_cr.yaml @@ -4,7 +4,7 @@ metadata: name: example spec: master: - image: jenkins/jenkins + image: jenkins/jenkins:lts seedJobs: - id: jenkins-operator targets: "cicd/jobs/*.jenkins" diff --git a/docs/developer-guide.md b/docs/developer-guide.md index 082f7b22..d5c6291c 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -48,12 +48,13 @@ make test Run e2e tests with minikube: ```bash -make minikube-run +make start-minikube +eval $(minikube docker-env) make docker-build-e2e make e2e E2E_IMAGE=jenkins-operator ``` -## Hacks +## Tips & Tricks ### Building docker image on minikube (for e2e tests) @@ -63,7 +64,7 @@ To be able to work with the docker daemon on `minikube` machine run the followin eval $(minikube docker-env) ``` -### `pkg/apis/virtuslab/v1alpha1/jenkins_types` has changed +### When `pkg/apis/virtuslab/v1alpha1/jenkins_types.go` has changed Run: @@ -75,6 +76,7 @@ make deepcopy-gen ```bash minikube service jenkins-operator-example --url +kubectl get secret jenkins-operator-credentials-example -o 'jsonpath={.data.user}' | base64 -d kubectl get secret jenkins-operator-credentials-example -o 'jsonpath={.data.password}' | base64 -d ``` diff --git a/docs/getting-started.md b/docs/getting-started.md index c123d5f6..c5330dd1 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -45,6 +45,7 @@ kubectl get pods -w Get Jenkins credentials: ```bash +kubectl get secret jenkins-operator-credentials-example -o 'jsonpath={.data.user}' | base64 -d kubectl get secret jenkins-operator-credentials-example -o 'jsonpath={.data.password}' | base64 -d ``` @@ -53,20 +54,20 @@ Connect to Jenkins (minikube): ```bash minikube service jenkins-operator-example --url ``` +Pick up the first URL. Connect to Jenkins (actual Kubernetes cluster): ```bash kubectl describe svc jenkins-operator-example -kubectl jenkins-operator-example 8080:8080 - +kubectl port-forward jenkins-operator-example 8080:8080 ``` - +Then open browser with address http://localhost:8080. ![jenkins](../assets/jenkins.png) ## Configure Seed Jobs and Pipelines -Jenkins operator uses [job-dsl][job-dsl] and [ssh-credentials][ssh-credentials] plugins for configuring seed jobs +Jenkins operator uses [job-dsl][job-dsl] and [ssh-credentials][ssh-credentials] plugins for configuring jobs and deploy keys. ## Prepare job definitions and pipelines @@ -323,6 +324,13 @@ Not implemented yet. ## Debugging +Turn on debug in **jenkins-operator** deployment: + +```bash +sed -i 's|REPLACE_ARGS|args: ["--debug"]|g' deploy/operator.yaml +kubectl apply -f deploy/operator.yaml +``` + Watch Kubernetes events: ```bash diff --git a/docs/installation.md b/docs/installation.md index 31d7f237..be0b967a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -14,23 +14,25 @@ To run **jenkins-operator**, you will need: Install Jenkins Custom Resource Definition: ```bash -kubectl create -f deploy/crds/virtuslab_v1alpha1_jenkins_crd.yaml +kubectl apply -f deploy/crds/virtuslab_v1alpha1_jenkins_crd.yaml ``` ## Deploy jenkins-operator -Create Service Account and RBAC roles: +apply Service Account and RBAC roles: ```bash -kubectl create -f deploy/service_account.yaml -kubectl create -f deploy/role.yaml -kubectl create -f deploy/role_binding.yaml +kubectl apply -f deploy/service_account.yaml +kubectl apply -f deploy/role.yaml +kubectl apply -f deploy/role_binding.yaml ``` Update container image to **virtuslab/jenkins-operator:** in `deploy/operator.yaml` and deploy **jenkins-operator**: ```bash -kubectl create -f deploy/operator.yaml +sed -i 's|REPLACE_IMAGE|image: virtuslab/jenkins-operator:latest|g' deploy/operator.yaml +sed -i 's|REPLACE_ARGS||g' deploy/operator.yaml +kubectl apply -f deploy/operator.yaml ``` Watch **jenkins-operator** instance being created: