├── applications ├── puzzle │ ├── .eslintignore │ ├── .dockerignore │ ├── .eslintrc │ ├── .yo-rc.json │ ├── up.sh │ ├── down.sh │ ├── server │ │ ├── component-config.json │ │ ├── boot │ │ │ ├── authentication.js │ │ │ ├── root.js │ │ │ ├── create-sample-models.js │ │ │ └── puzzle.json │ │ ├── middleware.development.json │ │ ├── datasources.json │ │ ├── config.json │ │ ├── server.js │ │ ├── middleware.json │ │ └── model-config.json │ ├── docker-compose.yml │ ├── .gitignore │ ├── .editorconfig │ ├── Dockerfile │ ├── README.md │ ├── Jenkinsfile │ ├── package.json │ ├── k8s │ │ └── deployment.yaml │ └── common │ │ └── models │ │ ├── crossword.json │ │ └── crossword.js ├── monitor-scale │ ├── .gitignore │ ├── Dockerfile │ ├── README.md │ ├── Jenkinsfile │ ├── package.json │ ├── k8s │ │ └── deployment.yaml │ └── index.js ├── kr8sswordz-pages │ ├── .dockerignore │ ├── src │ │ ├── styles │ │ │ ├── templates │ │ │ │ ├── _templates.scss │ │ │ │ └── _home-page.scss │ │ │ ├── atoms │ │ │ │ ├── _atoms.scss │ │ │ │ ├── _db-image.scss │ │ │ │ ├── _buttons.scss │ │ │ │ └── _slider.scss │ │ │ ├── organisms │ │ │ │ ├── _puzzle-container.scss │ │ │ │ ├── _organisms.scss │ │ │ │ ├── instance-grid.scss │ │ │ │ └── _header.scss │ │ │ ├── molecules │ │ │ │ ├── _superscript-number.scss │ │ │ │ ├── _molecules.scss │ │ │ │ ├── _button-row.scss │ │ │ │ ├── _image-column.scss │ │ │ │ ├── _slider-container.scss │ │ │ │ ├── _data-flow-arrow.scss │ │ │ │ ├── _cell.scss │ │ │ │ ├── _puzzle.scss │ │ │ │ ├── _instance-box.scss │ │ │ │ └── _loader.scss │ │ │ └── utils │ │ │ │ ├── _utils.scss │ │ │ │ ├── _variables.scss │ │ │ │ ├── _typography.scss │ │ │ │ └── _normalize.scss │ │ ├── constants.js │ │ ├── assets │ │ │ ├── arrow.png │ │ │ ├── etcd.png │ │ │ ├── mongo.png │ │ │ ├── arrow-blue.png │ │ │ ├── etcd-logo.png │ │ │ ├── logo-reg-2x.png │ │ │ ├── MongoDB-logo.png │ │ │ ├── arrow-reverse.png │ │ │ ├── arrow-blue-reverse.png │ │ │ ├── fonts │ │ │ │ ├── Roboto-Bold-webfont.eot │ │ │ │ ├── Roboto-Bold-webfont.ttf │ │ │ │ ├── Roboto-Bold-webfont.woff │ │ │ │ ├── Roboto-Light-webfont.eot │ │ │ │ ├── Roboto-Light-webfont.ttf │ │ │ │ ├── Roboto-Italic-webfont.eot │ │ │ │ ├── Roboto-Italic-webfont.ttf │ │ │ │ ├── Roboto-Italic-webfont.woff │ │ │ │ ├── Roboto-Light-webfont.woff │ │ │ │ ├── Roboto-Regular-webfont.eot │ │ │ │ ├── Roboto-Regular-webfont.ttf │ │ │ │ ├── Roboto-BoldItalic-webfont.eot │ │ │ │ ├── Roboto-BoldItalic-webfont.ttf │ │ │ │ ├── Roboto-Regular-webfont.woff │ │ │ │ ├── Roboto-BoldItalic-webfont.woff │ │ │ │ ├── Roboto-LightItalic-webfont.eot │ │ │ │ ├── Roboto-LightItalic-webfont.ttf │ │ │ │ └── Roboto-LightItalic-webfont.woff │ │ │ ├── arrow.svg │ │ │ └── database.svg │ │ ├── components │ │ │ ├── home │ │ │ │ ├── instanceConfig.js │ │ │ │ ├── Database.js │ │ │ │ ├── DataFlowArrow.js │ │ │ │ ├── HomePage.js │ │ │ │ ├── InstancesComponent.js │ │ │ │ └── PuzzleComponent.js │ │ │ ├── shared │ │ │ │ ├── Loader.js │ │ │ │ ├── Header.js │ │ │ │ ├── Cell.js │ │ │ │ └── Slider.js │ │ │ ├── App.js │ │ │ └── instance-grid │ │ │ │ └── InstanceGrid.js │ │ ├── reducers │ │ │ ├── index.js │ │ │ ├── puzzleReducer.js │ │ │ └── websocketReducer.js │ │ ├── routes.js │ │ ├── store │ │ │ └── configureStore.js │ │ ├── index.html │ │ ├── index.js │ │ ├── actions │ │ │ ├── actionTypes.js │ │ │ ├── webSocketActions.js │ │ │ └── puzzleActions.js │ │ └── style.scss │ ├── .gitignore │ ├── favicon.ico │ ├── favicon.png │ ├── Dockerfile │ ├── .eslintrc │ ├── test │ │ └── helpers │ │ │ └── setup-browser-env.js │ ├── README.md │ ├── Jenkinsfile │ ├── webpack.config.js │ ├── styleguide-config.js │ ├── k8s │ │ └── deployment.yaml │ ├── gulpfile.js │ └── package.json ├── socat │ ├── entrypoint.sh │ └── Dockerfile ├── hello-kenzan │ ├── DockerFileEx.jpg │ ├── Dockerfile │ ├── index.html │ ├── Jenkinsfile │ └── k8s │ │ ├── deployment.yaml │ │ └── manual-deployment.yaml ├── spinnaker-helm │ ├── spinnaker-chart │ │ ├── Chart.yaml │ │ ├── static │ │ │ ├── kube.config │ │ │ ├── front50.yml │ │ │ ├── orca.yml │ │ │ ├── igor.yml │ │ │ ├── run-apache2.sh │ │ │ ├── echo.yml │ │ │ ├── clouddriver.yml │ │ │ ├── settings-old.js │ │ │ ├── settings.js │ │ │ └── gate.yml │ │ ├── templates │ │ │ ├── config.yml │ │ │ ├── NOTES.txt │ │ │ ├── _helpers.tpl │ │ │ ├── redis.yaml │ │ │ ├── echo.yml │ │ │ ├── gate.yml │ │ │ ├── igor.yml │ │ │ ├── orca.yml │ │ │ ├── front50.yaml │ │ │ ├── deck.yml │ │ │ └── clouddriver.yml │ │ ├── .helmignore │ │ └── values.yaml │ ├── start.sh │ └── README.md └── jenkins │ ├── Dockerfile │ └── plugins.txt ├── .gitignore ├── manifests ├── etcd-service.yaml ├── etcd-cluster.yaml ├── all-services.yaml ├── monitor-scale-serviceaccount.yaml ├── registry.yaml └── jenkins.yaml ├── scripts ├── etcd.sh ├── puzzle.sh ├── kr8sswordz-pages.sh ├── etcd-crd.sh ├── monitor-scale.sh └── kubescale.sh ├── Jenkinsfile ├── package.json ├── start.js ├── readme.js ├── part4.yml ├── part1.yml ├── part2.yml ├── part3.yml └── LICENSE.md /applications/puzzle/.eslintignore: -------------------------------------------------------------------------------- 1 | /client/ -------------------------------------------------------------------------------- /applications/monitor-scale/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /applications/puzzle/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | -------------------------------------------------------------------------------- /applications/puzzle/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "loopback" 3 | } -------------------------------------------------------------------------------- /applications/puzzle/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-loopback": {} 3 | } -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .idea 3 | *.log 4 | dist -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/styles/templates/_templates.scss: -------------------------------------------------------------------------------- 1 | @import './home-page'; 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode 3 | .idea 4 | node_modules 5 | node_modules/ 6 | node_modules/* -------------------------------------------------------------------------------- /applications/socat/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | socat TCP4-LISTEN:5000,fork,reuseaddr TCP4:$REG_IP:$REG_PORT 4 | -------------------------------------------------------------------------------- /applications/puzzle/up.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | HOSTNAME=`hostname` 3 | curl "http://monitor-scale:3001/up/$HOSTNAME" 4 | -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.log 4 | db.json 5 | .idea/ 6 | .idea 7 | /styleguide 8 | -------------------------------------------------------------------------------- /applications/puzzle/down.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | HOSTNAME=`hostname` 3 | curl "http://monitor-scale:3001/down/$HOSTNAME" 4 | -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/styles/atoms/_atoms.scss: -------------------------------------------------------------------------------- 1 | @import './buttons'; 2 | @import './slider'; 3 | @import './db-image'; 4 | -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/favicon.ico -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/favicon.png -------------------------------------------------------------------------------- /applications/puzzle/server/component-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "loopback-component-explorer": { 3 | "mountPath": "/explorer" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /applications/hello-kenzan/DockerFileEx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/hello-kenzan/DockerFileEx.jpg -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/constants.js: -------------------------------------------------------------------------------- 1 | const constants = { 2 | minikubeIp: '192.168.56.100' 3 | }; 4 | 5 | export default constants; 6 | -------------------------------------------------------------------------------- /applications/spinnaker-helm/spinnaker-chart/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: Spinnaker Helm Chart 3 | name: spinnaker 4 | version: 0.1.0 5 | -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/styles/organisms/_puzzle-container.scss: -------------------------------------------------------------------------------- 1 | .puzzle-container { 2 | display: flex; 3 | flex-direction: column; 4 | } 5 | -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/arrow.png -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/etcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/etcd.png -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/mongo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/mongo.png -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/arrow-blue.png -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/etcd-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/etcd-logo.png -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/logo-reg-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/logo-reg-2x.png -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/MongoDB-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/MongoDB-logo.png -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/arrow-reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/arrow-reverse.png -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/arrow-blue-reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/arrow-blue-reverse.png -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/components/home/instanceConfig.js: -------------------------------------------------------------------------------- 1 | export const instanceConfig = { 2 | min: 1, 3 | max: 16, 4 | step: 1, 5 | defaultValue: 1, 6 | value: 1 7 | }; 8 | -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/styles/organisms/_organisms.scss: -------------------------------------------------------------------------------- 1 | // Atoms 2 | // 3 | // Styleguide 2.0.0 4 | 5 | @import './header', 6 | './instance-grid', 7 | './puzzle-container'; 8 | -------------------------------------------------------------------------------- /applications/hello-kenzan/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:latest 2 | 3 | COPY index.html /usr/share/nginx/html/index.html 4 | COPY DockerFileEx.jpg /usr/share/nginx/html/DockerFileEx.jpg 5 | 6 | EXPOSE 80 -------------------------------------------------------------------------------- /applications/puzzle/server/boot/authentication.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function enableAuthentication(server) { 4 | // enable authentication 5 | server.enableAuth(); 6 | }; 7 | -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Bold-webfont.eot -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Bold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Bold-webfont.ttf -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Bold-webfont.woff -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Light-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Light-webfont.eot -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Light-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Light-webfont.ttf -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Italic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Italic-webfont.eot -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Italic-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Italic-webfont.ttf -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Italic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Italic-webfont.woff -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Light-webfont.woff -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Regular-webfont.eot -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Regular-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Regular-webfont.ttf -------------------------------------------------------------------------------- /applications/puzzle/docker-compose.yml: -------------------------------------------------------------------------------- 1 | mongo: 2 | image: mongo 3 | ports: 4 | - "27017:27017" 5 | web: 6 | build: . 7 | ports: 8 | - "3000:3000" 9 | links: 10 | - mongo 11 | -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-BoldItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-BoldItalic-webfont.eot -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-BoldItalic-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-BoldItalic-webfont.ttf -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-Regular-webfont.woff -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-BoldItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-BoldItalic-webfont.woff -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-LightItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-LightItalic-webfont.eot -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-LightItalic-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-LightItalic-webfont.ttf -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/assets/fonts/Roboto-LightItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrijack/kubernetes-ci-cd/HEAD/applications/kr8sswordz-pages/src/assets/fonts/Roboto-LightItalic-webfont.woff -------------------------------------------------------------------------------- /applications/socat/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | #USER root 3 | #Installing socat 4 | RUN apk update && apk upgrade && apk add bash socat 5 | COPY entrypoint.sh entrypoint.sh 6 | ENTRYPOINT ["sh", "./entrypoint.sh"] -------------------------------------------------------------------------------- /applications/puzzle/server/middleware.development.json: -------------------------------------------------------------------------------- 1 | { 2 | "final:after": { 3 | "strong-error-handler": { 4 | "params": { 5 | "debug": true, 6 | "log": true 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /applications/spinnaker-helm/start.sh: -------------------------------------------------------------------------------- 1 | sudo virsh net-start default 2 | 3 | minikube delete 4 | 5 | rm -rf ~/.minikube 6 | 7 | minikube start --vm-driver kvm --memory 8000 --cpus 4 --disk-size 40g 8 | 9 | 10 | 11 | 12 | helm install ./chart -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/styles/molecules/_superscript-number.scss: -------------------------------------------------------------------------------- 1 | 2 | .superscript-number { 3 | z-index: 1; 4 | position: absolute; 5 | top: 0.1rem; 6 | left: 0.1rem; 7 | font-size: 0.7rem; 8 | line-height: 0.7rem; 9 | } 10 | -------------------------------------------------------------------------------- /applications/puzzle/.gitignore: -------------------------------------------------------------------------------- 1 | *.csv 2 | *.dat 3 | *.iml 4 | *.log 5 | *.out 6 | *.pid 7 | *.seed 8 | *.sublime-* 9 | *.swo 10 | *.swp 11 | *.tgz 12 | *.xml 13 | .DS_Store 14 | .idea 15 | .project 16 | .strong-pm 17 | coverage 18 | node_modules 19 | npm-debug.log 20 | -------------------------------------------------------------------------------- /applications/puzzle/server/datasources.json: -------------------------------------------------------------------------------- 1 | { 2 | "db": { 3 | "host": "mongo", 4 | "port": 27017, 5 | "database": "puzzle", 6 | "username": "puzzle", 7 | "password": "", 8 | "name": "db", 9 | "connector": "mongodb" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /applications/puzzle/server/boot/root.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(server) { 4 | // Install a `/` route that returns server status 5 | var router = server.loopback.Router(); 6 | router.get('/', server.loopback.status()); 7 | server.use(router); 8 | }; 9 | -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/styles/utils/_utils.scss: -------------------------------------------------------------------------------- 1 | // Settings 2 | // 3 | // Baseline settings 4 | // 5 | // Styleguide 1.0.0 6 | 7 | // styleguide:ignore:start 8 | @import './normalize', 9 | './variables', 10 | './typography'; 11 | // styleguide:ignore:end 12 | -------------------------------------------------------------------------------- /applications/kr8sswordz-pages/src/components/shared/Loader.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | function Loader (props) { 4 | return ( 5 |
The Hello-Kenzan app is a modified version of the nginx web server image. If you open up the kubernetes-ci-cd/hello-kenzan/DockerFile, you will note several things:
3 |
--------------------------------------------------------------------------------
/applications/monitor-scale/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:boron
2 |
3 | # Create app directory
4 | RUN mkdir -p /usr/src/app
5 | WORKDIR /usr/src/app
6 |
7 | # Install app dependencies
8 | COPY package.json yarn.lock /usr/src/app/
9 |
10 | RUN yarn --pure-lockfile
11 |
12 | # Bundle app source
13 | COPY . /usr/src/app
14 |
15 | #Expose port 3001 so the monitor service is reachable
16 | EXPOSE 3001
17 | EXPOSE 8080
18 |
19 | CMD ["node", "index.js"]
20 |
--------------------------------------------------------------------------------
/applications/spinnaker-helm/spinnaker-chart/templates/NOTES.txt:
--------------------------------------------------------------------------------
1 |
2 | =======================
3 |
4 | 1. Wait until all pod are up with
5 | kubectl get pods --namespace spinnaker
6 |
7 | 2. Forward deck to localhost:9000 with
8 | kubectl --namespace spinnaker port-forward (kubectl --namespace spinnaker get pods -l app=deck -o jsonpath='{.items[*].metadata.name}') 9000:9000
9 |
10 | 3. Open http://localhost:9000 to start using spinnaker
11 |
12 | =======================
--------------------------------------------------------------------------------
/applications/spinnaker-helm/spinnaker-chart/.helmignore:
--------------------------------------------------------------------------------
1 | # Patterns to ignore when building packages.
2 | # This supports shell glob matching, relative path matching, and
3 | # negation (prefixed with !). Only one pattern per line.
4 | .DS_Store
5 | # Common VCS dirs
6 | .git/
7 | .gitignore
8 | .bzr/
9 | .bzrignore
10 | .hg/
11 | .hgignore
12 | .svn/
13 | # Common backup files
14 | *.swp
15 | *.bak
16 | *.tmp
17 | *~
18 | # Various IDEs
19 | .project
20 | .idea/
21 | *.tmproj
22 |
--------------------------------------------------------------------------------
/applications/kr8sswordz-pages/src/store/configureStore.js:
--------------------------------------------------------------------------------
1 | import { createStore, applyMiddleware } from 'redux';
2 | import thunk from 'redux-thunk';
3 | import { composeWithDevTools } from 'redux-devtools-extension';
4 | import rootReducer from '../reducers/index';
5 |
6 | export default function configureStore (initialState) {
7 | return createStore(
8 | rootReducer,
9 | initialState,
10 | composeWithDevTools(
11 | applyMiddleware(thunk),
12 | ),
13 | );
14 | }
15 |
--------------------------------------------------------------------------------
/applications/puzzle/server/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "restApiRoot": "/puzzle/v1",
3 | "host": "0.0.0.0",
4 | "port": 3000,
5 | "remoting": {
6 | "context": false,
7 | "rest": {
8 | "handleErrors": false,
9 | "normalizeHttpPath": false,
10 | "xml": false
11 | },
12 | "json": {
13 | "strict": false,
14 | "limit": "100kb"
15 | },
16 | "urlencoded": {
17 | "extended": true,
18 | "limit": "100kb"
19 | },
20 | "cors": false
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/scripts/etcd.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | echo "initializing Helm"
4 | helm init --wait --debug
5 |
6 | echo "installing etcd operator (Helm Chart)"
7 | helm install stable/etcd-operator --version 0.8.0 --name etcd-operator --debug
8 | kubectl rollout status deploy/tiller-deploy -n kube-system
9 |
10 | kubectl create -f manifests/etcd-cluster.yaml
11 |
12 | echo "installing etcd cluster service"
13 | kubectl create -f manifests/etcd-service.yaml
14 |
15 | echo "waiting for etcd cluster to turnup"
16 | sleep 10
17 |
--------------------------------------------------------------------------------
/applications/kr8sswordz-pages/test/helpers/setup-browser-env.js:
--------------------------------------------------------------------------------
1 | /* eslint import/no-extraneous-dependencies: 0 */
2 |
3 | import browserEnv from 'browser-env';
4 |
5 | browserEnv(['document', 'window', 'navigator']);
6 |
7 | /*
8 | ** Fix required for testing bug with react-slick
9 | ** https://github.com/akiran/react-slick/issues/93
10 | */
11 | window.matchMedia = window.matchMedia || function () {
12 | return {
13 | matches: false,
14 | addListener: () => {},
15 | removeListener: () => {}
16 | };
17 | };
18 |
--------------------------------------------------------------------------------
/applications/kr8sswordz-pages/README.md:
--------------------------------------------------------------------------------
1 | ## Kr8ssword Puzzle Kubernetes CI / CD , Microservices Example
2 |
3 | # setup
4 | From the root directory of the repository, use 'npm run part1' to setup the minikube cluster.
5 |
6 | ### Building
7 | Use or review
8 |
9 | {this.props.title}
} 36 |Choose the number of instances you want to scale in your cluster and click "Scale". 30 | This will call our service and scale up the number of replicas to the desired size.
31 |Choose the number of consecutive requests you want to make and click "Load Test." 87 | This will call the puzzle service the given number of times and you can observe the calls being made in the instance grid above.
88 | tags. For example, change “Hello from Kenzan!” to “Hello from Me!”. Save the file.
39 | com: echo ''
40 |
41 | - cap: Now let’s build an image, giving it a special name that points to our local cluster registry.
42 | com: docker build -t 127.0.0.1:30400/hello-kenzan:latest -f applications/hello-kenzan/Dockerfile applications/hello-kenzan
43 |
44 | - cap: We’ve built the image, but before we can push it to the registry, we need to set up a temporary proxy. By default the Docker client can only push to HTTP (not HTTPS) via localhost. To work around this, we’ll set up a Docker container that listens on 127.0.0.1:30400 and forwards to our cluster. First, build the image for our proxy container.
45 | com: docker build -t socat-registry -f applications/socat/Dockerfile applications/socat
46 |
47 | - cap: Now run the proxy container from the newly created image. (Note that you may see some errors; this is normal as the commands are first making sure there are no previous instances running.)
48 | com: docker stop socat-registry; docker rm socat-registry; docker run -d -e "REG_IP=`minikube ip`" -e "REG_PORT=30400" --name socat-registry -p 30400:5000 socat-registry
49 |
50 | - cap: With our proxy container up and running, we can now push our hello-kenzan image to the local repository.
51 | com: docker push 127.0.0.1:30400/hello-kenzan:latest
52 |
53 | - cap: The proxy’s work is done, so you can go ahead and stop it.
54 | com: docker stop socat-registry;
55 |
56 | - cap: With the image in our cluster registry, the last thing to do is apply the manifest to create and deploy the hello-kenzan pod based on the image.
57 | com: kubectl apply -f applications/hello-kenzan/k8s/manual-deployment.yaml
58 |
59 | - cap: Launch a web browser and view the service.
60 | com: minikube service hello-kenzan
61 |
62 | - cap: Delete the hello-kenzan deployment and service you created.
63 | com: kubectl delete service hello-kenzan; kubectl delete deployment hello-kenzan
64 |
--------------------------------------------------------------------------------
/part2.yml:
--------------------------------------------------------------------------------
1 | parts:
2 |
3 | - name: Part 2
4 | intro: In this part we will Setup Jenkins, and setup an automated pipeline to build, push and deploy our custom appliction.
5 | steps:
6 |
7 | - cap: Start up the Kubernetes cluster with Minikube.
8 | com: minikube stop; minikube start --memory 8000 --cpus 2 --kubernetes-version v1.11.0
9 |
10 | - cap: Before we do anything, let's make sure the private registry deployment we've setup in the previous part is available.
11 | com: kubectl rollout status deployment/registry
12 |
13 | - cap: Let's build the Jenkins Docker image we'll use in our Kubernetes cluster.
14 | com: docker build -t 127.0.0.1:30400/jenkins:latest -f applications/jenkins/Dockerfile applications/jenkins
15 |
16 | - cap: Once again we'll need to set up the Socat Registry proxy container to push images, so let's build it. Feel free to skip this step in case the socat-registry image already exists from Part 1 (to check, run `docker images` in a separate terminal).
17 | com: docker build -t socat-registry -f applications/socat/Dockerfile applications/socat
18 |
19 | - cap: Run the proxy container from the image.
20 | com: docker stop socat-registry; docker rm socat-registry; docker run -d -e "REG_IP=`minikube ip`" -e "REG_PORT=30400" --name socat-registry -p 30400:5000 socat-registry; sleep 10
21 |
22 | - cap: With our proxy container up and running, we can now push our Jenkins image to the local repository.
23 | com: docker push 127.0.0.1:30400/jenkins:latest
24 |
25 | - cap: The proxy’s work is done, so you can go ahead and stop it.
26 | com: docker stop socat-registry
27 |
28 | - cap: Deploy Jenkins, which we’ll use to create our automated CI/CD pipeline. It will take the pod a minute or two to roll out.
29 | com: kubectl apply -f manifests/jenkins.yaml; kubectl rollout status deployment/jenkins
30 |
31 | - cap: Open the Jenkins UI in a web browser.
32 | com: minikube service jenkins
33 |
34 | - cap: Display the Jenkins admin password with the following command, and right-click to copy it. IMPORTANT: BE CAREFUL NOT TO PRESS CTRL-C TO COPY THE PASSWORD AS THIS WILL STOP THE SCRIPT
35 | com: kubectl exec -it `kubectl get pods --selector=app=jenkins --output=jsonpath={.items..metadata.name}` cat /var/jenkins_home/secrets/initialAdminPassword
36 |
37 | - cap: Switch back to the Jenkins UI. Paste the Jenkins admin password in the box and click Continue. Click Install suggested plugins. Plugins have actually been pre-downloaded during the Jenkins image build, so this step should finish fairly quickly.
38 | com: echo ''
39 |
40 | - cap: Create an admin user and credentials, and click Save and Continue. (Make sure to remember these credentials as you will need them for repeated logins.) On the Instance Configuration page, click Save and Finish. On the next page, click Restart (if it appears to hang for some time on restarting, you may have to refresh the browser window). Login to Jenkins.
41 | com: echo ''
42 |
43 | - cap: Before we create a pipeline, we first need to provision the Kubernetes Continuous Deploy plugin with a kubeconfig file that will allow access to our Kubernetes cluster. In Jenkins on the left, click on Credentials, select the Jenkins store, then Global credentials (unrestricted), and Add Credentials on the left menu.
44 | com: echo ''
45 |
46 | - cap: The following values must be entered precisely as indicated: for the Kind field select the option `Kubernetes configuration (kubeconfig)`, set the ID as `kenzan_kubeconfig`, set Kubeconfig to `From a file on the Jenkins master`, and specify the the file path as `/var/jenkins_home/.kube/config`. Click the OK button.
47 | com: echo ''
48 |
49 | - cap: We now want to create a new pipeline for use with our Hello-Kenzan app. Back on Jenkins home, on the left, click New Item. Enter the item name as "Hello-Kenzan Pipeline", select Pipeline, and click OK.
50 | com: echo ''
51 |
52 | - cap: Under the Pipeline section at the bottom, change the Definition to be "Pipeline script from SCM".
53 | com: echo ''
54 |
55 | - cap: Change the SCM to Git. Change the Repository URL to be the URL of your forked Git repository, such as https://github.com/[GIT USERNAME]/kubernetes-ci-cd. Click Save. On the left, click Build Now to run the new pipeline.
56 | com: echo ''
57 |
58 | - cap: After all pipeline stages are colored green as complete, view the Hello-Kenzan application.
59 | com: minikube service hello-kenzan
60 |
61 | - cap: Push a change to your fork. Run the job again. View the changes.
62 | com: minikube service hello-kenzan
63 |
--------------------------------------------------------------------------------
/part3.yml:
--------------------------------------------------------------------------------
1 | parts:
2 |
3 | - name: Part 3
4 | intro: This part will have us setup the various applications that will present the crossword puzzle. We will run a sample etcd cluster as a cache, a pages application containing the front-end, a crossword server using mongodb, and a monitoring and scaling server application.
5 | steps:
6 |
7 | - cap: Initialize Helm. This will install Tiller (Helm's server) into our Kubernetes cluster.
8 | com: helm init --wait --debug; kubectl rollout status deploy/tiller-deploy -n kube-system
9 |
10 | - cap: We will deploy the etcd operator onto the cluster using a Helm Chart.
11 | com: helm install stable/etcd-operator --version 0.8.0 --name etcd-operator --debug --wait
12 |
13 | - cap: Deploy the etcd cluster and K8s Services for accessing the cluster.
14 | com: kubectl create -f manifests/etcd-cluster.yaml; kubectl create -f manifests/etcd-service.yaml
15 |
16 | - cap: The crossword application is a multi-tier application whose services depend on each other. We will create three K8s Services so that the applications can communicate with one another.
17 | com: kubectl apply -f manifests/all-services.yaml
18 |
19 | - cap: Now we're going to walk through an initial build of the monitor-scale service.
20 | com: docker build -t 127.0.0.1:30400/monitor-scale:`git rev-parse --short HEAD` -f applications/monitor-scale/Dockerfile applications/monitor-scale
21 |
22 | - cap: Once again we'll need to set up the Socat Registry proxy container to push the monitor-scale image to our registry, so let's build it. Feel free to skip this step in case the socat-registry image already exists from Part 2 (to check, run `docker images` in a separate terminal).
23 | com: docker build -t socat-registry -f applications/socat/Dockerfile applications/socat
24 |
25 | - cap: Run the proxy container from the newly created image.
26 | com: docker stop socat-registry; docker rm socat-registry; docker run -d -e "REG_IP=`minikube ip`" -e "REG_PORT=30400" --name socat-registry -p 30400:5000 socat-registry; sleep 10
27 |
28 | - cap: Push the monitor-scale image to the registry.
29 | com: docker push 127.0.0.1:30400/monitor-scale:`git rev-parse --short HEAD`
30 |
31 | - cap: The proxy’s work is done, so go ahead and stop it.
32 | com: docker stop socat-registry
33 |
34 | - cap: Open the registry UI and verify that the monitor-scale image is in our local registry.
35 | com: minikube service registry-ui
36 |
37 | - cap: Monitor-scale has the functionality to let us scale our puzzle app up and down through the Kr8sswordz UI, therefore we'll need to do some RBAC work in order to provide monitor-scale with the proper rights.
38 | com: kubectl apply -f manifests/monitor-scale-serviceaccount.yaml
39 |
40 | - cap: Create the monitor-scale deployment and the Ingress defining the hostname by which this service will be accessible to the other services.
41 | com: sed 's#127.0.0.1:30400/monitor-scale:$BUILD_TAG#127.0.0.1:30400/monitor-scale:'`git rev-parse --short HEAD`'#' applications/monitor-scale/k8s/deployment.yaml | kubectl apply -f -
42 |
43 | - cap: Wait for the monitor-scale deployment to finish.
44 | com: kubectl rollout status deployment/monitor-scale
45 |
46 | - cap: View pods to see the monitor-scale pod running.
47 | com: kubectl get pods
48 |
49 | - cap: View services to see the monitor-scale service.
50 | com: kubectl get services
51 |
52 | - cap: View ingress rules to see the monitor-scale ingress rule.
53 | com: kubectl get ingress
54 |
55 | - cap: View deployments to see the monitor-scale deployment.
56 | com: kubectl get deployments
57 |
58 | - cap: We will run a script to bootstrap the puzzle and mongo services, creating Docker images and storing them in the local registry. The puzzle.sh script runs through the same build, proxy, push, and deploy steps we just ran through manually for both services.
59 | com: scripts/puzzle.sh
60 |
61 | - cap: Check to see if the puzzle and mongo services have been deployed.
62 | com: kubectl rollout status deployment/puzzle; kubectl rollout status deployment/mongo
63 |
64 | - cap: Bootstrap the kr8sswordz frontend web application. This script follows the same build proxy, push, and deploy steps that the other services followed.
65 | com: scripts/kr8sswordz-pages.sh
66 |
67 | - cap: Check to see if the frontend has been deployed.
68 | com: kubectl rollout status deployment/kr8sswordz
69 |
70 | - cap: Check out all the pods that are running.
71 | com: kubectl get pods
72 |
73 | - cap: Start the web application in your default browser. You may have to refresh your browser so that the puzzle appears properly.
74 | com: minikube service kr8sswordz
--------------------------------------------------------------------------------
/applications/monitor-scale/index.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var app = express();
3 | var http = require('http').Server(app);
4 | var request = require('request');
5 | var async = require('async');
6 | var io = require('socket.io')(http);
7 | var path = require("path");
8 | var Etcd = require('node-etcd');
9 | var cors = require('cors');
10 |
11 | app.use(express.static('public'));
12 |
13 | var bodyParser = require("body-parser");
14 |
15 | app.use(bodyParser.urlencoded({ extended: false }));
16 | app.use(bodyParser.json());
17 | app.use(cors());
18 |
19 | etcd = new Etcd("http://example-etcd-cluster-client-service:2379");
20 | etcd.mkdirSync('pod-list');
21 |
22 | var watcher = etcd.watcher("pod-list", null, {recursive: true});
23 | watcher.on("change", function(val) {
24 |
25 | var podChange = { pods: val.node.key, action: val.action };
26 | console.log(JSON.stringify(podChange));
27 | io.emit('pods', podChange);
28 | });
29 |
30 | app.post('/scale', function (req, res) {
31 | var scale = req.body.count;
32 | console.log('Count requested is: %s', scale);
33 | var url = "http://127.0.0.1:2345/apis/extensions/v1beta1/namespaces/default/deployments/puzzle/scale";
34 | var putBody = {
35 | kind:"Scale",
36 | apiVersion:"extensions/v1beta1",
37 | metadata: {
38 | name:"puzzle",
39 | namespace:"default"
40 | },
41 | spec: {
42 | replicas:1
43 | },
44 | status:{}
45 | };
46 | putBody.spec.replicas = scale;
47 |
48 | request({ url: url, method: 'PUT', json: putBody}, function (err, httpResponse, body) {
49 | if (err) {
50 | console.error('Failed to scale:', err);
51 | next(err);
52 | }
53 | console.log('Response: ' + JSON.stringify(httpResponse));
54 | res.status(httpResponse.statusCode).json(body);
55 | });
56 | });
57 |
58 | app.post('/loadtest/concurrent', function (req, res) {
59 |
60 | var count = req.body.count;
61 | console.log('Count requested is: %s', count);
62 | var url = "http://puzzle:3000/puzzle/v1/crossword";
63 | var myUrls = [];
64 | for (var i = 0; i < req.body.count; i++) {
65 | myUrls.push(url);
66 | }
67 | async.map(myUrls, function(url, callback) {
68 | request(url, function(error, response, html){
69 | if (response && response.hasOwnProperty("statusCode")) {
70 | console.log(response.statusCode);
71 | } else {
72 | console.log("Error: " + error);
73 | }
74 | });
75 | }, function(err, results) {
76 | console.log(results);
77 | });
78 | res.send('concurrent done');
79 | });
80 |
81 | app.post('/loadtest/consecutive', function (req, res) {
82 |
83 | var count = req.body.count;
84 | var url = "http://puzzle:3000/puzzle/v1/crossword";
85 | var callArray = [];
86 |
87 | for (var i = 0; i < req.body.count; i++) {
88 |
89 | callArray.push(function (cb) {
90 | setTimeout(function () {
91 | request(url, function(error, response, html) {
92 | cb(null, response && response.statusCode);
93 | });
94 | }, 100);
95 | });
96 | }
97 | async.series(callArray, function (err, results) {
98 | var finalCount = results && results.length;
99 | console.log(`${finalCount} requests sent.`)
100 | });
101 | res.send('consecutive done');
102 | });
103 |
104 | app.get('/up/:podId', function (req, res) {
105 | console.log('Server UP: %s', req.params.podId);
106 | etcd.setSync("pod-list/" + req.params.podId, req.params.podId);
107 | res.send('up done');
108 | });
109 |
110 | app.get('/down/:podId', function (req, res) {
111 | console.log('Server DOWN: %s', req.params.podId);
112 | etcd.delSync("pod-list/" + req.params.podId, req.params.podId);
113 | res.send('down done');
114 | });
115 |
116 | app.get('/hit/:podId', function (req, res) {
117 |
118 | var d = new Date();
119 | var n = d.getTime();
120 |
121 | console.log("Emitting hit from %s", req.params.podId);
122 | io.emit('hit', { podId: req.params.podId, time: n });
123 | res.send('hit done')
124 | });
125 |
126 | app.get('/pods', function (req, res) {
127 | var pods = etcd.getSync("pod-list",{ recursive: true });
128 | res.setHeader('Content-Type', 'application/json');
129 | res.send(JSON.stringify({pods: pods.body.node.nodes}));
130 | });
131 |
132 | app.delete('/pods', function (req, res) {
133 |
134 | var pods = etcd.delSync("pod-list/",{ recursive: true });
135 | res.send('pods deleted')
136 | });
137 |
138 | io.on('connection', function(socket){
139 |
140 | console.log("Websocket connection established.");
141 | socket.on('disconnect', function() {
142 | console.log("Websocket disconnect.");
143 | })
144 | });
145 |
146 | app.get('/', function(req,res){
147 | res.send('basic GET successful');
148 | });
149 |
150 | http.listen(3001, function () {
151 | console.log('Listening on port 3001!');
152 | });
153 |
154 |
--------------------------------------------------------------------------------
/applications/spinnaker-helm/spinnaker-chart/static/gate.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8084
3 | address: 0.0.0.0
4 |
5 | spinnaker:
6 | redis:
7 | enabled: true
8 | connection: redis://redis:6379
9 | scheduler: default
10 | parallelism: -1
11 |
12 | services:
13 | deck:
14 | baseUrl: http://spinnaker.192.168.42.74.xip.io
15 | auth:
16 | enabled: false
17 | orca:
18 | baseUrl: http://orca:8083
19 | front50:
20 | baseUrl: http://front50:8080
21 | clouddriver:
22 | baseUrl: http://clouddriver:7002
23 | # semi-optional services (Everybody except Netflix needs these):
24 | rosco:
25 | enabled: false
26 | baseUrl: http://rosco:8087
27 | # These are here only for Netflix, whose bakery does not support dynamically fetching these properties.
28 | # Modifying the details below when rosco.enabled is true will have no effect (do it in the Rosco config).
29 | # defaults:
30 | # bakeOptions:
31 | # - cloudProvider: aws
32 | # baseImages:
33 | # - id: trusty
34 | # shortDescription: v14.04
35 | # detailedDescription: Ubuntu Trusty Tahr v14.04
36 | # packageType: DEB
37 | # - id: ubuntu
38 | # shortDescription: v12.04
39 | # detailedDescription: Ubuntu Precise Pangolin v12.04
40 | # packageType: DEB
41 | # - id: centos
42 | # shortDescription: deprecated
43 | # detailedDescription: CentOS v5.11
44 | # packageType: RPM
45 | # optional services:
46 | echo:
47 | enabled: false
48 | fiat:
49 | enabled: false
50 | autoConfig: false
51 | flapjack:
52 | enabled: false
53 | igor:
54 | enabled: true
55 | baseUrl: http://igor:8088
56 | mahe:
57 | enabled: false
58 |
59 | redis:
60 | enabled: true
61 | connection: redis://redis:6379
62 | scheduler: default
63 | parallelism: -1
64 |
65 | swagger:
66 | enabled: true
67 | title: Spinnaker API
68 | description:
69 | contact:
70 | patterns:
71 | - .*tasks.*
72 | - .*applications.*
73 | - .*securityGroups.*
74 | - /search
75 | - .*pipelines.*
76 | - .*loadBalancers.*
77 | - .*instances.*
78 | - .*images.*
79 | - .*elasticIps.*
80 | - .*credentials.*
81 | - .*events.*
82 | - .*builds.*
83 | - .*instanceTypes.*
84 | - .*vpcs.*
85 | - .*subnets.*
86 | - .*networks.*
87 | - .*bakery.*
88 | - .*executions.*
89 |
90 | hystrix:
91 | command:
92 | ## Hystrix Global Defaults
93 | default:
94 | execution.isolation.thread.timeoutInMilliseconds: 60000
95 | ## Command-specific overrides
96 | fetchGlobalAccounts:
97 | execution.isolation.thread.timeoutInMilliseconds: 2000
98 |
99 | spring:
100 | jackson:
101 | mapper:
102 | SORT_PROPERTIES_ALPHABETICALLY: true
103 | serialization:
104 | ORDER_MAP_ENTRIES_BY_KEYS: true
105 |
106 | ---
107 |
108 | # spring:
109 | # profiles: googleOAuth
110 | # oauth2:
111 | # client:
112 | # # Set these values in your own config file (e.g. spinnaker-local.yml or gate-googleOAuth.yml).
113 | # # clientId:
114 | # # clientSecret:
115 | # accessTokenUri: https://www.googleapis.com/oauth2/v4/token
116 | # userAuthorizationUri: https://accounts.google.com/o/oauth2/v2/auth
117 | # scope: "profile email"
118 | # resource:
119 | # userInfoUri: https://www.googleapis.com/oauth2/v3/userinfo
120 | # userInfoMapping:
121 | # email: email
122 | # firstName: given_name
123 | # lastName: family_name
124 |
125 | # ---
126 |
127 | # spring:
128 | # profiles: azureOAuth
129 | # oauth2:
130 | # client:
131 | # # Set these values in your own config file (e.g. spinnaker-local.yml or gate-azureOAuth.yml).
132 | # # clientId:
133 | # # clientSecret:
134 | # accessTokenUri: https://login.microsoftonline.com/${azureTenantId}/oauth2/token
135 | # userAuthorizationUri: https://login.microsoftonline.com/${azureTenantId}/oauth2/authorize?resource=https://graph.windows.net
136 | # scope: "profile"
137 | # clientAuthenticationScheme: query
138 | # resource:
139 | # userInfoUri: https://graph.windows.net/me?api-version=1.6
140 | # userInfoMapping:
141 | # email: userPrincipalName
142 | # firstName: givenName
143 | # lastName: surname
144 |
145 | # ---
146 |
147 | # spring:
148 | # profiles: githubOAuth
149 | # oauth2:
150 | # client:
151 | # # Set these values in your own config file (e.g. spinnaker-local.yml or gate-githubOAuth.yml).
152 | # # clientId:
153 | # # clientSecret:
154 | # userAuthorizationUri: https://github.com/login/oauth/authorize
155 | # accessTokenUri: https://github.com/login/oauth/access_token
156 | # scope: user:email
157 | # resource:
158 | # userInfoUri: https://api.github.com/user
159 | # userInfoMapping:
160 | # email: email
161 | # firstName:
162 | # lastName: name
163 | # username: login
164 |
165 |
166 |
167 |
168 |
169 |
170 | # redis:
171 | # enabled: true
172 | # connection: redis://redis:6379
173 | # scheduler: default
174 | # parallelism: -1
175 | # server:
176 | # port: 8084
177 | # address: 0.0.0.0
178 | # services:
179 | # clouddriver:
180 | # baseUrl: http://clouddriver:7002
181 | # deck:
182 | # baseUrl: http://deck.192.168.42.74.xip.io
183 | # front50:
184 | # baseUrl: http://front50:8080
185 | # orca:
186 | # baseUrl: http://orca:8083
187 | # igor:
188 | # enabled: false
189 | # baseUrl: http://igor:8088
190 | # rosco:
191 | # enabled: false
192 | # baseUrl: http://rosco:8087
193 | # echo:
194 | # enabled: false
195 | # baseUrl: http://echo:8089
196 |
197 | # fiat:
198 | # enabled: false
199 | # autoConfig: false
200 | # flapjack:
201 | # enabled: false
202 | # mahe:
203 | # enabled: false
--------------------------------------------------------------------------------
/applications/kr8sswordz-pages/src/components/home/PuzzleComponent.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from 'react';
2 | import { connect } from 'react-redux';
3 | import { bindActionCreators } from 'redux';
4 | import * as puzzleActions from '../../actions/puzzleActions';
5 | import Cell from '../shared/Cell';
6 | import _ from 'lodash';
7 |
8 | class PuzzleComponent extends React.Component {
9 | constructor (props) {
10 | super(props);
11 |
12 | this.state = {
13 | cells: [],
14 | downHints: [],
15 | acrossHints: [],
16 | puzzleGrid: [],
17 | sliderCount: 1
18 | };
19 |
20 | this.onCellInput = this.onCellInput.bind(this);
21 | this.initializePuzzleArray = this.initializePuzzleArray.bind(this);
22 | this.convertPuzzleGridToPuzzleArray = this.convertPuzzleGridToPuzzleArray.bind(this);
23 | this.reloadPuzzle = this.reloadPuzzle.bind(this);
24 | this.clearPuzzle = this.clearPuzzle.bind(this);
25 | this.submitPuzzle = this.submitPuzzle.bind(this);
26 | }
27 |
28 | componentWillMount () {
29 | this.props.puzzleActions.getPuzzleData();
30 | }
31 |
32 | componentWillReceiveProps (newProps) {
33 | if (this.props.puzzleData !== newProps.puzzleData) {
34 | this.initializePuzzleArray(newProps.puzzleData);
35 | }
36 | }
37 |
38 | initializeGrid () {
39 | const puzzleGrid = [];
40 | const maxColumns = 12;
41 | const maxRows = 13;
42 |
43 | for (var i = 0; i < maxRows; i++) {
44 | puzzleGrid.push(new Array(maxColumns).fill(''));
45 | }
46 |
47 | return puzzleGrid;
48 | }
49 |
50 | initializePuzzleArray (puzzleArray) {
51 | const downHintsArray = puzzleArray.filter((word) => {
52 | return (word.wordOrientation === 'down');
53 | });
54 | const acrossHintsArray = puzzleArray.filter((word) => {
55 | return (word.wordOrientation === 'across');
56 | });
57 |
58 | const downHints = this.buildHints(downHintsArray);
59 | const acrossHints = this.buildHints(acrossHintsArray);
60 |
61 | let puzzleGrid = [...this.initializeGrid()];
62 | puzzleArray.forEach((wordObj, index) => {
63 | const lettersArray = wordObj.word.split('');
64 | const enteredValueArray = wordObj.enteredValue.split('');
65 | lettersArray.forEach((letter, index) => {
66 | puzzleGrid = this.addLetterToPuzzleArray(puzzleGrid, wordObj, letter, enteredValueArray[index], index);
67 | });
68 | });
69 |
70 | const cells = this.buildCells(puzzleGrid);
71 |
72 | this.setState({
73 | downHints,
74 | acrossHints,
75 | puzzleGrid,
76 | cells
77 | });
78 | }
79 |
80 | addLetterToPuzzleArray (puzzleGrid, wordObj, letter, enteredValue, index) {
81 | const letterObj = {
82 | word: wordObj.word,
83 | wordNbr: wordObj.wordNbr,
84 | positionInWord: index,
85 | cellLetter: letter,
86 | currentValue: enteredValue,
87 | wordOrientation: wordObj.wordOrientation,
88 | x: wordObj.wordOrientation === 'across' ? wordObj.startx + index : wordObj.startx,
89 | y: wordObj.wordOrientation === 'across' ? wordObj.starty : wordObj.starty + index
90 | };
91 |
92 | puzzleGrid[letterObj.y][letterObj.x] = letterObj;
93 |
94 | return puzzleGrid;
95 | }
96 |
97 | buildCells (puzzleGrid) {
98 | return puzzleGrid.map((column, index) => {
99 | return column.map((cell, i) => {
100 | return (
101 |
{word.wordNbr}.
{word.hint}
147 |