Update docs

This commit is contained in:
Tomasz Sęk 2019-01-11 11:50:53 +01:00
parent aff974b466
commit 3f5b14640c
No known key found for this signature in database
GPG Key ID: DC356D23F6A644D0
4 changed files with 26 additions and 14 deletions

View File

@ -4,7 +4,7 @@ metadata:
name: example name: example
spec: spec:
master: master:
image: jenkins/jenkins image: jenkins/jenkins:lts
seedJobs: seedJobs:
- id: jenkins-operator - id: jenkins-operator
targets: "cicd/jobs/*.jenkins" targets: "cicd/jobs/*.jenkins"

View File

@ -48,12 +48,13 @@ make test
Run e2e tests with minikube: Run e2e tests with minikube:
```bash ```bash
make minikube-run make start-minikube
eval $(minikube docker-env)
make docker-build-e2e make docker-build-e2e
make e2e E2E_IMAGE=jenkins-operator make e2e E2E_IMAGE=jenkins-operator
``` ```
## Hacks ## Tips & Tricks
### Building docker image on minikube (for e2e tests) ### 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) eval $(minikube docker-env)
``` ```
### `pkg/apis/virtuslab/v1alpha1/jenkins_types` has changed ### When `pkg/apis/virtuslab/v1alpha1/jenkins_types.go` has changed
Run: Run:
@ -75,6 +76,7 @@ make deepcopy-gen
```bash ```bash
minikube service jenkins-operator-example --url 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 kubectl get secret jenkins-operator-credentials-example -o 'jsonpath={.data.password}' | base64 -d
``` ```

View File

@ -45,6 +45,7 @@ kubectl get pods -w
Get Jenkins credentials: Get Jenkins credentials:
```bash ```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 kubectl get secret jenkins-operator-credentials-example -o 'jsonpath={.data.password}' | base64 -d
``` ```
@ -53,20 +54,20 @@ Connect to Jenkins (minikube):
```bash ```bash
minikube service jenkins-operator-example --url minikube service jenkins-operator-example --url
``` ```
Pick up the first URL.
Connect to Jenkins (actual Kubernetes cluster): Connect to Jenkins (actual Kubernetes cluster):
```bash ```bash
kubectl describe svc jenkins-operator-example 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) ![jenkins](../assets/jenkins.png)
## Configure Seed Jobs and Pipelines ## 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. and deploy keys.
## Prepare job definitions and pipelines ## Prepare job definitions and pipelines
@ -323,6 +324,13 @@ Not implemented yet.
## Debugging ## 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: Watch Kubernetes events:
```bash ```bash

View File

@ -14,23 +14,25 @@ To run **jenkins-operator**, you will need:
Install Jenkins Custom Resource Definition: Install Jenkins Custom Resource Definition:
```bash ```bash
kubectl create -f deploy/crds/virtuslab_v1alpha1_jenkins_crd.yaml kubectl apply -f deploy/crds/virtuslab_v1alpha1_jenkins_crd.yaml
``` ```
## Deploy jenkins-operator ## Deploy jenkins-operator
Create Service Account and RBAC roles: apply Service Account and RBAC roles:
```bash ```bash
kubectl create -f deploy/service_account.yaml kubectl apply -f deploy/service_account.yaml
kubectl create -f deploy/role.yaml kubectl apply -f deploy/role.yaml
kubectl create -f deploy/role_binding.yaml kubectl apply -f deploy/role_binding.yaml
``` ```
Update container image to **virtuslab/jenkins-operator:<version>** in `deploy/operator.yaml` and deploy **jenkins-operator**: Update container image to **virtuslab/jenkins-operator:<version>** in `deploy/operator.yaml` and deploy **jenkins-operator**:
```bash ```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: Watch **jenkins-operator** instance being created: