Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
moondev committed Apr 3, 2017
1 parent 6613ccf commit fa53fdf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 42 deletions.
27 changes: 6 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,8 @@
# Kubernetes white paper for Linux.com
# Kubernetes ci/cd whitepaper for Linux.com

## Get started
Requirements
* nodejs
* kubectl
* virtualbox
* minikube
* At least 4GB of available memory, 8GB for part 5
This readme is dynamically generated when the interactive tutorial is run## Interactive tutorial version

```
git clone [email protected]:kenzanlabs/kubernetes-ci-cd.git; cd kubernetes-ci-cd
npm install
```

## Interactive tutorial

```
npm start
```

## Manual tutorial
* clone this repo
* Ensure you are starting with a clean slate: `minikube delete; minikube rm -rf ~/.minikube; rm -rf ~/.kube`
* run `npm install`
Begin the tutorial `npm start`## Part 1
17 changes: 12 additions & 5 deletions start.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ var config = {
var fs = require('fs');

var markdown = "# Kubernetes ci/cd whitepaper for Linux.com\n\n This readme is dynamically generated when the interactive tutorial is run";
markdown = markdown + "## Interactive tutorial version\n\n"
markdown = markdown + "* clone this repo\n"
markdown = markdown + "* Ensure you are starting with a clean slate: `minikube delete; minikube rm -rf ~/.minikube; rm -rf ~/.kube`\n"
markdown = markdown + "* run `npm install`\n"
markdown = markdown + "Begin the tutorial `npm start`"
markdown = markdown + "\n\n## Interactive tutorial version"
markdown = markdown + "\n* clone this repo\n"
markdown = markdown + "\n* Ensure you are starting with a clean slate: `minikube delete; minikube rm -rf ~/.minikube; rm -rf ~/.kube`\n"
markdown = markdown + "\n* run `npm install`\n"
markdown = markdown + "\nBegin the tutorial `npm start`"
markdown = markdown + "\n\n## Manual tutorial version"


var prompts = new Rx.Subject();

Expand Down Expand Up @@ -65,13 +67,18 @@ YAML.load('steps.yml', function(docs)
parts.forEach(function (item) {
markdown = markdown + "## " + item.name + "\n"
var part = item.name;
markdown = markdown + "\n\n### " + item.name
var stepNum = 0;
var stepList = item.steps;

// console.log(item.steps);
stepList.forEach(function (step) {
stepNum++;
commands.push(step.com)
markdown = markdown + "\n\n### Step" + stepNum
markdown = markdown + "\n\n" + step.cap
markdown = markdown + "\n\n`" + step.com + "`"

prompts.onNext({type: 'confirm',name: stepIndex, message: "\n \n \n" + part + " Step: " + stepNum + "\n" + step.cap + "\n \n" + step.com + "\n \nPress enter to the run the above command for the step.", default: true});
stepIndex++;
})
Expand Down
31 changes: 15 additions & 16 deletions steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parts:
com: minikube addons enable heapster; minikube addons enable ingress

- cap: View minikube dashboard
com: minikube dashboard
com: minikube service kubernetes-dashboard --namespace kube-system

- cap: Deploy the public nginx image from DockerHub
com: kubectl run nginx --image nginx --port 80
Expand All @@ -28,27 +28,26 @@ parts:
- cap: Wait for registry to deploy
com: kubectl rollout status deployments/registry

# - cap: View registry UI
# com: minikube service registry
- cap: View registry UI
com: minikube service registry-ui

# - cap: Edit the contents of applications/hello-kenzan/index.html
# com: nano applications/hello-kenzan/index.html
- cap: Edit the contents of applications/hello-kenzan/index.html
com: nano applications/hello-kenzan/index.html

# - cap: We will now build the image with a special name that is pointing at our cluster registry.
# com: docker build -t 127.0.0.1:30400/hello-kenzan:latest -f applications/hello-kenzan/Dockerfile applications/hello-kenzan
- cap: We will now build the image with a special name that is pointing at our cluster registry.
com: docker build -t 127.0.0.1:30400/hello-kenzan:latest -f applications/hello-kenzan/Dockerfile applications/hello-kenzan

- cap: Before we can push our image we need to set up a temporary proxy. This is a container that listens on 127.0.0..1:30400 and forwads to our cluster. By default the docker client can only push to non https via localhost.
com: docker run -d -e "REGIP=192.168.99.100" --name socat-registry -p 30400:5000 chadmoon/socat:latest bash -c "socat TCP4-LISTEN:5000,fork,reuseaddr TCP4:192.168.99.100:30400"

# - cap: Before we can push our image we need to set up a temporary proxy. This is a container that listens on 127.0.0..1:30400 and forwads to our cluster. By default the docker client can only push to non https via localhost.
# com: docker run -d -e "REGIP=$(minikube ip)" --name socat-registry -p 30400:5000 chadmoon/socat:latest bash -c "socat TCP4-LISTEN:5000,fork,reuseaddr TCP4:$REGIP:30400"
- cap: We can now push our image.
com: docker push 127.0.0.1:30400/hello-kenzan:latest

# - cap: We can now push our image.
# com: docker push 127.0.0.1:30400/hello-kenzan:latest
- cap: Now that our image is on the cluster we can deploy the manifests
com: kubectl apply -f applications/hello-kenzan/k8s/deployment.yml

# - cap: Now that our image is on the cluster we can deploy the manifests
# com: kubectl apply -f applications/hello-kenzan/k8s/deployment.yml

# - cap: View the app
# com: minikube service hello-kenzan
- cap: View the app
com: minikube service hello-kenzan

# - name: Part 2
# intro: In this part we will Setup Jenkins, for the repo and setup an automated Jenkins job build, push and deploy our custom appliction.
Expand Down

0 comments on commit fa53fdf

Please sign in to comment.