Fix Developer Guide

This commit is contained in:
Tomasz Sęk 2020-04-13 13:09:39 +02:00
parent 931027a4b0
commit f9dd297710
No known key found for this signature in database
GPG Key ID: DC356D23F6A644D0
2 changed files with 7 additions and 11 deletions

View File

@ -577,7 +577,7 @@
<h2 id="prerequisites">Prerequisites</h2> <h2 id="prerequisites">Prerequisites</h2>
<ul> <ul>
<li><a href="https://github.com/operator-framework/operator-sdk" target="_blank">operator_sdk</a> version v0.10.0</li> <li><a href="https://github.com/operator-framework/operator-sdk" target="_blank">operator_sdk</a> version v0.15.1</li>
<li><a href="https://git-scm.com/downloads" target="_blank">git</a></li> <li><a href="https://git-scm.com/downloads" target="_blank">git</a></li>
<li><a href="https://golang.org/dl/" target="_blank">go</a> version v1.13+</li> <li><a href="https://golang.org/dl/" target="_blank">go</a> version v1.13+</li>
<li><a href="https://jenkinsci.github.io/kubernetes-operator/docs/developer-guide/tools/" target="_blank">goimports, golint, checkmake and staticcheck</a></li> <li><a href="https://jenkinsci.github.io/kubernetes-operator/docs/developer-guide/tools/" target="_blank">goimports, golint, checkmake and staticcheck</a></li>
@ -586,15 +586,13 @@
</ul> </ul>
<h2 id="clone-repository-and-download-dependencies">Clone repository and download dependencies</h2> <h2 id="clone-repository-and-download-dependencies">Clone repository and download dependencies</h2>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">mkdir -p <span style="color:#000">$GOPATH</span>/src/github.com/jenkinsci <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">git clone git@github.com:jenkinsci/kubernetes-operator.git
<span style="color:#204a87">cd</span> <span style="color:#000">$GOPATH</span>/src/github.com/jenkinsci/
git clone git@github.com:jenkinsci/kubernetes-operator.git
<span style="color:#204a87">cd</span> kubernetes-operator <span style="color:#204a87">cd</span> kubernetes-operator
make go-dependencies</code></pre></div> make go-dependencies</code></pre></div>
<h2 id="build-and-run-with-a-minikube">Build and run with a minikube</h2> <h2 id="build-and-run-with-a-minikube">Build and run with a minikube</h2>
<p>Build and run <strong>Jenkins Operator</strong> locally:</p> <p>Build and run <strong>Jenkins Operator</strong> locally:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">make build minikube-run <span style="color:#000">EXTRA_ARGS</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">&#39;--minikube --local&#39;</span></code></pre></div> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">make build minikube-run</code></pre></div>
<p>Once minikube and <strong>Jenkins Operator</strong> are up and running, apply Jenkins custom resource:</p> <p>Once minikube and <strong>Jenkins Operator</strong> are up and running, apply Jenkins custom resource:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml
kubectl get jenkins -o yaml kubectl get jenkins -o yaml
@ -603,7 +601,7 @@ kubectl get po</code></pre></div>
<p>You can also run the controller locally and make it listen to a remote Kubernetes server.</p> <p>You can also run the controller locally and make it listen to a remote Kubernetes server.</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">make run <span style="color:#000">NAMESPACE</span><span style="color:#ce5c00;font-weight:bold">=</span>default <span style="color:#000">KUBECTL_CONTEXT</span><span style="color:#ce5c00;font-weight:bold">=</span>remote-k8s <span style="color:#000">EXTRA_ARGS</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">&#39;--kubeconfig ~/.kube/config&#39;</span></code></pre></div> <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">make run <span style="color:#000">NAMESPACE</span><span style="color:#ce5c00;font-weight:bold">=</span>default <span style="color:#000">KUBECTL_CONTEXT</span><span style="color:#ce5c00;font-weight:bold">=</span>remote-k8s <span style="color:#000">EXTRA_ARGS</span><span style="color:#ce5c00;font-weight:bold">=</span><span style="color:#4e9a06">&#39;--kubeconfig ~/.kube/config&#39;</span></code></pre></div>
<p>Once minikube and <strong>Jenkins Operator</strong> are up and running, apply Jenkins custom resource:</p> <p>Once <strong>Jenkins Operator</strong> are up and running, apply Jenkins custom resource:</p>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --context remote-k8s --namespace default apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml <div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">kubectl --context remote-k8s --namespace default apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml
kubectl --context remote-k8s --namespace default get jenkins -o yaml kubectl --context remote-k8s --namespace default get jenkins -o yaml
kubectl --context remote-k8s --namespace default get po</code></pre></div> kubectl --context remote-k8s --namespace default get po</code></pre></div>

View File

@ -13,7 +13,7 @@ This document explains how to setup your development environment.
## Prerequisites ## Prerequisites
- [operator_sdk][operator_sdk] version v0.10.0 - [operator_sdk][operator_sdk] version v0.15.1
- [git][git_tool] - [git][git_tool]
- [go][go_tool] version v1.13+ - [go][go_tool] version v1.13+
- [goimports, golint, checkmake and staticcheck][install_dev_tools] - [goimports, golint, checkmake and staticcheck][install_dev_tools]
@ -23,8 +23,6 @@ This document explains how to setup your development environment.
## Clone repository and download dependencies ## Clone repository and download dependencies
```bash ```bash
mkdir -p $GOPATH/src/github.com/jenkinsci
cd $GOPATH/src/github.com/jenkinsci/
git clone git@github.com:jenkinsci/kubernetes-operator.git git clone git@github.com:jenkinsci/kubernetes-operator.git
cd kubernetes-operator cd kubernetes-operator
make go-dependencies make go-dependencies
@ -35,7 +33,7 @@ make go-dependencies
Build and run **Jenkins Operator** locally: Build and run **Jenkins Operator** locally:
```bash ```bash
make build minikube-run EXTRA_ARGS='--minikube --local' make build minikube-run
``` ```
Once minikube and **Jenkins Operator** are up and running, apply Jenkins custom resource: Once minikube and **Jenkins Operator** are up and running, apply Jenkins custom resource:
@ -54,7 +52,7 @@ You can also run the controller locally and make it listen to a remote Kubernete
make run NAMESPACE=default KUBECTL_CONTEXT=remote-k8s EXTRA_ARGS='--kubeconfig ~/.kube/config' make run NAMESPACE=default KUBECTL_CONTEXT=remote-k8s EXTRA_ARGS='--kubeconfig ~/.kube/config'
``` ```
Once minikube and **Jenkins Operator** are up and running, apply Jenkins custom resource: Once **Jenkins Operator** are up and running, apply Jenkins custom resource:
```bash ```bash
kubectl --context remote-k8s --namespace default apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml kubectl --context remote-k8s --namespace default apply -f deploy/crds/jenkins_v1alpha2_jenkins_cr.yaml