├── .gitignore ├── LICENSE ├── README.md ├── Vagrantfile ├── docker ├── html-proofer │ ├── Dockerfile │ └── Makefile ├── hugo-app │ └── Dockerfile ├── hugo │ ├── Dockerfile │ └── Makefile ├── jenkins-kubernetes-leader │ ├── Dockerfile │ ├── config.xml │ ├── executors.groovy │ ├── jobs │ │ └── test-pipeline │ │ │ ├── builds │ │ │ ├── 1 │ │ │ │ ├── 10.log │ │ │ │ ├── 3.log │ │ │ │ ├── 5.log │ │ │ │ ├── 7.log │ │ │ │ ├── 8.log │ │ │ │ ├── build.xml │ │ │ │ ├── log │ │ │ │ ├── program.dat │ │ │ │ └── workflow │ │ │ │ │ ├── 10.xml │ │ │ │ │ ├── 11.xml │ │ │ │ │ ├── 12.xml │ │ │ │ │ ├── 13.xml │ │ │ │ │ ├── 14.xml │ │ │ │ │ ├── 15.xml │ │ │ │ │ ├── 16.xml │ │ │ │ │ ├── 17.xml │ │ │ │ │ ├── 2.xml │ │ │ │ │ ├── 3.xml │ │ │ │ │ ├── 4.xml │ │ │ │ │ ├── 5.xml │ │ │ │ │ ├── 6.xml │ │ │ │ │ ├── 7.xml │ │ │ │ │ ├── 8.xml │ │ │ │ │ └── 9.xml │ │ │ ├── 2 │ │ │ │ ├── 10.log │ │ │ │ ├── 3.log │ │ │ │ ├── 5.log │ │ │ │ ├── 7.log │ │ │ │ ├── 8.log │ │ │ │ ├── build.xml │ │ │ │ ├── log │ │ │ │ ├── program.dat │ │ │ │ └── workflow │ │ │ │ │ ├── 10.xml │ │ │ │ │ ├── 11.xml │ │ │ │ │ ├── 12.xml │ │ │ │ │ ├── 13.xml │ │ │ │ │ ├── 14.xml │ │ │ │ │ ├── 15.xml │ │ │ │ │ ├── 16.xml │ │ │ │ │ ├── 17.xml │ │ │ │ │ ├── 2.xml │ │ │ │ │ ├── 3.xml │ │ │ │ │ ├── 4.xml │ │ │ │ │ ├── 5.xml │ │ │ │ │ ├── 6.xml │ │ │ │ │ ├── 7.xml │ │ │ │ │ ├── 8.xml │ │ │ │ │ └── 9.xml │ │ │ ├── 3 │ │ │ │ ├── 10.log │ │ │ │ ├── 11.log │ │ │ │ ├── 3.log │ │ │ │ ├── 5.log │ │ │ │ ├── 7.log │ │ │ │ ├── 8.log │ │ │ │ ├── build.xml │ │ │ │ ├── log │ │ │ │ ├── program.dat │ │ │ │ └── workflow │ │ │ │ │ ├── 10.xml │ │ │ │ │ ├── 11.xml │ │ │ │ │ ├── 12.xml │ │ │ │ │ ├── 13.xml │ │ │ │ │ ├── 14.xml │ │ │ │ │ ├── 15.xml │ │ │ │ │ ├── 16.xml │ │ │ │ │ ├── 17.xml │ │ │ │ │ ├── 18.xml │ │ │ │ │ ├── 2.xml │ │ │ │ │ ├── 3.xml │ │ │ │ │ ├── 4.xml │ │ │ │ │ ├── 5.xml │ │ │ │ │ ├── 6.xml │ │ │ │ │ ├── 7.xml │ │ │ │ │ ├── 8.xml │ │ │ │ │ └── 9.xml │ │ │ ├── lastFailedBuild │ │ │ ├── lastStableBuild │ │ │ ├── lastSuccessfulBuild │ │ │ ├── lastUnstableBuild │ │ │ ├── lastUnsuccessfulBuild │ │ │ └── legacyIds │ │ │ ├── config.xml │ │ │ ├── lastStable │ │ │ ├── lastSuccessful │ │ │ └── nextBuildNumber │ ├── plugins.txt │ ├── secrets │ │ ├── hudson.util.Secret │ │ ├── master.key │ │ └── slave-to-master-security-kill-switch │ └── users │ │ └── admin │ │ └── config.xml └── kubectl │ ├── Dockerfile │ └── Makefile ├── docs ├── local-environment.md ├── script-variables.md ├── using-scripts.md └── using-vagrant.md ├── github ├── hugo-app-jenkins │ ├── Dockerfile │ └── Jenkinsfile ├── hugo-app-travis │ ├── .travis.yml │ ├── Dockerfile │ └── kubeconfig └── hugo-app-wercker │ ├── kubeconfig │ └── wercker.yml ├── kubernetes ├── cluster-autoscaler │ └── cluster-autoscaler-deploy.yaml ├── hugo-app-blue-green │ ├── hugo-app-blue-green-deploy-blue.yaml │ ├── hugo-app-blue-green-deploy-green.yaml │ └── hugo-app-blue-green-svc.yaml ├── hugo-app-canary │ ├── hugo-app-canary-deploy-red.yaml │ ├── hugo-app-canary-deploy-yellow.yaml │ └── hugo-app-canary-svc.yaml ├── hugo-app-federation │ ├── hugo-app-federation-deploy.yaml │ └── hugo-app-federation-svc.yaml ├── hugo-app-rolling-update │ ├── hugo-app-rolling-update-deploy.yaml │ └── hugo-app-rolling-update-svc.yaml ├── hugo-app │ ├── hugo-app-deploy.yaml │ └── hugo-app-svc.yaml ├── jenkins │ ├── jenkins-deploy.yaml │ ├── jenkins-per-vol-claim.yaml │ └── jenkins-svc.yaml ├── rbac │ ├── full-access-cluster-role-binding.yml │ └── full-access-cluster-role.yml └── windows │ ├── iis-app │ ├── iis-app-deploy.yaml │ └── iis-app-svc.yaml │ ├── iis-default │ ├── iis-default-deploy.yaml │ └── iis-default-svc.yaml │ ├── mongodb-linux │ ├── mongodb-linux-dep.yaml │ └── mongodb-linux-svc.yaml │ ├── nginx-linux │ ├── nginx-linux-deploy.yaml │ └── nginx-linux-svc.yaml │ └── react-bookmarks-windows │ ├── react-bookmarks-windows-dep.yaml │ └── react-bookmarks-windows-svc.yaml ├── scripts ├── addons │ ├── cluster-autoscaler │ │ ├── deploy-cluster-autoscaler.sh │ │ └── policy-cluster-autoscaler.json │ ├── heapster-monitoring │ │ └── deploy-heapster-monitoring.sh │ └── kubernetes-dashboard │ │ └── deploy-dashboard.sh ├── apps │ ├── dns-records │ │ ├── dns-record-federation.json │ │ └── dns-record-single.json │ ├── horizontal-pod-autoscaling │ │ ├── deploy-hpa-app.sh │ │ └── test-hpa-app.sh │ ├── hugo-app-blue-green │ │ └── deploy-hugo-app-blue-green.sh │ ├── hugo-app-canary │ │ └── deploy-hugo-app-canary.sh │ ├── hugo-app-federation │ │ └── deploy-hugo-app-federation.sh │ ├── hugo-app-rolling-update │ │ └── deploy-hugo-app-rolling-update.sh │ ├── hugo-app │ │ └── deploy-hugo-app.sh │ ├── jenkins │ │ └── deploy-jenkins.sh │ └── windows │ │ ├── iis-app │ │ └── deploy-windows-iis-app.sh │ │ └── iis-default │ │ └── deploy-windows-iis-default.sh ├── clusters │ ├── create-cluster.sh │ ├── delete-cluster.sh │ ├── federation │ │ └── create-federation.sh │ └── windows │ │ ├── create-windows-node.sh │ │ └── delete-windows-node.sh ├── provision-vagrant.sh └── variables.sh └── terraform ├── .gitkeep └── k8s-windows-node-aws ├── init.tpl ├── main.tf ├── modules ├── main.tf └── variables.tf ├── outputs.tf ├── provision └── provision-k8s-windows.ps1 └── variables.tf /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant/* 2 | temp/* 3 | hugo-app/* 4 | hugo-app-jenkins/* 5 | hugo-app-travis/* 6 | hugo-app-wercker/* 7 | terraform/k8s-windows-node-aws/.terraform/* 8 | terraform/k8s-windows-node-aws/terraform.tfstate* -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Steven Eschinger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Getting to Know K8s - A Blog Series About All Things Kubernetes 2 | 3 | The repository for the [Getting to Know K8s blog series](https://kumorilabs.com/blog/k8s-0-introduction-blog-series-kubernetes/) on [KumoriLabs.com](https://kumorilabs.com): 4 | 5 | * [Introduction: A Blog Series About All Things Kubernetes](https://kumorilabs.com/blog/k8s-0-introduction-blog-series-kubernetes/) 6 | * [Lab #1: Deploy a Kubernetes Cluster in AWS with Kops](https://kumorilabs.com/blog/k8s-1-deploy-kubernetes-cluster-aws-kops/) 7 | * [Lab #2: Maintaining your Kubernetes Cluster](https://kumorilabs.com/blog/k8s-2-maintaining-your-kubernetes-cluster/) 8 | * [Lab #3: Creating Deployments & Services in Kubernetes](https://kumorilabs.com/blog/k8s-3-create-deployments-services-kubernetes/) 9 | * [Lab #4: Deployment Strategies: Rolling Updates, Canary & Blue-Green](https://kumorilabs.com/blog/k8s-4-deployments-rolling-updates-canary-blue-green-kubernetes/) 10 | * [Lab #5: Setup Horizontal Pod & Cluster Autoscaling in Kubernetes](https://kumorilabs.com/blog/k8s-5-setup-horizontal-pod-cluster-autoscaling-kubernetes/) 11 | * [Lab #6: Integrating Jenkins and Kubernetes](https://kumorilabs.com/blog/k8s-6-integrating-jenkins-kubernetes/) 12 | * [Lab #7: Continuous Deployment with Jenkins and Kubernetes](https://kumorilabs.com/blog/k8s-7-continuous-deployment-jenkins-kubernetes/) 13 | * [Lab #8: Continuous Deployment with Travis CI and Kubernetes](https://kumorilabs.com/blog/k8s-8-continuous-deployment-travis-ci-kubernetes/) 14 | * [Lab #9: Continuous Deployment with Wercker and Kubernetes](https://kumorilabs.com/blog/k8s-9-continuous-deployment-wercker-kubernetes/) 15 | * [Lab #10: Setup Kubernetes Federation Between Clusters in Different AWS Regions](https://kumorilabs.com/blog/k8s-10-setup-kubernetes-federation-different-aws-regions/) 16 | 17 | 18 | # Getting Started 19 | 20 | All of the posts in the blog series are structured as individual labs and although it is not required to go through them sequentially, it is recommended. 21 | 22 | ### Prerequisites 23 | 24 | **AWS Account:** Amazon will be the IaaS provider we will be using and therefore you will need to have an AWS account. If you don't have an account, you can [sign-up for an AWS Free Tier account](https://aws.amazon.com/free/), which will give you a certain amount of usage of specific AWS resources for free each month for 12 months. 25 | 26 | **AWS Route 53 Domain:** In addition to the AWS account, you will also need to have a public domain hosted in AWS Route 53, which is a requirement to deploy clusters with Kops. If you don't already have a domain in Route 53 that you can use, refer to the [Kops documentation](https://github.com/kubernetes/kops/blob/master/docs/aws.md#configure-dns) for instructions on how to setup one of the three supported scenarios. 27 | 28 | **GitHub Account:** We will be creating a demo website with [Hugo](https://gohugo.io/), which will be used in multiple labs. The source for the Hugo site will need to be stored in a GitHub repository owned by you. If you don't already have a GitHub account, you can create a free account [here](https://github.com/join). 29 | 30 | **Docker Hub Account:** The Docker images for the Hugo site need to be stored in a Docker Hub repository owned by you. If you don't already have a Docker Hub account, you can create a free account [here](https://hub.docker.com/). 31 | 32 | ### Lab Environment 33 | 34 | For the execution of the labs, you can choose to use the provided [Vagrantfile](Vagrantfile) to provision a Vagrant box which has everything you will need already installed or you can install the required tools on your local host: 35 | 36 | * [Using Vagrant](/docs/using-vagrant.md) 37 | * [Using your local host](/docs/local-environment.md) -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # All Vagrant configuration is done below. The "2" in Vagrant.configure 5 | # configures the configuration version (we support older styles for 6 | # backwards compatibility). Please don't change it unless you know what 7 | # you're doing. 8 | 9 | # Define variables for AWS CLI authentication from host 10 | aws_access_key_id = ENV['AWS_ACCESS_KEY_ID'] 11 | aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] 12 | 13 | # Define variables for path to SSH public & private keys for AWS from host 14 | aws_keypair_pub_key_path = "~/.ssh/id_rsa.pub" 15 | aws_keypair_pri_key_path = "~/.ssh/id_rsa" 16 | 17 | Vagrant.configure(2) do |config| 18 | config.vm.box = "ubuntu/trusty64" 19 | config.vm.provider "virtualbox" do |vb| 20 | vb.memory = 2048 21 | vb.cpus = 2 22 | end 23 | 24 | # Copy SSH public & private keys for AWS to guest 25 | config.vm.provision "file", source: "#{aws_keypair_pub_key_path}", destination: "/home/vagrant/.ssh/id_rsa.pub" 26 | config.vm.provision "file", source: "#{aws_keypair_pri_key_path}", destination: "/home/vagrant/.ssh/id_rsa" 27 | 28 | # Write AWS CLI authentication ENV variables to ~/.profile on guest | Warn if variables are not set on host 29 | if ENV['AWS_ACCESS_KEY_ID'] 30 | config.vm.provision "shell", privileged: false, inline: <<-SHELL 31 | echo "export AWS_ACCESS_KEY_ID=#{aws_access_key_id}" >>~/.profile 32 | echo "export AWS_SECRET_ACCESS_KEY=#{aws_secret_access_key}" >>~/.profile 33 | SHELL 34 | else 35 | config.vm.post_up_message = "AWS API credential variables not found on host; You must set them manually on guest" 36 | end 37 | 38 | # Run the provision-vagrant.sh script 39 | config.vm.provision "shell", privileged: false, path: "scripts/provision-vagrant.sh" 40 | 41 | # Set path at login to /vagrant/ 42 | config.vm.provision "shell", privileged: false, inline: <<-SHELL 43 | echo "cd /vagrant/" >> /home/vagrant/.bashrc 44 | SHELL 45 | 46 | end -------------------------------------------------------------------------------- /docker/html-proofer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:2.4.1-alpine 2 | MAINTAINER Steven Eschinger 3 | 4 | USER root 5 | 6 | RUN apk add --no-cache libcurl 7 | 8 | RUN apk add --no-cache --virtual .build-deps \ 9 | build-base \ 10 | libxml2-dev \ 11 | libxslt-dev 12 | 13 | RUN gem install html-proofer 14 | 15 | RUN apk del .build-deps -------------------------------------------------------------------------------- /docker/html-proofer/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all build 2 | 3 | DOCKER = docker 4 | REPO = smesch 5 | NAME = html-proofer 6 | VERSION = latest 7 | 8 | all: build 9 | 10 | build: 11 | $(DOCKER) build -t $(NAME) --rm . 12 | 13 | tag: build 14 | $(DOCKER) tag $(NAME) $(REPO)/$(NAME):$(VERSION) 15 | 16 | push: tag 17 | $(DOCKER) push $(REPO)/$(NAME):$(VERSION) 18 | -------------------------------------------------------------------------------- /docker/hugo-app/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | MAINTAINER Steven Eschinger 3 | 4 | ENV HUGO_VERSION="0.20" 5 | ENV GITHUB_USERNAME="smesch" 6 | ENV DOCKER_IMAGE_NAME="hugo-app" 7 | 8 | USER root 9 | 10 | RUN apk add --update \ 11 | wget \ 12 | git \ 13 | ca-certificates 14 | 15 | RUN wget --quiet https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz && \ 16 | tar -xf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz && \ 17 | chmod +x hugo_${HUGO_VERSION}_linux_amd64/hugo_${HUGO_VERSION}_linux_amd64 && \ 18 | mv hugo_${HUGO_VERSION}_linux_amd64/hugo_${HUGO_VERSION}_linux_amd64 /usr/local/bin/hugo && \ 19 | rm -rf hugo_${HUGO_VERSION}_linux_amd64/ hugo_${HUGO_VERSION}_Linux-64bit.tar.gz 20 | 21 | RUN git clone https://github.com/${GITHUB_USERNAME}/${DOCKER_IMAGE_NAME}.git 22 | 23 | RUN hugo -s ${DOCKER_IMAGE_NAME} -d /usr/share/nginx/html/ --uglyURLs 24 | 25 | CMD nginx -g "daemon off;" 26 | -------------------------------------------------------------------------------- /docker/hugo/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | MAINTAINER Steven Eschinger 3 | 4 | ENV HUGO_VERSION=0.20.5 5 | 6 | USER root 7 | 8 | RUN apk add --update \ 9 | wget \ 10 | ca-certificates \ 11 | jq 12 | 13 | RUN wget https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz && \ 14 | tar xzf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz && \ 15 | mv hugo /usr/bin/hugo && \ 16 | rm -rf hugo_${HUGO_VERSION}_linux_amd64/ -------------------------------------------------------------------------------- /docker/hugo/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all build 2 | 3 | DOCKER = docker 4 | REPO = smesch 5 | NAME = hugo 6 | VERSION = latest 7 | 8 | all: build 9 | 10 | build: 11 | $(DOCKER) build -t $(NAME) --rm . 12 | 13 | tag: build 14 | $(DOCKER) tag $(NAME) $(REPO)/$(NAME):$(VERSION) 15 | 16 | push: tag 17 | $(DOCKER) push $(REPO)/$(NAME):$(VERSION) 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM jenkins:2.46.2 2 | MAINTAINER Steven Eschinger 3 | 4 | USER root 5 | RUN apt-get update 6 | USER ${user} 7 | 8 | COPY config.xml /usr/share/jenkins/ref/config.xml 9 | COPY executors.groovy /usr/share/jenkins/ref/init.groovy.d/executors.groovy 10 | COPY jobs /usr/share/jenkins/ref/jobs 11 | COPY secrets /usr/share/jenkins/ref/secrets 12 | COPY users /usr/share/jenkins/ref/users 13 | COPY plugins.txt /usr/share/jenkins/plugins.txt 14 | RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt 15 | RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state 16 | 17 | ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"] 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2.46.2 5 | 0 6 | NORMAL 7 | true 8 | 9 | true 10 | 11 | 12 | true 13 | false 14 | 15 | false 16 | 17 | ${JENKINS_HOME}/workspace/${ITEM_FULLNAME} 18 | ${ITEM_ROOTDIR}/builds 19 | 20 | 21 | 22 | 23 | 24 | 25 | kubernetes 26 | 27 | 28 | https://kubernetes.default.svc.cluster.local 29 | true 30 | default 31 | http://jenkins-leader-svc.default.svc.cluster.local 32 | 10 33 | 5 34 | 0 35 | 0 36 | 37 | 38 | 5 39 | 0 40 | 41 | 42 | 43 | all 44 | false 45 | false 46 | 47 | 48 | 49 | all 50 | 50000 51 | 52 | 53 | true 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/executors.groovy: -------------------------------------------------------------------------------- 1 | import jenkins.model.* 2 | Jenkins.instance.setNumExecutors(0) -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/10.log: -------------------------------------------------------------------------------- 1 | [test-pipeline] Running shell script 2 | Executing shell script inside container [golang] of pod [kubernetes-44f32cf861204c05be0b8d11b1befbb8-1e3f52fc680] 3 | Executing command: sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/jenkins-result.txt' 4 | # cd "/home/jenkins/workspace/test-pipeline" 5 | sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/jenkins-result.txt' 6 | exit 7 | # # + go version 8 | go version go1.8.1 linux/amd64 9 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/3.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/3.log -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/5.log: -------------------------------------------------------------------------------- 1 | Still waiting to schedule task 2 | kubernetes-44f32cf861204c05be0b8d11b1befbb8-1e3f52fc680 is offline 3 | Running on kubernetes-44f32cf861204c05be0b8d11b1befbb8-1e3f52fc680 in /home/jenkins/workspace/test-pipeline 4 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/7.log: -------------------------------------------------------------------------------- 1 | Using the ‘stage’ step without a block argument is deprecated 2 | Entering stage Switch to Utility Container 3 | Proceeding 4 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/8.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/8.log -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | admin 9 | 10 | 1 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 0 23 | 1 24 | 25 | pod-golang 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 1 43 | 1494351792901 44 | 1494351792904 45 | SUCCESS 46 | 41413 47 | false 48 | 49 | SUCCESS 50 | 70 | 71 | true 72 | 17 73 | 1:17 74 | 75 | 76 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/log: -------------------------------------------------------------------------------- 1 | Started by user ha:////4JfQv/aCYodeFa/ONBJu4SaK1XkMRS3UJNRF8vo1RuTVAAAAlx+LCAAAAAAAAP9b85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAzWEgZu/dLi1CL9xJTczDwAj6GcLcAAAAA=admin 2 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] podTemplate 3 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] { 4 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] node 5 | Still waiting to schedule task 6 | kubernetes-44f32cf861204c05be0b8d11b1befbb8-1e3f52fc680 is offline 7 | Running on kubernetes-44f32cf861204c05be0b8d11b1befbb8-1e3f52fc680 in /home/jenkins/workspace/test-pipeline 8 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] { 9 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] stage (Switch to Utility Container) 10 | Using the ‘stage’ step without a block argument is deprecated 11 | Entering stage Switch to Utility Container 12 | Proceeding 13 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] container 14 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] { 15 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] sh 16 | [test-pipeline] Running shell script 17 | Executing shell script inside container [golang] of pod [kubernetes-44f32cf861204c05be0b8d11b1befbb8-1e3f52fc680] 18 | Executing command: sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/jenkins-result.txt' 19 | # cd "/home/jenkins/workspace/test-pipeline" 20 | sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-7cb94e66/jenkins-result.txt' 21 | exit 22 | # # + go version 23 | go version go1.8.1 linux/amd64 24 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] } 25 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] // container 26 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] } 27 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] // node 28 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] } 29 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] // podTemplate 30 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] End of Pipeline 31 | Finished: SUCCESS 32 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/program.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/program.dat -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 6 | 7 | 10 8 | org.jenkinsci.plugins.workflow.steps.durable_task.ShellStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494351833899 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 6 | 7 | 11 8 | 9 9 | 10 | 11 | 12 | 13 | 1494351834206 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 6 | 7 | 12 8 | 8 9 | 10 | 11 | 12 | 1494351834216 13 | 14 | 15 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 6 | 7 | 13 8 | 6 9 | 10 | 11 | 12 | 13 | 1494351834225 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 6 | 7 | 14 8 | 5 9 | 10 | 11 | 12 | 1494351834241 13 | 14 | 15 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 6 | 7 | 15 8 | 4 9 | 10 | 11 | 12 | 13 | 1494351834244 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 6 | 7 | 16 8 | 3 9 | 10 | 11 | 12 | 1494351834250 13 | 14 | 15 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 6 | 7 | 17 8 | 2 9 | 10 | SUCCESS 11 | 0 12 | BLUE 13 | true 14 | 15 | 16 | 17 | 18 | 1494351834284 19 | 20 | 21 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 2 6 | 7 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 2 6 | 7 | 3 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494351793527 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 3 6 | 7 | 4 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStep 9 | 10 | 11 | 12 | 13 | 1494351793542 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 4 6 | 7 | 5 8 | org.jenkinsci.plugins.workflow.support.steps.ExecutorStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494351793636 16 | 17 | 18 | kubernetes-44f32cf861204c05be0b8d11b1befbb8-1e3f52fc680 19 | /home/jenkins/workspace/test-pipeline 20 | 21 | pod-golang 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 5 6 | 7 | 6 8 | org.jenkinsci.plugins.workflow.support.steps.ExecutorStep 9 | 10 | 11 | 12 | 13 | 1494351831876 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 6 | 7 | 7 8 | org.jenkinsci.plugins.workflow.support.steps.StageStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | Switch to Utility Container 16 | 17 | 18 | Switch to Utility Container 19 | 20 | 21 | 1494351831935 22 | 23 | 24 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 6 | 7 | 8 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494351832290 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/1/workflow/9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 6 | 7 | 9 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerStep 9 | 10 | 11 | 12 | 13 | 1494351832291 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/10.log: -------------------------------------------------------------------------------- 1 | [test-pipeline] Running shell script 2 | Executing shell script inside container [golang] of pod [kubernetes-91c2fd6a1c2348199b21976bd168f76d-21bb989f4b3] 3 | Executing command: sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/jenkins-result.txt' 4 | # cd "/home/jenkins/workspace/test-pipeline" 5 | # sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/jenkins-result.txt' 6 | exit 7 | # + go version 8 | go version go1.8.1 linux/amd64 9 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/3.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/3.log -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/5.log: -------------------------------------------------------------------------------- 1 | Running on kubernetes-91c2fd6a1c2348199b21976bd168f76d-21bb989f4b3 in /home/jenkins/workspace/test-pipeline 2 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/7.log: -------------------------------------------------------------------------------- 1 | Using the ‘stage’ step without a block argument is deprecated 2 | Entering stage Switch to Utility Container 3 | Proceeding 4 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/8.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/8.log -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | admin 9 | 10 | 1 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 0 23 | 1 24 | 25 | pod-golang 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 3 43 | 1494352030533 44 | 1494352030533 45 | SUCCESS 46 | 13891 47 | false 48 | 49 | SUCCESS 50 | 70 | 71 | true 72 | 17 73 | 1:17 74 | 75 | 76 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/log: -------------------------------------------------------------------------------- 1 | Started by user ha:////4JfQv/aCYodeFa/ONBJu4SaK1XkMRS3UJNRF8vo1RuTVAAAAlx+LCAAAAAAAAP9b85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAzWEgZu/dLi1CL9xJTczDwAj6GcLcAAAAA=admin 2 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] podTemplate 3 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] { 4 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] node 5 | Running on kubernetes-91c2fd6a1c2348199b21976bd168f76d-21bb989f4b3 in /home/jenkins/workspace/test-pipeline 6 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] { 7 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] stage (Switch to Utility Container) 8 | Using the ‘stage’ step without a block argument is deprecated 9 | Entering stage Switch to Utility Container 10 | Proceeding 11 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] container 12 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] { 13 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] sh 14 | [test-pipeline] Running shell script 15 | Executing shell script inside container [golang] of pod [kubernetes-91c2fd6a1c2348199b21976bd168f76d-21bb989f4b3] 16 | Executing command: sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/jenkins-result.txt' 17 | # cd "/home/jenkins/workspace/test-pipeline" 18 | # sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-003e6bb5/jenkins-result.txt' 19 | exit 20 | # + go version 21 | go version go1.8.1 linux/amd64 22 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] } 23 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] // container 24 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] } 25 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] // node 26 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] } 27 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] // podTemplate 28 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] End of Pipeline 29 | Finished: SUCCESS 30 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/program.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/program.dat -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 6 | 7 | 10 8 | org.jenkinsci.plugins.workflow.steps.durable_task.ShellStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494352044103 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 6 | 7 | 11 8 | 9 9 | 10 | 11 | 12 | 13 | 1494352044376 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 6 | 7 | 12 8 | 8 9 | 10 | 11 | 12 | 1494352044380 13 | 14 | 15 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 6 | 7 | 13 8 | 6 9 | 10 | 11 | 12 | 13 | 1494352044386 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 6 | 7 | 14 8 | 5 9 | 10 | 11 | 12 | 1494352044396 13 | 14 | 15 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 6 | 7 | 15 8 | 4 9 | 10 | 11 | 12 | 13 | 1494352044399 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 6 | 7 | 16 8 | 3 9 | 10 | 11 | 12 | 1494352044402 13 | 14 | 15 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 6 | 7 | 17 8 | 2 9 | 10 | SUCCESS 11 | 0 12 | BLUE 13 | true 14 | 15 | 16 | 17 | 18 | 1494352044422 19 | 20 | 21 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 2 6 | 7 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 2 6 | 7 | 3 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494352030622 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 3 6 | 7 | 4 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStep 9 | 10 | 11 | 12 | 13 | 1494352030623 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 4 6 | 7 | 5 8 | org.jenkinsci.plugins.workflow.support.steps.ExecutorStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494352030636 16 | 17 | 18 | kubernetes-91c2fd6a1c2348199b21976bd168f76d-21bb989f4b3 19 | /home/jenkins/workspace/test-pipeline 20 | 21 | pod-golang 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 5 6 | 7 | 6 8 | org.jenkinsci.plugins.workflow.support.steps.ExecutorStep 9 | 10 | 11 | 12 | 13 | 1494352042436 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 6 | 7 | 7 8 | org.jenkinsci.plugins.workflow.support.steps.StageStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | Switch to Utility Container 16 | 17 | 18 | Switch to Utility Container 19 | 20 | 21 | 1494352042446 22 | 23 | 24 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 6 | 7 | 8 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494352042932 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/2/workflow/9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 6 | 7 | 9 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerStep 9 | 10 | 11 | 12 | 13 | 1494352042933 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/10.log: -------------------------------------------------------------------------------- 1 | [test-pipeline] Running shell script 2 | Executing shell script inside container [golang] of pod [kubernetes-c4798d15e2fd4cd68a5d94536fcbe93f-22e59e9de29] 3 | Executing command: sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/jenkins-result.txt' 4 | # cd "/home/jenkins/workspace/test-pipeline" 5 | sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/jenkins-result.txt' 6 | exit 7 | # # + go version 8 | go version go1.8.1 linux/amd64 9 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/11.log: -------------------------------------------------------------------------------- 1 | [test-pipeline] Running shell script 2 | Executing shell script inside container [golang] of pod [kubernetes-c4798d15e2fd4cd68a5d94536fcbe93f-22e59e9de29] 3 | Executing command: sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/jenkins-result.txt' 4 | # cd "/home/jenkins/workspace/test-pipeline" 5 | sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/jenkins-result.txt' 6 | exit 7 | # + sleep 60 8 | Cannot contact kubernetes-c4798d15e2fd4cd68a5d94536fcbe93f-22e59e9de29: java.io.IOException: corrupted content in /home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/pid: java.lang.NumberFormatException: For input string: "" 9 | # -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/3.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/3.log -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/5.log: -------------------------------------------------------------------------------- 1 | Running on kubernetes-c4798d15e2fd4cd68a5d94536fcbe93f-22e59e9de29 in /home/jenkins/workspace/test-pipeline 2 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/7.log: -------------------------------------------------------------------------------- 1 | Using the ‘stage’ step without a block argument is deprecated 2 | Entering stage Switch to Utility Container 3 | Proceeding 4 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/8.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/8.log -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | admin 9 | 10 | 1 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 0 23 | 1 24 | 25 | pod-golang 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 5 43 | 1494352116537 44 | 1494352116538 45 | SUCCESS 46 | 75839 47 | false 48 | 49 | SUCCESS 50 | 71 | 72 | true 73 | 18 74 | 1:18 75 | 76 | 77 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/log: -------------------------------------------------------------------------------- 1 | Started by user ha:////4JfQv/aCYodeFa/ONBJu4SaK1XkMRS3UJNRF8vo1RuTVAAAAlx+LCAAAAAAAAP9b85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAzWEgZu/dLi1CL9xJTczDwAj6GcLcAAAAA=admin 2 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] podTemplate 3 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] { 4 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] node 5 | Running on kubernetes-c4798d15e2fd4cd68a5d94536fcbe93f-22e59e9de29 in /home/jenkins/workspace/test-pipeline 6 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] { 7 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] stage (Switch to Utility Container) 8 | Using the ‘stage’ step without a block argument is deprecated 9 | Entering stage Switch to Utility Container 10 | Proceeding 11 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] container 12 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] { 13 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] sh 14 | [test-pipeline] Running shell script 15 | Executing shell script inside container [golang] of pod [kubernetes-c4798d15e2fd4cd68a5d94536fcbe93f-22e59e9de29] 16 | Executing command: sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/jenkins-result.txt' 17 | # cd "/home/jenkins/workspace/test-pipeline" 18 | sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-77513d2e/jenkins-result.txt' 19 | exit 20 | # # + go version 21 | go version go1.8.1 linux/amd64 22 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] sh 23 | [test-pipeline] Running shell script 24 | Executing shell script inside container [golang] of pod [kubernetes-c4798d15e2fd4cd68a5d94536fcbe93f-22e59e9de29] 25 | Executing command: sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/jenkins-result.txt' 26 | # cd "/home/jenkins/workspace/test-pipeline" 27 | sh -c echo $$ > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/pid'; jsc=durable-c87f73938bfddb9e385474be4b9a770d; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/script.sh' > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/jenkins-result.txt' 28 | exit 29 | # + sleep 60 30 | Cannot contact kubernetes-c4798d15e2fd4cd68a5d94536fcbe93f-22e59e9de29: java.io.IOException: corrupted content in /home/jenkins/workspace/test-pipeline@tmp/durable-636ac2ec/pid: java.lang.NumberFormatException: For input string: "" 31 | # ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] } 32 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] // container 33 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] } 34 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] // node 35 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] } 36 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] // podTemplate 37 | ha:////4AhWCRivhrMPpHgDmuvwHk4GnMussNktNsb2R8odccJpAAAAaB+LCAAAAAAAAP9b85aBtbiIwTG/KF0vKzUvOzOvODlTryCnNB3I0ivPL8pOy8kv18vKT9JLzs8rzs9J1QuHCgaV5jlDhPzyS1IZIICRiYGhoohBKqM0pTg/D64Hh8ICAFt0h+h/AAAA[Pipeline] End of Pipeline 38 | Finished: SUCCESS 39 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/program.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/program.dat -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 6 | 7 | 10 8 | org.jenkinsci.plugins.workflow.steps.durable_task.ShellStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494352123954 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 6 | 7 | 11 8 | org.jenkinsci.plugins.workflow.steps.durable_task.ShellStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494352124330 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 6 | 7 | 12 8 | 9 9 | 10 | 11 | 12 | 13 | 1494352192321 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 6 | 7 | 13 8 | 8 9 | 10 | 11 | 12 | 1494352192329 13 | 14 | 15 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 6 | 7 | 14 8 | 6 9 | 10 | 11 | 12 | 13 | 1494352192334 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 6 | 7 | 15 8 | 5 9 | 10 | 11 | 12 | 1494352192348 13 | 14 | 15 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 6 | 7 | 16 8 | 4 9 | 10 | 11 | 12 | 13 | 1494352192356 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 16 6 | 7 | 17 8 | 3 9 | 10 | 11 | 12 | 1494352192361 13 | 14 | 15 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 17 6 | 7 | 18 8 | 2 9 | 10 | SUCCESS 11 | 0 12 | BLUE 13 | true 14 | 15 | 16 | 17 | 18 | 1494352192375 19 | 20 | 21 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 2 6 | 7 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 2 6 | 7 | 3 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494352116601 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 3 6 | 7 | 4 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStep 9 | 10 | 11 | 12 | 13 | 1494352116602 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 4 6 | 7 | 5 8 | org.jenkinsci.plugins.workflow.support.steps.ExecutorStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494352116617 16 | 17 | 18 | kubernetes-c4798d15e2fd4cd68a5d94536fcbe93f-22e59e9de29 19 | /home/jenkins/workspace/test-pipeline 20 | 21 | pod-golang 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 5 6 | 7 | 6 8 | org.jenkinsci.plugins.workflow.support.steps.ExecutorStep 9 | 10 | 11 | 12 | 13 | 1494352122443 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 6 | 7 | 7 8 | org.jenkinsci.plugins.workflow.support.steps.StageStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | Switch to Utility Container 16 | 17 | 18 | Switch to Utility Container 19 | 20 | 21 | 1494352122468 22 | 23 | 24 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 6 | 7 | 8 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerStep 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 1494352122911 16 | 17 | 18 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/3/workflow/9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 6 | 7 | 9 8 | org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerStep 9 | 10 | 11 | 12 | 13 | 1494352122914 14 | 15 | 16 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/lastFailedBuild: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/lastFailedBuild -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/lastStableBuild: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/lastStableBuild -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/lastSuccessfulBuild: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/lastSuccessfulBuild -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/lastUnstableBuild: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/lastUnstableBuild -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/lastUnsuccessfulBuild: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/lastUnsuccessfulBuild -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/legacyIds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/builds/legacyIds -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 32 | true 33 | 34 | 35 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/lastStable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/lastStable -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/lastSuccessful: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/jobs/test-pipeline/lastSuccessful -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/jobs/test-pipeline/nextBuildNumber: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/plugins.txt: -------------------------------------------------------------------------------- 1 | external-monitor-job:1.7 2 | pipeline-build-step:2.5 3 | pipeline-model-declarative-agent:1.1.1 4 | durable-task:1.13 5 | workflow-cps:2.30 6 | workflow-support:2.14 7 | token-macro:2.1 8 | icon-shim:2.0.3 9 | authentication-tokens:1.3 10 | pipeline-github-lib:1.0 11 | workflow-cps-global-lib:2.8 12 | workflow-basic-steps:2.4 13 | workflow-step-api:2.9 14 | credentials-binding:1.11 15 | pipeline-graph-analysis:1.3 16 | mailer:1.20 17 | pipeline-stage-tags-metadata:1.1.4 18 | pipeline-stage-step:2.2 19 | docker-workflow:1.11 20 | ace-editor:1.1 21 | git:3.3.0 22 | timestamper:1.8.8 23 | ssh-credentials:1.13 24 | ldap:1.15 25 | pipeline-rest-api:2.6 26 | build-timeout:1.18 27 | workflow-api:2.13 28 | matrix-auth:1.5 29 | pipeline-model-api:1.1.4 30 | ant:1.5 31 | scm-api:2.1.1 32 | kubernetes:0.11 33 | display-url-api:2.0 34 | workflow-job:2.10 35 | git-client:2.4.5 36 | pipeline-stage-view:2.6 37 | handlebars:1.1.1 38 | matrix-project:1.10 39 | pipeline-model-definition:1.1.4 40 | workflow-durable-task-step:2.11 41 | junit:1.20 42 | cloudbees-folder:6.0.4 43 | github-branch-source:2.0.5 44 | email-ext:2.57.2 45 | subversion:2.7.2 46 | docker-commons:1.6 47 | mapdb-api:1.0.9.0 48 | momentjs:1.1.1 49 | github:1.27.0 50 | antisamy-markup-formatter:1.5 51 | script-security:1.27 52 | resource-disposer:0.6 53 | workflow-multibranch:2.14 54 | ws-cleanup:0.33 55 | branch-api:2.0.9 56 | workflow-scm-step:2.4 57 | github-api:1.85 58 | credentials:2.1.13 59 | pipeline-input-step:2.7 60 | workflow-aggregator:2.5 61 | windows-slaves:1.3.1 62 | pam-auth:1.3 63 | pipeline-milestone-step:1.3.1 64 | github-organization-folder:1.6 65 | structs:1.6 66 | plain-credentials:1.4 67 | bouncycastle-api:2.16.1 68 | git-server:1.7 69 | pipeline-model-extensions:1.1.4 70 | ssh-slaves:1.17 71 | jquery-detached:1.2.1 72 | gradle:1.26 73 | -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/secrets/hudson.util.Secret: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/docker/jenkins-kubernetes-leader/secrets/hudson.util.Secret -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/secrets/master.key: -------------------------------------------------------------------------------- 1 | f99bad5aa8849ee632d0f2068a69b17077517f4e0a01a63c9b0a40d6da5340acff2230804a925ff0b906709425fda1f40f7b754bbfd37c6c3a1cdf92769809e219b81ff8f328a43673bb53774e6c2cebd8b65fb1cbbedf322182bbf54d4018ba1792801fcb1662448ef36f21ab15a431a44721b24f3508aa610d73b69f44c65c -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/secrets/slave-to-master-security-kill-switch: -------------------------------------------------------------------------------- 1 | false -------------------------------------------------------------------------------- /docker/jenkins-kubernetes-leader/users/admin/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | admin 4 | 5 | 6 | 7 | {AQAAABAAAAAw/WpdWaEIpfqtRsjwG+ER/FfdCaDOofJoe6vnU6KiJWlPSBLbDum2mnFVoDg5/rRoWM6YREYrcP3oJ5zyUREUwg==} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | authenticated 18 | 19 | 1494350604962 20 | 21 | 22 | 23 | 24 | 25 | 26 | all 27 | false 28 | false 29 | 30 | 31 | 32 | 33 | 34 | default 35 | 36 | 37 | 38 | 39 | 40 | #jbcrypt:$2a$10$WxhGtvyLn5aNUCKYsO4ImuzB9N82s3PcIKKLzuq7vmC89hn1m3krK 41 | 42 | 43 | 44 | 45 | 46 | false 47 | 48 | 49 | -------------------------------------------------------------------------------- /docker/kubectl/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | MAINTAINER Steven Eschinger 3 | 4 | ENV KUBECTL_VERSION=1.7.6 5 | 6 | USER root 7 | 8 | RUN apk add --update \ 9 | wget \ 10 | ca-certificates \ 11 | jq 12 | 13 | RUN wget https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl && \ 14 | chmod +x kubectl && \ 15 | mv kubectl /usr/bin/kubectl -------------------------------------------------------------------------------- /docker/kubectl/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all build 2 | 3 | DOCKER = docker 4 | REPO = smesch 5 | NAME = kubectl 6 | VERSION = 1.7.6 7 | 8 | all: build 9 | 10 | build: 11 | $(DOCKER) build -t $(NAME) --rm . 12 | 13 | tag: build 14 | $(DOCKER) tag $(NAME) $(REPO)/$(NAME):$(VERSION) 15 | 16 | push: tag 17 | $(DOCKER) push $(REPO)/$(NAME):$(VERSION) 18 | 19 | latest: push 20 | $(DOCKER) tag $(NAME) $(REPO)/$(NAME):latest 21 | $(DOCKER) push $(REPO)/$(NAME):latest -------------------------------------------------------------------------------- /docs/local-environment.md: -------------------------------------------------------------------------------- 1 | # Preparing Your Local Host Environment 2 | 3 | This guide will walk you through the preparation of your local environment if you chose to conduct the labs from your local host. As an alternative, you can go to the [Using Vagrant](/docs/using-vagrant.md) guide for the steps to create a Vagrant box with everything you need already installed. 4 | 5 | 6 | ## Installations 7 | 8 | Below are the tools you need to install on your local host. The commands below are for Linux and you can visit the links for instructions for other platforms. If you are using Windows 10, [installing Bash for Windows](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) and then running the commands below is recommended: 9 | 10 | * [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git), [Jq](https://stedolan.github.io/jq/download/), [Unzip](http://www.brocade.com/content/html/en/software-installation-guide/SDN-Controller-2.1.0-Software-Installation/GUID-0E81C58A-6F32-4862-9B0C-84F2DC8BA238.html), [Wget](https://www.gnu.org/software/wget/), [Python](https://www.python.org/downloads/) 11 | 12 | ```bash 13 | # apt-get 14 | sudo apt-get install git jq unzip wget python -y 15 | 16 | # yum 17 | sudo yum install epel-release -y 18 | sudo yum install git jq unzip wget python -y 19 | ``` 20 | 21 | * [AWS CLI](http://docs.aws.amazon.com/cli/latest/userguide/installing.html) 22 | 23 | ```bash 24 | curl https://s3.amazonaws.com/aws-cli/awscli-bundle.zip -o awscli-bundle.zip 25 | unzip awscli-bundle.zip 26 | sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws 27 | rm -rf awscli-bundle/ awscli-bundle.zip 28 | ``` 29 | 30 | * [Docker](https://docs.docker.com/engine/installation/) (If using Bash for Windows, [install Docker for Windows](https://www.docker.com/docker-windows) instead of running the commands below) 31 | 32 | ```bash 33 | sudo curl -sSL https://get.docker.com/ | sh 34 | sudo usermod -aG docker ${USER} 35 | ``` 36 | 37 | * [Hugo](https://gohugo.io/overview/installing/) 38 | 39 | ```bash 40 | export HUGO_VERSION="0.27.1" 41 | wget https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz 42 | tar -xf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz 43 | sudo chmod +x hugo 44 | sudo mv hugo /usr/local/bin/hugo 45 | rm -rf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz 46 | ``` 47 | 48 | * [Terraform](https://www.terraform.io/downloads.html) 49 | 50 | ```bash 51 | export TERRAFORM_VERSION="0.10.6" 52 | wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip 53 | unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip 54 | sudo chmod +x terraform 55 | sudo mv terraform /usr/local/bin/terraform 56 | rm -rf terraform_${TERRAFORM_VERSION}_linux_amd64.zip 57 | ``` 58 | 59 | * [Kubectl](https://kubernetes.io/docs/tasks/kubectl/install/) 60 | 61 | ```bash 62 | export KUBECTL_VERSION="1.7.6" 63 | wget https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl 64 | sudo chmod +x kubectl 65 | sudo mv kubectl /usr/local/bin/kubectl 66 | ``` 67 | 68 | * [Kubefed](https://kubernetes.io/docs/tutorials/federation/set-up-cluster-federation-kubefed/#getting-kubefed) 69 | 70 | ```bash 71 | export KUBEFED_VERSION="1.7.6" 72 | wget https://storage.googleapis.com/kubernetes-release/release/v${KUBEFED_VERSION}/bin/linux/amd64/kubefed 73 | sudo chmod +x kubefed 74 | sudo mv kubefed /usr/local/bin/kubefed 75 | ``` 76 | 77 | * [Kops](https://github.com/kubernetes/kops#installing) 78 | 79 | ```bash 80 | export KOPS_VERSION="1.7.0" 81 | wget https://github.com/kubernetes/kops/releases/download/${KOPS_VERSION}/kops-linux-amd64 82 | sudo chmod +x kops-linux-amd64 83 | sudo mv kops-linux-amd64 /usr/local/bin/kops 84 | ``` 85 | 86 | 87 | ## Clone the Repository 88 | 89 | ```bash 90 | git clone https://github.com/kumorilabs/getting-to-know-k8s 91 | cd getting-to-know-k8s 92 | ``` 93 | 94 | 95 | ## AWS API Credentials 96 | 97 | [Kops](https://github.com/kubernetes/kops#kubernetes-operations-kops), which we will be using to create Kubernetes clusters, requires you to have AWS API credentials configured. 98 | 99 | You can use your existing AWS user account or you can choose to create a dedicated user account for Kops. 100 | 101 | ### Use an existing AWS user account 102 | 103 | If you are using your existing AWS user account, you must have at a minimum the following [IAM policies attached](http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-using.html#policies_using-managed-console) to it (or you can use the `AdministratorAccess` policy which includes all of these permissions): 104 | 105 | ```console 106 | AmazonEC2FullAccess 107 | AmazonRoute53FullAccess 108 | AmazonS3FullAccess 109 | IAMFullAccess 110 | AmazonVPCFullAccess 111 | ``` 112 | 113 | ### Create a dedicated user account for Kops 114 | 115 | To create a dedicated user account for Kops, you can either use the management console or the AWS CLI: 116 | 117 | ```bash 118 | aws iam create-group --group-name kops 119 | 120 | export arns=" 121 | arn:aws:iam::aws:policy/AmazonEC2FullAccess 122 | arn:aws:iam::aws:policy/AmazonRoute53FullAccess 123 | arn:aws:iam::aws:policy/AmazonS3FullAccess 124 | arn:aws:iam::aws:policy/IAMFullAccess 125 | arn:aws:iam::aws:policy/AmazonVPCFullAccess" 126 | 127 | for arn in $arns; do aws iam attach-group-policy --policy-arn "$arn" --group-name kops; done 128 | 129 | aws iam create-user --user-name kops 130 | 131 | aws iam add-user-to-group --user-name kops --group-name kops 132 | 133 | aws iam create-access-key --user-name kops 134 | ``` 135 | 136 | You should record the values for `SecretAccessKey` and `AccessKeyID` in the returned JSON output, which are the AWS API credentials. 137 | 138 | ## Set the Required Environment Variables 139 | 140 | Before staring any of the labs, you need to set the environment variables below with the AWS API credentials of the AWS user account you will be using: 141 | 142 | ```bash 143 | export AWS_ACCESS_KEY_ID="AWS Access Key ID" 144 | export AWS_SECRET_ACCESS_KEY="AWS Secret Access Key" 145 | ``` 146 | 147 | If you are not familiar with how to retrieve these values for your existing AWS user account, refer to the [AWS documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html). 148 | 149 | 150 | ## SSH Public Key Path 151 | 152 | Kops also requires a SSH public key file, which is used to create an AWS EC2 key pair for AWS instances that are created when creating a cluster. 153 | 154 | If you don't have a SSH key available, refer to this [tutorial](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#platform-mac) from GitHub on how to create one. 155 | 156 | If your existing SSH public key file is not located in the default location (`~/.ssh/id_rsa.pub`), you will need to modify the `--ssh-public-key="~/.ssh/id_rsa.pub"` configuration option whenever creating clusters with Kops. 157 | 158 | 159 | ## Enjoy the Labs 160 | 161 | You are ready to proceed with the labs. 162 | -------------------------------------------------------------------------------- /docs/script-variables.md: -------------------------------------------------------------------------------- 1 | # Script Variables 2 | 3 | Before running any of the provided scripts, you need to update the [`/scripts/variables.sh`](/scripts/variables.sh) file. At a minimum, you must update the value for `DOMAIN_NAME` with the domain you have hosted in AWS Route 53: 4 | 5 | ```shell 6 | # General variables 7 | export DOMAIN_NAME="k8s.kumorilabs.com" # Must be updated 8 | 9 | # Cluster variables 10 | export CLUSTER_ALIAS="usa" 11 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" # Leave as-is 12 | export CLUSTER_AWS_REGION="us-east-1" 13 | export CLUSTER_AWS_AZ="us-east-1a" 14 | export CLUSTER_MASTER_SIZE="t2.medium" 15 | export CLUSTER_NODE_SIZE="t2.medium" 16 | export CLUSTER_NODE_COUNT="2" 17 | export AWS_KEYPAIR_PUB_KEY_PATH="~/.ssh/id_rsa.pub" 18 | export K8S_VERSION="1.7.6" 19 | 20 | # Federation variables 21 | export FEDERATION_NAME="fed" 22 | 23 | # Application variables 24 | export HUGO_APP_DOCKER_IMAGE="smesch/hugo-app" 25 | export JENKINS_DOCKER_IMAGE_TAG="smesch/jenkins-kubernetes-leader-custom:2.32.3" 26 | export DOMAIN_NAME_ZONE_ID=$(aws route53 list-hosted-zones \ 27 | | jq -r '.HostedZones[] | select(.Name=="'${DOMAIN_NAME}'.") | .Id' \ 28 | | sed 's/\/hostedzone\///') # Leave as-is 29 | ``` 30 | 31 | 32 | ### General Variables 33 | 34 | * `DOMAIN_NAME` - **Must Change**: Your domain name that is hosted in AWS Route 53, where the DNS records for your cluster will be created. This **value must be updated** with your own domain; otherwise Kops will fail to create the cluster 35 | 36 | 37 | ### Cluster Variables 38 | 39 | * `CLUSTER_ALIAS` - Friendly name to use as an alias for your cluster, such as `usa` or `eur` 40 | * `CLUSTER_FULL_NAME` - **Leave as-is**: Calculated value will be the full DNS name of you cluster, which is the cluster alias combined with your domain name (ex: `usa.k8s.kumorilabs.com`, `eur.k8s.kumorilabs.com`) 41 | * `CLUSTER_AWS_REGION` - AWS region where the cluster will be created 42 | * `CLUSTER_AWS_AZ` - AWS availability zone where the cluster will be created 43 | * `CLUSTER_MASTER_SIZE` - EC2 instance size of the master instance(s) that will be created for the cluster 44 | * `CLUSTER_NODE_SIZE` - EC2 instance size of the node instances that will be created for the cluster 45 | * `CLUSTER_NODE_COUNT` - Number of nodes that will be deployed in the cluster 46 | * `AWS_KEYPAIR_PUB_KEY_PATH` - If you are using Vagrant, you can leave this as-is. If running in your local environment, update this if your SSH public key file is not located in the default location `~/.ssh/id_rsa.pub` 47 | * `K8S_VERSION` - Version of Kubernetes that will be installed when deploying a cluster with Kops 48 | 49 | 50 | ### Federation Variables 51 | 52 | * `FEDERATION_NAME` - Friendly name to use for the Federation, such as `fed` or `federation` 53 | 54 | 55 | ### Application Variables 56 | 57 | * `HUGO_APP_DOCKER_IMAGE` - Docker image that will be used for the Hugo site Deployments. Change this only if you are using your own Docker image 58 | * `JENKINS_DOCKER_IMAGE_TAG` - Docker image (with tag) that will be used for the Jenkins Deployment. Change this only if you are using your own Docker image 59 | * `DOMAIN_NAME_ZONE_ID` - **Leave as-is**: Calculated value will be the AWS Route 53 hosted zone ID for your domain, which will be retrieved and used when DNS records are created for Deployments -------------------------------------------------------------------------------- /docs/using-vagrant.md: -------------------------------------------------------------------------------- 1 | # Using Vagrant 2 | 3 | There is a [Vagrantfile](../Vagrantfile) in the root of this repository, which will provision a Vagrant box that contains all the necessary tools needed to conduct the labs. You will need to have the following installed on your local host: 4 | 5 | * [Vagrant](https://www.vagrantup.com/downloads.html) 6 | * [VirtualBox](https://www.virtualbox.org/wiki/Downloads/) 7 | * If using Windows, you will need to [disable Hyper-V](http://www.poweronplatforms.com/enable-disable-hyper-v-windows-10-8/) when running the Vagrant box 8 | * [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) 9 | * If using Windows, [install Git](http://git-scm.com/download/win) with the default settings and then use Git Bash for the steps below 10 | 11 | 12 | ## Clone the Repository 13 | 14 | ```bash 15 | git clone https://github.com/kumorilabs/getting-to-know-k8s 16 | cd getting-to-know-k8s 17 | ``` 18 | 19 | 20 | ## AWS API Credentials 21 | 22 | [Kops](https://github.com/kubernetes/kops#kubernetes-operations-kops), which we will be using to create Kubernetes clusters, requires you to have AWS API credentials configured. 23 | 24 | You can use your existing AWS user account or you can choose to create a dedicated user account for Kops. 25 | 26 | ### Use an existing AWS user account 27 | 28 | If you are using your existing AWS user account, you must have at a minimum the following [IAM policies attached](http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-using.html#policies_using-managed-console) to it (or you can use the `AdministratorAccess` policy which includes all of these permissions): 29 | 30 | ```console 31 | AmazonEC2FullAccess 32 | AmazonRoute53FullAccess 33 | AmazonS3FullAccess 34 | IAMFullAccess 35 | AmazonVPCFullAccess 36 | ``` 37 | 38 | ### Create a dedicated user account for Kops 39 | 40 | To create a dedicated user account for Kops, you can either use the management console or the AWS CLI: 41 | 42 | ```bash 43 | aws iam create-group --group-name kops 44 | 45 | export arns=" 46 | arn:aws:iam::aws:policy/AmazonEC2FullAccess 47 | arn:aws:iam::aws:policy/AmazonRoute53FullAccess 48 | arn:aws:iam::aws:policy/AmazonS3FullAccess 49 | arn:aws:iam::aws:policy/IAMFullAccess 50 | arn:aws:iam::aws:policy/AmazonVPCFullAccess" 51 | 52 | for arn in $arns; do aws iam attach-group-policy --policy-arn "$arn" --group-name kops; done 53 | 54 | aws iam create-user --user-name kops 55 | 56 | aws iam add-user-to-group --user-name kops --group-name kops 57 | 58 | aws iam create-access-key --user-name kops 59 | ``` 60 | 61 | You should record the values for `SecretAccessKey` and `AccessKeyID` in the returned JSON output, which are the AWS API credentials. 62 | 63 | ## Set the Required Environment Variables 64 | 65 | Before starting the Vagrant box, you need to set the environment variables below with the AWS API credentials of the AWS user account you will be using: 66 | 67 | ```bash 68 | export AWS_ACCESS_KEY_ID="AWS Access Key ID" 69 | export AWS_SECRET_ACCESS_KEY="AWS Secret Access Key" 70 | ``` 71 | 72 | Vagrant will automatically apply these environment variables to the Vagrant box during start-up. 73 | 74 | If you are not familiar with how to retrieve these values for your existing AWS user account, refer to the [AWS documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html). 75 | 76 | 77 | ## Verify SSH Key Paths in Vagrantfile 78 | 79 | Kops also requires a SSH public key file, which is used to create an AWS EC2 key pair for AWS instances that are created when creating a cluster. 80 | 81 | If you don't have a SSH key available, refer to this [tutorial](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#platform-mac) from GitHub on how to create one. 82 | 83 | If your existing SSH key files are not located in the default location (`~/.ssh/id_rsa.pub` & `~/.ssh/id_rsa`), you will need to update the following lines in the [Vagrantfile](../Vagrantfile#L14-L15) before starting the Vagrant box: 84 | 85 | ```ruby 86 | aws_keypair_pub_key_path = "~/.ssh/id_rsa.pub" 87 | aws_keypair_pri_key_path = "~/.ssh/id_rsa" 88 | ``` 89 | 90 | Vagrant will automatically copy these files to the Vagrant box during start-up. 91 | 92 | 93 | ## Verify Versions of Tools 94 | 95 | You can change the versions of the tools that will be installed on the Vagrant box. To do so, update the following variables in the [`/scripts/provision-vagrant.sh`](../scripts/provision-vagrant.sh#L2-L6) file before starting the Vagrant box: 96 | 97 | ```bash 98 | # Vagrant installation variables 99 | export KUBECTL_VERSION="1.7.6" 100 | export KUBEFED_VERSION="1.7.6" 101 | export KOPS_VERSION="1.7.0" 102 | export HUGO_VERSION="0.27.1" 103 | export TERRAFORM_VERSION="0.10.6" 104 | ``` 105 | 106 | 107 | ## Start the Vagrant Box and Connect 108 | 109 | From the root of the repository: 110 | 111 | ```bash 112 | vagrant up 113 | vagrant ssh 114 | ``` 115 | 116 | 117 | ## Enjoy the Labs 118 | 119 | You are ready to proceed with the labs. -------------------------------------------------------------------------------- /github/hugo-app-jenkins/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | MAINTAINER Steven Eschinger 3 | COPY public /usr/share/nginx/html -------------------------------------------------------------------------------- /github/hugo-app-jenkins/Jenkinsfile: -------------------------------------------------------------------------------- 1 | #!groovy​ 2 | podTemplate(label: 'pod-hugo-app', containers: [ 3 | containerTemplate(name: 'hugo', image: 'smesch/hugo', ttyEnabled: true, command: 'cat'), 4 | containerTemplate(name: 'html-proofer', image: 'smesch/html-proofer', ttyEnabled: true, command: 'cat'), 5 | containerTemplate(name: 'kubectl', image: 'smesch/kubectl', ttyEnabled: true, command: 'cat', 6 | volumes: [secretVolume(secretName: 'kube-config', mountPath: '/root/.kube')]), 7 | containerTemplate(name: 'docker', image: 'docker', ttyEnabled: true, command: 'cat', 8 | envVars: [containerEnvVar(key: 'DOCKER_CONFIG', value: '/tmp/'),])], 9 | volumes: [secretVolume(secretName: 'docker-config', mountPath: '/tmp'), 10 | hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock') 11 | ]) { 12 | 13 | node('pod-hugo-app') { 14 | 15 | def DOCKER_HUB_ACCOUNT = 'smesch' 16 | def DOCKER_IMAGE_NAME = 'hugo-app-jenkins' 17 | def K8S_DEPLOYMENT_NAME = 'hugo-app' 18 | 19 | stage('Clone Hugo App Repository') { 20 | checkout scm 21 | 22 | container('hugo') { 23 | stage('Build Hugo Site') { 24 | sh ("hugo --uglyURLs") 25 | } 26 | } 27 | 28 | container('html-proofer') { 29 | stage('Validate HTML') { 30 | sh ("htmlproofer public --internal-domains ${env.JOB_NAME} --external_only --only-4xx") 31 | } 32 | } 33 | 34 | container('docker') { 35 | stage('Docker Build & Push Current & Latest Versions') { 36 | sh ("docker build -t ${DOCKER_HUB_ACCOUNT}/${DOCKER_IMAGE_NAME}:${env.BUILD_NUMBER} .") 37 | sh ("docker push ${DOCKER_HUB_ACCOUNT}/${DOCKER_IMAGE_NAME}:${env.BUILD_NUMBER}") 38 | sh ("docker tag ${DOCKER_HUB_ACCOUNT}/${DOCKER_IMAGE_NAME}:${env.BUILD_NUMBER} ${DOCKER_HUB_ACCOUNT}/${DOCKER_IMAGE_NAME}:latest") 39 | sh ("docker push ${DOCKER_HUB_ACCOUNT}/${DOCKER_IMAGE_NAME}:latest") 40 | } 41 | } 42 | 43 | container('kubectl') { 44 | stage('Deploy New Build To Kubernetes') { 45 | sh ("kubectl set image deployment/${K8S_DEPLOYMENT_NAME} ${K8S_DEPLOYMENT_NAME}=${DOCKER_HUB_ACCOUNT}/${DOCKER_IMAGE_NAME}:${env.BUILD_NUMBER}") 46 | } 47 | } 48 | 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /github/hugo-app-travis/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | services: 4 | - docker 5 | 6 | os: 7 | - linux 8 | 9 | env: 10 | global: 11 | - DOCKER_IMAGE_NAME="hugo-app-travis" 12 | - K8S_DEPLOYMENT_NAME="hugo-app" 13 | 14 | before_script: 15 | - docker pull smesch/hugo 16 | - docker pull smesch/html-proofer 17 | - docker pull smesch/kubectl 18 | - docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" 19 | 20 | script: 21 | - docker run -v ${TRAVIS_BUILD_DIR}:/hugo_root smesch/hugo hugo -s /hugo_root 22 | - docker run -v ${TRAVIS_BUILD_DIR}/public:/public smesch/html-proofer htmlproofer /public --external_only --only-4xx 23 | 24 | after_script: 25 | - docker build -t ${DOCKER_USERNAME}/${DOCKER_IMAGE_NAME}:${TRAVIS_BUILD_ID} . 26 | - docker push ${DOCKER_USERNAME}/${DOCKER_IMAGE_NAME}:${TRAVIS_BUILD_ID} 27 | - docker tag ${DOCKER_USERNAME}/${DOCKER_IMAGE_NAME}:${TRAVIS_BUILD_ID} ${DOCKER_USERNAME}/${DOCKER_IMAGE_NAME}:latest 28 | - docker push ${DOCKER_USERNAME}/${DOCKER_IMAGE_NAME}:latest 29 | - sed -i -e 's|KUBE_CA_CERT|'"${KUBE_CA_CERT}"'|g' kubeconfig 30 | - sed -i -e 's|KUBE_ENDPOINT|'"${KUBE_ENDPOINT}"'|g' kubeconfig 31 | - sed -i -e 's|KUBE_ADMIN_CERT|'"${KUBE_ADMIN_CERT}"'|g' kubeconfig 32 | - sed -i -e 's|KUBE_ADMIN_KEY|'"${KUBE_ADMIN_KEY}"'|g' kubeconfig 33 | - sed -i -e 's|KUBE_USERNAME|'"${KUBE_USERNAME}"'|g' kubeconfig 34 | - docker run -v ${TRAVIS_BUILD_DIR}:/kube smesch/kubectl kubectl --kubeconfig /kube/kubeconfig set image deployment/${K8S_DEPLOYMENT_NAME} ${K8S_DEPLOYMENT_NAME}=${DOCKER_USERNAME}/${DOCKER_IMAGE_NAME}:$TRAVIS_BUILD_ID -------------------------------------------------------------------------------- /github/hugo-app-travis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:alpine 2 | MAINTAINER Steven Eschinger 3 | COPY public /usr/share/nginx/html -------------------------------------------------------------------------------- /github/hugo-app-travis/kubeconfig: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | clusters: 3 | - cluster: 4 | certificate-authority-data: KUBE_CA_CERT 5 | server: KUBE_ENDPOINT 6 | name: k8s-cluster 7 | contexts: 8 | - context: 9 | cluster: k8s-cluster 10 | user: k8s-cluster 11 | name: k8s-cluster 12 | current-context: k8s-cluster 13 | kind: Config 14 | preferences: {} 15 | users: 16 | - name: k8s-cluster 17 | user: 18 | client-certificate-data: KUBE_ADMIN_CERT 19 | client-key-data: KUBE_ADMIN_KEY 20 | username: KUBE_USERNAME -------------------------------------------------------------------------------- /github/hugo-app-wercker/kubeconfig: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | clusters: 3 | - cluster: 4 | certificate-authority-data: KUBE_CA_CERT 5 | server: KUBE_ENDPOINT 6 | name: k8s-cluster 7 | contexts: 8 | - context: 9 | cluster: k8s-cluster 10 | user: k8s-cluster 11 | name: k8s-cluster 12 | current-context: k8s-cluster 13 | kind: Config 14 | preferences: {} 15 | users: 16 | - name: k8s-cluster 17 | user: 18 | client-certificate-data: KUBE_ADMIN_CERT 19 | client-key-data: KUBE_ADMIN_KEY 20 | username: KUBE_USERNAME -------------------------------------------------------------------------------- /github/hugo-app-wercker/wercker.yml: -------------------------------------------------------------------------------- 1 | box: ruby 2 | build: 3 | steps: 4 | - arjen/hugo-build: 5 | version: "0.20" 6 | flags: --uglyURLs 7 | 8 | test: 9 | steps: 10 | - kyleboyle/html-proofer-test: 11 | version: "2.3.0" 12 | basedir: public 13 | arguments: --checks-to-ignore ImageCheck --only-4xx 14 | 15 | push: 16 | box: 17 | id: nginx:alpine 18 | cmd: /bin/sh 19 | steps: 20 | - script: 21 | name: Copy Hugo output to NGINX root 22 | code: | 23 | cp -a ${WERCKER_ROOT}/public/* /usr/share/nginx/html 24 | - internal/docker-push: 25 | cmd: nginx -g "daemon off;" 26 | username: ${DOCKER_USERNAME} 27 | password: ${DOCKER_PASSWORD} 28 | tag: ${WERCKER_GIT_COMMIT} 29 | repository: ${DOCKER_USERNAME}/${DOCKER_IMAGE_NAME} 30 | registry: https://registry.hub.docker.com 31 | 32 | deploy: 33 | steps: 34 | - script: 35 | name: Kubeconfig template file population 36 | code: | 37 | sed -i -e 's|KUBE_CA_CERT|'"${KUBE_CA_CERT}"'|g' kubeconfig 38 | sed -i -e 's|KUBE_ENDPOINT|'"${KUBE_ENDPOINT}"'|g' kubeconfig 39 | sed -i -e 's|KUBE_ADMIN_CERT|'"${KUBE_ADMIN_CERT}"'|g' kubeconfig 40 | sed -i -e 's|KUBE_ADMIN_KEY|'"${KUBE_ADMIN_KEY}"'|g' kubeconfig 41 | sed -i -e 's|KUBE_USERNAME|'"${KUBE_USERNAME}"'|g' kubeconfig 42 | - kubectl: 43 | server: ${KUBE_ENDPOINT} 44 | username: ${KUBE_USERNAME} 45 | command: --kubeconfig kubeconfig set image deployment/${K8S_DEPLOYMENT_NAME} ${K8S_DEPLOYMENT_NAME}=${DOCKER_USERNAME}/${DOCKER_IMAGE_NAME}:${WERCKER_GIT_COMMIT} 46 | - script: 47 | name: Remove kubeconfig file 48 | code: rm kubeconfig -------------------------------------------------------------------------------- /kubernetes/cluster-autoscaler/cluster-autoscaler-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: cluster-autoscaler 5 | namespace: kube-system 6 | labels: 7 | app: cluster-autoscaler 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: cluster-autoscaler 13 | template: 14 | metadata: 15 | labels: 16 | app: cluster-autoscaler 17 | spec: 18 | containers: 19 | - image: gcr.io/google_containers/cluster-autoscaler:v0.6.0 20 | name: cluster-autoscaler 21 | resources: 22 | limits: 23 | cpu: 100m 24 | memory: 300Mi 25 | requests: 26 | cpu: 100m 27 | memory: 300Mi 28 | command: 29 | - ./cluster-autoscaler 30 | - --v=4 31 | - --stderrthreshold=info 32 | - --cloud-provider=aws 33 | - --skip-nodes-with-local-storage=false 34 | - --nodes=2:4:nodes.usa.k8s.kumorilabs.com 35 | env: 36 | - name: AWS_REGION 37 | value: us-east-1 38 | volumeMounts: 39 | - name: ssl-certs 40 | mountPath: /etc/ssl/certs/ca-certificates.crt 41 | readOnly: true 42 | imagePullPolicy: "Always" 43 | volumes: 44 | - name: ssl-certs 45 | hostPath: 46 | path: "/etc/ssl/certs/ca-certificates.crt" -------------------------------------------------------------------------------- /kubernetes/hugo-app-blue-green/hugo-app-blue-green-deploy-blue.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: hugo-app-blue 5 | spec: 6 | replicas: 3 7 | template: 8 | metadata: 9 | labels: 10 | app: hugo-app-blue-green 11 | color: blue 12 | spec: 13 | containers: 14 | - name: hugo-app 15 | image: smesch/hugo-app:blue 16 | ports: 17 | - containerPort: 80 18 | -------------------------------------------------------------------------------- /kubernetes/hugo-app-blue-green/hugo-app-blue-green-deploy-green.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: hugo-app-green 5 | spec: 6 | replicas: 3 7 | template: 8 | metadata: 9 | labels: 10 | app: hugo-app-blue-green 11 | color: green 12 | spec: 13 | containers: 14 | - name: hugo-app 15 | image: smesch/hugo-app:green 16 | ports: 17 | - containerPort: 80 18 | -------------------------------------------------------------------------------- /kubernetes/hugo-app-blue-green/hugo-app-blue-green-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: hugo-app-blue-green-svc 5 | labels: 6 | app: hugo-app-blue-green 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - port: 80 11 | targetPort: 80 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app: hugo-app-blue-green 16 | color: blue 17 | -------------------------------------------------------------------------------- /kubernetes/hugo-app-canary/hugo-app-canary-deploy-red.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: hugo-app-red 5 | spec: 6 | replicas: 3 7 | template: 8 | metadata: 9 | labels: 10 | app: hugo-app-canary 11 | track: stable 12 | spec: 13 | containers: 14 | - name: hugo-app 15 | image: smesch/hugo-app:red 16 | ports: 17 | - containerPort: 80 18 | -------------------------------------------------------------------------------- /kubernetes/hugo-app-canary/hugo-app-canary-deploy-yellow.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: hugo-app-yellow 5 | spec: 6 | replicas: 1 7 | template: 8 | metadata: 9 | labels: 10 | app: hugo-app-canary 11 | track: canary 12 | spec: 13 | containers: 14 | - name: hugo-app 15 | image: smesch/hugo-app:yellow 16 | ports: 17 | - containerPort: 80 18 | -------------------------------------------------------------------------------- /kubernetes/hugo-app-canary/hugo-app-canary-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: hugo-app-canary-svc 5 | labels: 6 | app: hugo-app-canary 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - port: 80 11 | targetPort: 80 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app: hugo-app-canary 16 | -------------------------------------------------------------------------------- /kubernetes/hugo-app-federation/hugo-app-federation-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: hugo-app-federation 5 | spec: 6 | replicas: 6 7 | template: 8 | metadata: 9 | labels: 10 | app: hugo-app-federation 11 | spec: 12 | containers: 13 | - name: hugo-app 14 | image: smesch/hugo-app:1.0 15 | ports: 16 | - containerPort: 80 17 | -------------------------------------------------------------------------------- /kubernetes/hugo-app-federation/hugo-app-federation-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: hugo-app-federation-svc 5 | labels: 6 | app: hugo-app-federation 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - port: 80 11 | targetPort: 80 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app: hugo-app-federation 16 | -------------------------------------------------------------------------------- /kubernetes/hugo-app-rolling-update/hugo-app-rolling-update-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: hugo-app-rolling-update 5 | spec: 6 | minReadySeconds: 20 7 | replicas: 6 8 | template: 9 | metadata: 10 | labels: 11 | app: hugo-app-rolling-update 12 | spec: 13 | containers: 14 | - name: hugo-app 15 | image: smesch/hugo-app:red 16 | ports: 17 | - containerPort: 80 18 | -------------------------------------------------------------------------------- /kubernetes/hugo-app-rolling-update/hugo-app-rolling-update-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: hugo-app-rolling-update-svc 5 | labels: 6 | app: hugo-app-rolling-update 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - port: 80 11 | targetPort: 80 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app: hugo-app-rolling-update 16 | -------------------------------------------------------------------------------- /kubernetes/hugo-app/hugo-app-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: hugo-app 5 | spec: 6 | replicas: 5 7 | template: 8 | metadata: 9 | labels: 10 | app: hugo-app 11 | spec: 12 | containers: 13 | - name: hugo-app 14 | image: smesch/hugo-app:1.0 15 | ports: 16 | - containerPort: 80 -------------------------------------------------------------------------------- /kubernetes/hugo-app/hugo-app-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: hugo-app-svc 5 | labels: 6 | app: hugo-app 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - port: 80 11 | targetPort: 80 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app: hugo-app 16 | -------------------------------------------------------------------------------- /kubernetes/jenkins/jenkins-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: jenkins-leader 5 | spec: 6 | replicas: 1 7 | template: 8 | metadata: 9 | labels: 10 | app: jenkins-leader 11 | spec: 12 | securityContext: 13 | fsGroup: 99 14 | containers: 15 | - name: jenkins-leader 16 | image: smesch/jenkins-kubernetes-leader:2.46.2 17 | volumeMounts: 18 | - name: jenkins-home 19 | mountPath: /var/jenkins_home 20 | ports: 21 | - containerPort: 8080 22 | - containerPort: 50000 23 | volumes: 24 | - name: jenkins-home 25 | persistentVolumeClaim: 26 | claimName: jenkins-leader-pvc 27 | -------------------------------------------------------------------------------- /kubernetes/jenkins/jenkins-per-vol-claim.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: jenkins-leader-pvc 5 | labels: 6 | app: jenkins-leader 7 | spec: 8 | accessModes: 9 | - ReadWriteOnce 10 | resources: 11 | requests: 12 | storage: 20Gi -------------------------------------------------------------------------------- /kubernetes/jenkins/jenkins-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: jenkins-leader-svc 5 | labels: 6 | app: jenkins-leader 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - port: 80 11 | targetPort: 8080 12 | protocol: TCP 13 | name: http 14 | - port: 50000 15 | protocol: TCP 16 | name: slave 17 | selector: 18 | app: jenkins-leader 19 | -------------------------------------------------------------------------------- /kubernetes/rbac/full-access-cluster-role-binding.yml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1beta1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: admin-to-full-access-binding 5 | subjects: 6 | - kind: User 7 | name: admin 8 | apiGroup: rbac.authorization.k8s.io 9 | roleRef: 10 | kind: ClusterRole 11 | name: full-access-cluster 12 | apiGroup: rbac.authorization.k8s.io -------------------------------------------------------------------------------- /kubernetes/rbac/full-access-cluster-role.yml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1beta1 2 | kind: ClusterRole 3 | metadata: 4 | name: full-access-cluster 5 | rules: 6 | - apiGroups: ["*"] 7 | resources: ["*"] 8 | verbs: ["*"] 9 | - verbs: ["*"] 10 | nonResourceURLs: ["*"] -------------------------------------------------------------------------------- /kubernetes/windows/iis-app/iis-app-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app: iis-app 6 | name: iis-app 7 | spec: 8 | replicas: 1 9 | template: 10 | metadata: 11 | labels: 12 | app: iis-app 13 | name: iis-app 14 | spec: 15 | containers: 16 | - name: iis-app 17 | image: microsoft/windowsservercore 18 | command: 19 | - powershell.exe 20 | - -command 21 | - "$$listener = New-Object System.Net.HttpListener ; $$listener.Prefixes.Add('http://*:80/') ; $$listener.Start() ; $$callerCounts = @{} ; Write-Host('Listening at http://*:80/') ; while ($$listener.IsListening) { ;$$context = $$listener.GetContext() ;$$requestUrl = $$context.Request.Url ;$$clientIP = $$context.Request.RemoteEndPoint.Address ;$$response = $$context.Response ;Write-Host '' ;Write-Host('> {0}' -f $$requestUrl) ; ;$$count = 1 ;$$k=$$callerCounts.Get_Item($$clientIP) ;if ($$k -ne $$null) { $$count += $$k } ;$$callerCounts.Set_Item($$clientIP, $$count) ;$$header='

Windows Container Web Server

' ;$$callerCountsString='' ;$$callerCounts.Keys | % { $$callerCountsString+='

IP {0} callerCount {1} ' -f $$_,$$callerCounts.Item($$_) } ;$$footer='' ;$$content='{0}{1}{2}' -f $$header,$$callerCountsString,$$footer ;Write-Output $$content ;$$buffer = [System.Text.Encoding]::UTF8.GetBytes($$content) ;$$response.ContentLength64 = $$buffer.Length ;$$response.OutputStream.Write($$buffer, 0, $$buffer.Length) ;$$response.Close() ;$$responseStatus = $$response.StatusCode ;Write-Host('< {0}' -f $$responseStatus) } ; " 22 | nodeSelector: 23 | beta.kubernetes.io/os: windows -------------------------------------------------------------------------------- /kubernetes/windows/iis-app/iis-app-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: iis-app-svc 5 | labels: 6 | app: iis-app 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - port: 80 11 | targetPort: 80 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app: iis-app -------------------------------------------------------------------------------- /kubernetes/windows/iis-default/iis-default-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app: iis-default 6 | name: iis-default 7 | spec: 8 | replicas: 2 9 | template: 10 | metadata: 11 | labels: 12 | app: iis-default 13 | name: iis-default 14 | spec: 15 | containers: 16 | - name: iis-default 17 | image: microsoft/iis:nanoserver 18 | ports: 19 | - containerPort: 80 20 | nodeSelector: 21 | beta.kubernetes.io/os: windows -------------------------------------------------------------------------------- /kubernetes/windows/iis-default/iis-default-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: iis-default-svc 5 | labels: 6 | app: iis-default 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - port: 80 11 | targetPort: 80 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app: iis-default -------------------------------------------------------------------------------- /kubernetes/windows/mongodb-linux/mongodb-linux-dep.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app: mongodb-linux 6 | name: mongodb-linux 7 | spec: 8 | replicas: 1 9 | template: 10 | metadata: 11 | labels: 12 | app: mongodb-linux 13 | name: mongodb-linux 14 | spec: 15 | containers: 16 | - name: mongodb-linux 17 | image: mongo:latest 18 | ports: 19 | - containerPort: 27017 20 | nodeSelector: 21 | beta.kubernetes.io/os: linux -------------------------------------------------------------------------------- /kubernetes/windows/mongodb-linux/mongodb-linux-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mongodb-linux 5 | labels: 6 | app: mongodb-linux 7 | spec: 8 | type: ClusterIP 9 | ports: 10 | - port: 27017 11 | protocol: TCP 12 | name: mongo 13 | selector: 14 | app: mongodb-linux -------------------------------------------------------------------------------- /kubernetes/windows/nginx-linux/nginx-linux-deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app: nginx-linux 6 | name: nginx-linux 7 | spec: 8 | replicas: 2 9 | template: 10 | metadata: 11 | labels: 12 | app: nginx-linux 13 | name: nginx-linux 14 | spec: 15 | containers: 16 | - name: nginx 17 | image: nginx 18 | nodeSelector: 19 | beta.kubernetes.io/os: linux -------------------------------------------------------------------------------- /kubernetes/windows/nginx-linux/nginx-linux-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: nginx-linux-svc 5 | labels: 6 | app: nginx-linux 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - port: 80 11 | targetPort: 80 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app: nginx-linux -------------------------------------------------------------------------------- /kubernetes/windows/react-bookmarks-windows/react-bookmarks-windows-dep.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app: react-bookmarks-windows 6 | name: react-bookmarks-windows 7 | spec: 8 | replicas: 2 9 | template: 10 | metadata: 11 | labels: 12 | app: react-bookmarks-windows 13 | name: react-bookmarks-windows 14 | spec: 15 | containers: 16 | - name: react-bookmarks-windows 17 | image: smesch/react-bookmarks-windows:1.0 18 | ports: 19 | - containerPort: 8888 20 | env: 21 | - name: REACT_BOOKMARKS_LOCAL_PORT 22 | value: "8888" 23 | - name: REACT_BOOKMARKS_MONGODB_HOST 24 | value: mongodb-linux:27017 25 | - name: REACT_BOOKMARKS_MONGODB_NAME 26 | value: react-bookmarks 27 | - name: REACT_BOOKMARKS_MONGODB_COLLECTION 28 | value: bookmarks 29 | nodeSelector: 30 | beta.kubernetes.io/os: windows -------------------------------------------------------------------------------- /kubernetes/windows/react-bookmarks-windows/react-bookmarks-windows-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: react-bookmarks-windows 5 | labels: 6 | app: react-bookmarks-windows 7 | spec: 8 | type: LoadBalancer 9 | ports: 10 | - port: 80 11 | targetPort: 8888 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app: react-bookmarks-windows -------------------------------------------------------------------------------- /scripts/addons/cluster-autoscaler/deploy-cluster-autoscaler.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [[ $# -lt 4 ]]; then echo "Must supply Cluster Alias, AWS Region, Min Nodes & Max Nodes" && exit 1; fi 6 | 7 | export CLUSTER_ALIAS="$1" && echo "Cluster: ${CLUSTER_ALIAS}" 8 | export CLUSTER_AWS_REGION="$2" && echo "AWS Region: ${CLUSTER_AWS_REGION}" 9 | export MIN_NODES="$3" && echo "Min Nodes: ${MIN_NODES}" 10 | export MAX_NODES="$4" && echo "Max Nodes: ${MAX_NODES}" 11 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" 12 | 13 | # Pause for 3 seconds 14 | sleep 3 15 | 16 | # Create a new IAM policy for Cluster Autoscaler 17 | aws iam put-role-policy --role-name nodes.${CLUSTER_FULL_NAME} --policy-name asg-nodes.${CLUSTER_FULL_NAME} --policy-document file://scripts/addons/cluster-autoscaler/policy-cluster-autoscaler.json 18 | 19 | # Set min & max nodes, asg name and AWS region in the cluster-autoscaler-deploy.yaml file 20 | sed -i -e "s|--nodes=.*|--nodes=${MIN_NODES}:${MAX_NODES}:nodes.${CLUSTER_FULL_NAME}|g" ./kubernetes/cluster-autoscaler/cluster-autoscaler-deploy.yaml 21 | sed -i -e "s|value: .*|value: ${CLUSTER_AWS_REGION}|g" ./kubernetes/cluster-autoscaler/cluster-autoscaler-deploy.yaml 22 | 23 | # Deploy Cluster Autoscaler 24 | kubectl --context ${CLUSTER_ALIAS} apply -f ./kubernetes/cluster-autoscaler -------------------------------------------------------------------------------- /scripts/addons/cluster-autoscaler/policy-cluster-autoscaler.json: -------------------------------------------------------------------------------- 1 | { 2 | "Version": "2012-10-17", 3 | "Statement": [ 4 | { 5 | "Effect": "Allow", 6 | "Action": [ 7 | "autoscaling:DescribeAutoScalingGroups", 8 | "autoscaling:DescribeAutoScalingInstances", 9 | "autoscaling:DescribeTags", 10 | "autoscaling:SetDesiredCapacity", 11 | "autoscaling:TerminateInstanceInAutoScalingGroup" 12 | ], 13 | "Resource": "*" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /scripts/addons/heapster-monitoring/deploy-heapster-monitoring.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deploying Heapster on Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deploying Heapster on Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Deploy Heapster Monitoring 14 | kubectl --context ${CLUSTER_ALIAS} create -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/monitoring-standalone/v1.7.0.yaml -------------------------------------------------------------------------------- /scripts/addons/kubernetes-dashboard/deploy-dashboard.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deploying Dashboard on Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deploying Dashboard on Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Deploy Kubernetes Dashboard Monitoring 14 | kubectl --context ${CLUSTER_ALIAS} apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/alternative/kubernetes-dashboard.yaml -------------------------------------------------------------------------------- /scripts/apps/dns-records/dns-record-federation.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comment": "Create/Update a latency-based CNAME record for a federated Deployment", 3 | "Changes": [ 4 | { 5 | "Action": "UPSERT", 6 | "ResourceRecordSet": { 7 | "Name": "hugo-fed.k8s.kumorilabs.com", 8 | "Type": "CNAME", 9 | "Region": "ap-northeast-1", 10 | "TTL": 300, 11 | "SetIdentifier": "ap-northeast-1", 12 | "ResourceRecords": [ 13 | { 14 | "Value": " a8476da95a2f311e78d7006edc4869b4-1880811496.ap-northeast-1.elb.amazonaws.com " 15 | } 16 | ] 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /scripts/apps/dns-records/dns-record-single.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comment": "Create/Update a CNAME record for a standalone Deployment", 3 | "Changes": [ 4 | { 5 | "Action": "UPSERT", 6 | "ResourceRecordSet": { 7 | "Name": "iis-default.k8s.kumorilabs.com", 8 | "Type": "CNAME", 9 | "TTL": 300, 10 | "ResourceRecords": [ 11 | { 12 | "Value": " ae7a651009ef911e78a9f0a1c65cf6bb-949337071.us-east-1.elb.amazonaws.com " 13 | } 14 | ] 15 | } 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /scripts/apps/horizontal-pod-autoscaling/deploy-hpa-app.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deploying HPA example app on Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deploying HPA example app on Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Run the php-apache container and configure autoscaling for the deployment 14 | kubectl --context ${CLUSTER_ALIAS} run php-apache --image=gcr.io/google_containers/hpa-example --requests=cpu=200m --expose --port=80 15 | kubectl --context ${CLUSTER_ALIAS} autoscale deployment php-apache --cpu-percent=50 --min=1 --max=10 -------------------------------------------------------------------------------- /scripts/apps/horizontal-pod-autoscaling/test-hpa-app.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Run the load-generator container and generate load against the php-apache deployment 5 | kubectl --context ${CLUSTER_ALIAS} run -i --tty load-generator --image=busybox /bin/sh 6 | while true; do wget -q -O- http://php-apache.default.svc.cluster.local; done -------------------------------------------------------------------------------- /scripts/apps/hugo-app-blue-green/deploy-hugo-app-blue-green.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deploying Hugo app (Blue-Green) on Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deploying Hugo app (Blue-Green) on Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Set Hugo App image name in the hugo-app-blue-green-deploy-blue.yaml file 14 | # Set Hugo App image name in the hugo-app-blue-green-deploy-green.yaml file 15 | sed -i -e "s|image: .*:|image: ${HUGO_APP_DOCKER_IMAGE}:|g" ./kubernetes/hugo-app-blue-green/hugo-app-blue-green-deploy-blue.yaml 16 | sed -i -e "s|image: .*:|image: ${HUGO_APP_DOCKER_IMAGE}:|g" ./kubernetes/hugo-app-blue-green/hugo-app-blue-green-deploy-green.yaml 17 | 18 | # Create Kubernetes objects 19 | kubectl --context ${CLUSTER_ALIAS} create -f ./kubernetes/hugo-app-blue-green --record 20 | 21 | # Wait for Hugo App ELB to be created 22 | echo "Waiting for Hugo App (Blue-Green) ELB to be created (60 seconds)" 23 | sleep 60 24 | 25 | # Set the DNS record prefix & the Service name and then retrieve the ELB URL 26 | export DNS_RECORD_PREFIX="hugo-blue-green" 27 | export SERVICE_NAME="hugo-app-blue-green-svc" 28 | export HUGO_APP_ELB=$(kubectl --context=${CLUSTER_ALIAS} get services/${SERVICE_NAME} --template="{{range .status.loadBalancer.ingress}} {{.hostname}} {{end}}") 29 | 30 | # Add to JSON file 31 | sed -i -e 's|"Name": ".*|"Name": "'"${DNS_RECORD_PREFIX}.${DOMAIN_NAME}"'",|g' scripts/apps/dns-records/dns-record-single.json 32 | sed -i -e 's|"Value": ".*|"Value": "'"${HUGO_APP_ELB}"'"|g' scripts/apps/dns-records/dns-record-single.json 33 | 34 | # Create DNS record 35 | aws route53 change-resource-record-sets --hosted-zone-id ${DOMAIN_NAME_ZONE_ID} --change-batch file://scripts/apps/dns-records/dns-record-single.json -------------------------------------------------------------------------------- /scripts/apps/hugo-app-canary/deploy-hugo-app-canary.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deploying Hugo app (Canary) on Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deploying Hugo app (Canary) on Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Set Hugo App image name in the hugo-app-canary-deploy-red.yaml file 14 | # Set Hugo App image name in the hugo-app-canary-deploy-yellow.yaml file 15 | sed -i -e "s|image: .*:|image: ${HUGO_APP_DOCKER_IMAGE}:|g" ./kubernetes/hugo-app-canary/hugo-app-canary-deploy-red.yaml 16 | sed -i -e "s|image: .*:|image: ${HUGO_APP_DOCKER_IMAGE}:|g" ./kubernetes/hugo-app-canary/hugo-app-canary-deploy-yellow.yaml 17 | 18 | # Create Kubernetes objects 19 | kubectl --context ${CLUSTER_ALIAS} create -f ./kubernetes/hugo-app-canary --record 20 | 21 | # Wait for Hugo App ELB to be created 22 | echo "Waiting for Hugo App (Canary) ELB to be created (60 seconds)" 23 | sleep 60 24 | 25 | # Set the DNS record prefix & the Service name and then retrieve the ELB URL 26 | export DNS_RECORD_PREFIX="hugo-canary" 27 | export SERVICE_NAME="hugo-app-canary-svc" 28 | export HUGO_APP_ELB=$(kubectl --context=${CLUSTER_ALIAS} get services/${SERVICE_NAME} --template="{{range .status.loadBalancer.ingress}} {{.hostname}} {{end}}") 29 | 30 | # Add to JSON file 31 | sed -i -e 's|"Name": ".*|"Name": "'"${DNS_RECORD_PREFIX}.${DOMAIN_NAME}"'",|g' scripts/apps/dns-records/dns-record-single.json 32 | sed -i -e 's|"Value": ".*|"Value": "'"${HUGO_APP_ELB}"'"|g' scripts/apps/dns-records/dns-record-single.json 33 | 34 | # Create DNS record 35 | aws route53 change-resource-record-sets --hosted-zone-id ${DOMAIN_NAME_ZONE_ID} --change-batch file://scripts/apps/dns-records/dns-record-single.json -------------------------------------------------------------------------------- /scripts/apps/hugo-app-federation/deploy-hugo-app-federation.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [[ $# -gt 6 ]]; then echo "Only 3 cluster alias/aws region pairs are supported" && exit 1; fi 6 | 7 | if [[ -z $1 ]]; then echo "Must supply at least 2 cluster alias/aws region pairs" && exit 1; else 8 | export CLUSTER_1_ALIAS="$1" && 9 | echo "Cluster 1 Name: ${CLUSTER_1_ALIAS}"; fi 10 | 11 | if [[ -z $2 ]]; then echo "Must supply at least 2 cluster alias/aws region pairs" && exit 1; else 12 | export CLUSTER_1_AWS_REGION="$2" && 13 | echo "Cluster 1 AWS Region: ${CLUSTER_1_AWS_REGION}"; fi 14 | 15 | if [[ -z $3 ]]; then echo "Must supply at least 2 cluster alias/aws region pairs" && exit 1; else 16 | export CLUSTER_2_ALIAS="$3" && 17 | echo "Cluster 2 Name: ${CLUSTER_2_ALIAS}"; fi 18 | 19 | if [[ -z $4 ]]; then echo "Must supply at least 2 cluster alias/aws region pairs" && exit 1; else 20 | export CLUSTER_2_AWS_REGION="$4" && 21 | echo "Cluster 2 AWS Region: ${CLUSTER_2_AWS_REGION}"; fi 22 | 23 | if [[ -n $5 ]]; then 24 | export CLUSTER_3_ALIAS="$5" && 25 | echo "Cluster 3 Name: ${CLUSTER_3_ALIAS}"; fi 26 | 27 | if [[ -n $6 ]]; then 28 | export CLUSTER_3_AWS_REGION="$6" && 29 | echo "Cluster 3 AWS Region: ${CLUSTER_3_AWS_REGION}"; fi 30 | 31 | # Pause for 3 seconds 32 | sleep 3 33 | 34 | # Set Hugo App image name in the hugo-app-federation-deploy.yaml file 35 | sed -i -e "s|image: .*:|image: ${HUGO_APP_DOCKER_IMAGE}:|g" ./kubernetes/hugo-app-federation/hugo-app-federation-deploy.yaml 36 | 37 | # Create Kubernetes objects 38 | kubectl --context ${FEDERATION_NAME} create -f ./kubernetes/hugo-app-federation --record 39 | 40 | # Wait for Hugo App ELBs to be created 41 | echo "Waiting for Hugo App (Federation) ELBs to be created (90 seconds)" 42 | sleep 90 43 | 44 | # Create CNAME #1 record for Hugo 45 | # Retreive ELB URL 46 | export DNS_RECORD_PREFIX="hugo-fed" 47 | export SERVICE_NAME="hugo-app-federation-svc" 48 | export HUGO_APP_ELB_1=$(kubectl --context=${CLUSTER_1_ALIAS} get services/${SERVICE_NAME} --template="{{range .status.loadBalancer.ingress}} {{.hostname}} {{end}}") 49 | 50 | # Add to JSON file 51 | sed -i -e 's|"Name": ".*|"Name": "'"${DNS_RECORD_PREFIX}.${DOMAIN_NAME}"'",|g' scripts/apps/dns-records/dns-record-federation.json 52 | sed -i -e 's|"Region": ".*|"Region": "'"${CLUSTER_1_AWS_REGION}"'",|g' scripts/apps/dns-records/dns-record-federation.json 53 | sed -i -e 's|"SetIdentifier": ".*|"SetIdentifier": "'"${CLUSTER_1_AWS_REGION}"'",|g' scripts/apps/dns-records/dns-record-federation.json 54 | sed -i -e 's|"Value": ".*|"Value": "'"${HUGO_APP_ELB_1}"'"|g' scripts/apps/dns-records/dns-record-federation.json 55 | 56 | # Create DNS record 57 | aws route53 change-resource-record-sets --hosted-zone-id ${DOMAIN_NAME_ZONE_ID} --change-batch file://scripts/apps/dns-records/dns-record-federation.json 58 | 59 | # Create CNAME #2 record for Hugo 60 | # Retreive ELB URL 61 | export HUGO_APP_ELB_2=$(kubectl --context=${CLUSTER_2_ALIAS} get services/${SERVICE_NAME} --template="{{range .status.loadBalancer.ingress}} {{.hostname}} {{end}}") 62 | 63 | # Add to JSON file 64 | sed -i -e 's|"Name": ".*|"Name": "'"${DNS_RECORD_PREFIX}.${DOMAIN_NAME}"'",|g' scripts/apps/dns-records/dns-record-federation.json 65 | sed -i -e 's|"Region": ".*|"Region": "'"${CLUSTER_2_AWS_REGION}"'",|g' scripts/apps/dns-records/dns-record-federation.json 66 | sed -i -e 's|"SetIdentifier": ".*|"SetIdentifier": "'"${CLUSTER_2_AWS_REGION}"'",|g' scripts/apps/dns-records/dns-record-federation.json 67 | sed -i -e 's|"Value": ".*|"Value": "'"${HUGO_APP_ELB_2}"'"|g' scripts/apps/dns-records/dns-record-federation.json 68 | 69 | # Create DNS record 70 | aws route53 change-resource-record-sets --hosted-zone-id ${DOMAIN_NAME_ZONE_ID} --change-batch file://scripts/apps/dns-records/dns-record-federation.json 71 | 72 | if [[ -n $6 ]]; then 73 | # Create CNAME #3 record for Hugo 74 | # Retreive ELB URL 75 | export HUGO_APP_ELB_3=$(kubectl --context=${CLUSTER_3_ALIAS} get services/${SERVICE_NAME} --template="{{range .status.loadBalancer.ingress}} {{.hostname}} {{end}}") 76 | 77 | # Add to JSON file 78 | sed -i -e 's|"Name": ".*|"Name": "'"${DNS_RECORD_PREFIX}.${DOMAIN_NAME}"'",|g' scripts/apps/dns-records/dns-record-federation.json 79 | sed -i -e 's|"Region": ".*|"Region": "'"${CLUSTER_3_AWS_REGION}"'",|g' scripts/apps/dns-records/dns-record-federation.json 80 | sed -i -e 's|"SetIdentifier": ".*|"SetIdentifier": "'"${CLUSTER_3_AWS_REGION}"'",|g' scripts/apps/dns-records/dns-record-federation.json 81 | sed -i -e 's|"Value": ".*|"Value": "'"${HUGO_APP_ELB_3}"'"|g' scripts/apps/dns-records/dns-record-federation.json 82 | 83 | # Create DNS record 84 | aws route53 change-resource-record-sets --hosted-zone-id ${DOMAIN_NAME_ZONE_ID} --change-batch file://scripts/apps/dns-records/dns-record-federation.json 85 | fi -------------------------------------------------------------------------------- /scripts/apps/hugo-app-rolling-update/deploy-hugo-app-rolling-update.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deploying Hugo app (Rolling Update) on Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deploying Hugo app (Rolling Update) on Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Set Hugo App image name in the hugo-app-rolling-update-deploy.yaml file 14 | sed -i -e "s|image: .*:|image: ${HUGO_APP_DOCKER_IMAGE}:|g" ./kubernetes/hugo-app-rolling-update/hugo-app-rolling-update-deploy.yaml 15 | 16 | # Create Kubernetes objects 17 | kubectl --context ${CLUSTER_ALIAS} create -f ./kubernetes/hugo-app-rolling-update --record 18 | 19 | # Wait for Hugo App ELB to be created 20 | echo "Waiting for Hugo App (Rolling Update) ELB to be created (60 seconds)" 21 | sleep 60 22 | 23 | # Set the DNS record prefix & the Service name and then retrieve the ELB URL 24 | export DNS_RECORD_PREFIX="hugo-rolling-update" 25 | export SERVICE_NAME="hugo-app-rolling-update-svc" 26 | export HUGO_APP_ELB=$(kubectl --context=${CLUSTER_ALIAS} get services/${SERVICE_NAME} --template="{{range .status.loadBalancer.ingress}} {{.hostname}} {{end}}") 27 | 28 | # Add to JSON file 29 | sed -i -e 's|"Name": ".*|"Name": "'"${DNS_RECORD_PREFIX}.${DOMAIN_NAME}"'",|g' scripts/apps/dns-records/dns-record-single.json 30 | sed -i -e 's|"Value": ".*|"Value": "'"${HUGO_APP_ELB}"'"|g' scripts/apps/dns-records/dns-record-single.json 31 | 32 | # Create DNS record 33 | aws route53 change-resource-record-sets --hosted-zone-id ${DOMAIN_NAME_ZONE_ID} --change-batch file://scripts/apps/dns-records/dns-record-single.json -------------------------------------------------------------------------------- /scripts/apps/hugo-app/deploy-hugo-app.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deploying Hugo app on Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deploying Hugo app on Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Set Hugo App image name in the hugo-app-deploy.yaml file 14 | sed -i -e "s|image: .*:|image: ${HUGO_APP_DOCKER_IMAGE}:|g" ./kubernetes/hugo-app/hugo-app-deploy.yaml 15 | 16 | # Create Kubernetes objects 17 | kubectl --context ${CLUSTER_ALIAS} create -f ./kubernetes/hugo-app --record 18 | 19 | # Wait for Hugo App ELB to be created 20 | echo "Waiting for Hugo App ELB to be created (60 seconds)" 21 | sleep 60 22 | 23 | # Set the DNS record prefix & the Service name and then retrieve the ELB URL 24 | export DNS_RECORD_PREFIX="hugo" 25 | export SERVICE_NAME="hugo-app-svc" 26 | export HUGO_APP_ELB=$(kubectl --context=${CLUSTER_ALIAS} get services/${SERVICE_NAME} --template="{{range .status.loadBalancer.ingress}} {{.hostname}} {{end}}") 27 | 28 | # Add to JSON file 29 | sed -i -e 's|"Name": ".*|"Name": "'"${DNS_RECORD_PREFIX}.${DOMAIN_NAME}"'",|g' scripts/apps/dns-records/dns-record-single.json 30 | sed -i -e 's|"Value": ".*|"Value": "'"${HUGO_APP_ELB}"'"|g' scripts/apps/dns-records/dns-record-single.json 31 | 32 | # Create DNS record 33 | aws route53 change-resource-record-sets --hosted-zone-id ${DOMAIN_NAME_ZONE_ID} --change-batch file://scripts/apps/dns-records/dns-record-single.json -------------------------------------------------------------------------------- /scripts/apps/jenkins/deploy-jenkins.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deploying Jenkins on Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deploying Jenkins on Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Set Jenkins Docker image name in the jenkins-deploy.yaml file 14 | sed -i -e "s|image: .*|image: ${JENKINS_DOCKER_IMAGE_TAG}|g" ./kubernetes/jenkins/jenkins-deploy.yaml 15 | 16 | # Create Kubernetes objects 17 | kubectl --context ${CLUSTER_ALIAS} create -f ./kubernetes/jenkins --record 18 | 19 | # Wait for Jenkins ELB to be created 20 | echo "Waiting for Jenkins ELB to be created (60 seconds)" 21 | sleep 60 22 | 23 | # Set the DNS record prefix & the Service name and then retrieve the ELB URL 24 | export DNS_RECORD_PREFIX="jenkins" 25 | export SERVICE_NAME="jenkins-leader-svc" 26 | export JENKINS_ELB=$(kubectl --context=${CLUSTER_ALIAS} get services/${SERVICE_NAME} --template="{{range .status.loadBalancer.ingress}} {{.hostname}} {{end}}") 27 | 28 | # Add to JSON file 29 | sed -i -e 's|"Name": ".*|"Name": "'"${DNS_RECORD_PREFIX}.${DOMAIN_NAME}"'",|g' scripts/apps/dns-records/dns-record-single.json 30 | sed -i -e 's|"Value": ".*|"Value": "'"${JENKINS_ELB}"'"|g' scripts/apps/dns-records/dns-record-single.json 31 | 32 | # Create DNS record 33 | aws route53 change-resource-record-sets --hosted-zone-id ${DOMAIN_NAME_ZONE_ID} --change-batch file://scripts/apps/dns-records/dns-record-single.json -------------------------------------------------------------------------------- /scripts/apps/windows/iis-app/deploy-windows-iis-app.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deploying Windows IIS (App) on Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deploying Windows IIS (App) on Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Create Kubernetes objects 14 | kubectl --context ${CLUSTER_ALIAS} create -f ./kubernetes/windows/iis-app --record 15 | 16 | # Wait for Windows IIS (App) ELB to be created 17 | echo "Waiting for Windows IIS (App) ELB to be created (60 seconds)" 18 | sleep 60 19 | 20 | # Set the DNS record prefix & the Service name and then retrieve the ELB URL 21 | export DNS_RECORD_PREFIX="iis-app" 22 | export SERVICE_NAME="iis-app-svc" 23 | export HUGO_APP_ELB=$(kubectl --context=${CLUSTER_ALIAS} get services/${SERVICE_NAME} --template="{{range .status.loadBalancer.ingress}} {{.hostname}} {{end}}") 24 | 25 | # Add to JSON file 26 | sed -i -e 's|"Name": ".*|"Name": "'"${DNS_RECORD_PREFIX}.${DOMAIN_NAME}"'",|g' scripts/apps/dns-records/dns-record-single.json 27 | sed -i -e 's|"Value": ".*|"Value": "'"${HUGO_APP_ELB}"'"|g' scripts/apps/dns-records/dns-record-single.json 28 | 29 | # Create DNS record 30 | aws route53 change-resource-record-sets --hosted-zone-id ${DOMAIN_NAME_ZONE_ID} --change-batch file://scripts/apps/dns-records/dns-record-single.json -------------------------------------------------------------------------------- /scripts/apps/windows/iis-default/deploy-windows-iis-default.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deploying Windows IIS (Default) on Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deploying Windows IIS (Default) on Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Create Kubernetes objects 14 | kubectl --context ${CLUSTER_ALIAS} create -f ./kubernetes/windows/iis-default --record 15 | 16 | # Wait for Windows IIS (Default) ELB to be created 17 | echo "Waiting for Windows IIS (Default) ELB to be created (60 seconds)" 18 | sleep 60 19 | 20 | # Set the DNS record prefix & the Service name and then retrieve the ELB URL 21 | export DNS_RECORD_PREFIX="iis-default" 22 | export SERVICE_NAME="iis-default-svc" 23 | export HUGO_APP_ELB=$(kubectl --context=${CLUSTER_ALIAS} get services/${SERVICE_NAME} --template="{{range .status.loadBalancer.ingress}} {{.hostname}} {{end}}") 24 | 25 | # Add to JSON file 26 | sed -i -e 's|"Name": ".*|"Name": "'"${DNS_RECORD_PREFIX}.${DOMAIN_NAME}"'",|g' scripts/apps/dns-records/dns-record-single.json 27 | sed -i -e 's|"Value": ".*|"Value": "'"${HUGO_APP_ELB}"'"|g' scripts/apps/dns-records/dns-record-single.json 28 | 29 | # Create DNS record 30 | aws route53 change-resource-record-sets --hosted-zone-id ${DOMAIN_NAME_ZONE_ID} --change-batch file://scripts/apps/dns-records/dns-record-single.json -------------------------------------------------------------------------------- /scripts/clusters/create-cluster.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [[ $# = 1 ]]; then echo "Must supply both a cluster alias and an AWS availability zone" && exit 1; fi 6 | 7 | if [ -z $1 ]; then echo "Creating - Cluster Alias: ${CLUSTER_ALIAS} | Cluster Full Name: ${CLUSTER_FULL_NAME}"; else 8 | export CLUSTER_ALIAS="$1" && 9 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 10 | echo "Creating - Cluster Alias: ${CLUSTER_ALIAS} | Cluster Full Name: ${CLUSTER_FULL_NAME}"; fi 11 | 12 | if [ -z $2 ]; then echo "AWS Availability Zone: ${CLUSTER_AWS_AZ}"; else 13 | export CLUSTER_AWS_AZ="$2" && 14 | echo "AWS Availability Zone: ${CLUSTER_AWS_AZ}"; fi 15 | 16 | # Pause for 3 seconds 17 | sleep 3 18 | 19 | # Create the S3 bucket used for Kubernetes cluster configuration storage 20 | aws s3api create-bucket --bucket ${CLUSTER_FULL_NAME}-state 21 | 22 | # Set KOPS_STATE_STORE to S3 bucket name 23 | export KOPS_STATE_STORE="s3://${CLUSTER_FULL_NAME}-state" 24 | 25 | # Create the Kubernetes cluster 26 | kops create cluster \ 27 | --name=${CLUSTER_FULL_NAME} \ 28 | --master-zones=${CLUSTER_AWS_AZ} \ 29 | --zones=${CLUSTER_AWS_AZ} \ 30 | --master-size=${CLUSTER_MASTER_SIZE} \ 31 | --node-size=${CLUSTER_NODE_SIZE} \ 32 | --node-count=${CLUSTER_NODE_COUNT} \ 33 | --dns-zone=${DOMAIN_NAME} \ 34 | --ssh-public-key="${AWS_KEYPAIR_PUB_KEY_PATH}" \ 35 | --kubernetes-version=${K8S_VERSION} 36 | 37 | kops edit cluster ${CLUSTER_FULL_NAME} 38 | kops update cluster ${CLUSTER_FULL_NAME} --yes 39 | 40 | # Create cluster context aliases 41 | kubectl config set-context ${CLUSTER_ALIAS} --cluster=${CLUSTER_FULL_NAME} --user=${CLUSTER_FULL_NAME} 42 | 43 | # Set current context to this cluster 44 | kubectl config use-context ${CLUSTER_ALIAS} -------------------------------------------------------------------------------- /scripts/clusters/delete-cluster.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [ -z $1 ]; then echo "Deleting Cluster: ${CLUSTER_ALIAS}"; else 6 | export CLUSTER_ALIAS="$1" && 7 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" && 8 | echo "Deleting Cluster: ${CLUSTER_ALIAS}"; fi 9 | 10 | # Pause for 3 seconds 11 | sleep 3 12 | 13 | # Set KOPS_STATE_STORE to S3 bucket name 14 | export KOPS_STATE_STORE="s3://${CLUSTER_FULL_NAME}-state" 15 | 16 | # Delete the Kubernetes cluster 17 | kops delete cluster ${CLUSTER_FULL_NAME} --yes 18 | 19 | # Delete the S3 bucket used for Kubernetes cluster configuration storage 20 | aws s3api delete-bucket --bucket ${CLUSTER_FULL_NAME}-state -------------------------------------------------------------------------------- /scripts/clusters/federation/create-federation.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Pass positional parameters to variables 5 | if [[ $# -gt 3 ]]; then echo "Only 3 clusters are supported" && exit 1; fi 6 | 7 | if [[ -z $1 ]]; then echo "Must supply a host cluster alias and at least one additional cluster alias" && exit 1; else 8 | export HOST_CLUSTER_ALIAS="$1" && 9 | echo "Host Cluster: ${HOST_CLUSTER_ALIAS}"; fi 10 | 11 | if [[ -z $2 ]]; then echo "Must supply a host cluster alias and at least one additional cluster alias" && exit 1; else 12 | export CLUSTER_2_ALIAS="$2" && 13 | echo "Cluster 2: ${CLUSTER_2_ALIAS}"; fi 14 | 15 | if [[ -n $3 ]]; then 16 | export CLUSTER_3_ALIAS="$3" && 17 | echo "Cluster 3: ${CLUSTER_3_ALIAS}"; fi 18 | 19 | # Pause for 3 seconds 20 | sleep 3 21 | 22 | # Initialize Federation 23 | kubectl config use-context ${HOST_CLUSTER_ALIAS} 24 | 25 | # Wait for Federation Controller & API to be deployed 26 | echo "Creating the Federation Control Plane" 27 | kubefed init ${FEDERATION_NAME} --host-cluster-context=${HOST_CLUSTER_ALIAS} --dns-provider=aws-route53 --dns-zone-name=${DOMAIN_NAME} 28 | 29 | # Sleep for 5 minutes if using Kubernetes v1.5.x 30 | if [[ ${K8S_VERSION} == *"1.5"* ]]; then 31 | echo "Waiting for the Federation Control Plane to initialize (5 minutes)" && 32 | sleep 600 33 | fi 34 | 35 | # Join Clusters to Federation 36 | kubectl config use-context ${FEDERATION_NAME} 37 | kubefed join ${HOST_CLUSTER_ALIAS} --host-cluster-context=${HOST_CLUSTER_ALIAS} --cluster-context=${HOST_CLUSTER_ALIAS} --secret-name=${HOST_CLUSTER_ALIAS}cluster 38 | kubefed join ${CLUSTER_2_ALIAS} --host-cluster-context=${HOST_CLUSTER_ALIAS} --cluster-context=${CLUSTER_2_ALIAS} --secret-name=${CLUSTER_2_ALIAS}cluster 39 | 40 | if [[ -n $3 ]]; then 41 | kubefed join ${CLUSTER_3_ALIAS} --host-cluster-context=${HOST_CLUSTER_ALIAS} --cluster-context=${CLUSTER_3_ALIAS} --secret-name=${CLUSTER_3_ALIAS}cluster 42 | fi 43 | 44 | # Create default and federation namespaces in the Federation context 45 | kubectl create ns default 46 | kubectl create ns federation -------------------------------------------------------------------------------- /scripts/clusters/windows/create-windows-node.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Set KOPS_STATE_STORE to S3 bucket name (leave as-is) 5 | export KOPS_STATE_STORE="s3://${CLUSTER_FULL_NAME}-state" 6 | 7 | # Check if the Linux node(s) are running 8 | export AWS_AVAILABLE_NODE=$(aws ec2 describe-instances --region ${CLUSTER_AWS_REGION} --filters "Name=instance-state-name,Values=running" "Name=tag-value,Values=nodes.${CLUSTER_FULL_NAME}" | jq .Reservations[].Instances[].PrivateDnsName) 9 | 10 | if [ -z $AWS_AVAILABLE_NODE ]; then echo "Waiting for Linux node(s) to be available" && sleep 60; fi 11 | 12 | # Set Terraform variables 13 | echo "Setting Terraform variables" 14 | export TF_VAR_k8s_kube_dns_ip=$(kops get clusters --full -o json | jq --raw-output .spec.kubeDNS.serverIP) && echo "K8s KubeDNS IP: ${TF_VAR_k8s_kube_dns_ip}" 15 | export TF_VAR_k8s_non_masq_cidr=$(kops get clusters --full -o json | jq --raw-output .spec.nonMasqueradeCIDR) && echo "K8s Non-Masquerade CIDR: ${TF_VAR_k8s_non_masq_cidr}" 16 | export TF_VAR_k8s_cluster_name=$(echo $CLUSTER_FULL_NAME) && echo "K8s Cluster Name: ${TF_VAR_k8s_cluster_name}" 17 | export TF_VAR_k8s_keypair_name=$(aws ec2 describe-instances --region ${CLUSTER_AWS_REGION} --filters "Name=instance-state-name,Values=running" "Name=tag-value,Values=nodes.${CLUSTER_FULL_NAME}" | jq --raw-output .Reservations[].Instances[0].KeyName) && echo "K8s Keypair Name: ${TF_VAR_k8s_keypair_name}" 18 | export TF_VAR_k8s_nodes_sg_id=$(aws ec2 describe-instances --region ${CLUSTER_AWS_REGION} --filters "Name=instance-state-name,Values=running" "Name=tag-value,Values=nodes.${CLUSTER_FULL_NAME}" | jq --raw-output .Reservations[].Instances[0].SecurityGroups[].GroupId) && echo "K8s Nodes Security Group ID: ${TF_VAR_k8s_nodes_sg_id}" 19 | export TF_VAR_k8s_subnet_id=$(aws ec2 describe-instances --region ${CLUSTER_AWS_REGION} --filters "Name=instance-state-name,Values=running" "Name=tag-value,Values=nodes.${CLUSTER_FULL_NAME}" | jq --raw-output .Reservations[].Instances[0].SubnetId) && echo "K8s Subnet ID: ${TF_VAR_k8s_subnet_id}" 20 | 21 | # Pause for 3 seconds 22 | sleep 3 23 | 24 | # Change to the Terraform directory and apply the Terraform configuration 25 | cd terraform/k8s-windows-node-aws 26 | rm -rf .terraform/ 27 | rm *terraform.tfstate* 28 | terraform get 29 | terraform init 30 | terraform plan 31 | 32 | echo "Run 'terraform apply' to deploy" -------------------------------------------------------------------------------- /scripts/clusters/windows/delete-windows-node.sh: -------------------------------------------------------------------------------- 1 | # Load variables from variables.sh script 2 | source ./scripts/variables.sh 3 | 4 | # Set KOPS_STATE_STORE to S3 bucket name 5 | export KOPS_STATE_STORE="s3://${CLUSTER_FULL_NAME}-state" 6 | 7 | # Set Terraform variables 8 | echo "Setting Terraform variables" 9 | export TF_VAR_k8s_kube_dns_ip=$(kops get clusters --full -o json | jq --raw-output .spec.kubeDNS.serverIP) && echo "K8s KubeDNS IP: ${TF_VAR_k8s_kube_dns_ip}" 10 | export TF_VAR_k8s_non_masq_cidr=$(kops get clusters --full -o json | jq --raw-output .spec.nonMasqueradeCIDR) && echo "K8s Non-Masquerade CIDR: ${TF_VAR_k8s_non_masq_cidr}" 11 | export TF_VAR_k8s_cluster_name=$(echo $CLUSTER_FULL_NAME) && echo "K8s Cluster Name: ${TF_VAR_k8s_cluster_name}" 12 | export TF_VAR_k8s_keypair_name=$(aws ec2 describe-instances --region ${CLUSTER_AWS_REGION} --filters "Name=instance-state-name,Values=running" "Name=tag-value,Values=nodes.${CLUSTER_FULL_NAME}" | jq --raw-output .Reservations[].Instances[0].KeyName) && echo "K8s Keypair Name: ${TF_VAR_k8s_keypair_name}" 13 | export TF_VAR_k8s_nodes_sg_id=$(aws ec2 describe-instances --region ${CLUSTER_AWS_REGION} --filters "Name=instance-state-name,Values=running" "Name=tag-value,Values=nodes.${CLUSTER_FULL_NAME}" | jq --raw-output .Reservations[].Instances[0].SecurityGroups[].GroupId) && echo "K8s Nodes Security Group ID: ${TF_VAR_k8s_nodes_sg_id}" 14 | export TF_VAR_k8s_subnet_id=$(aws ec2 describe-instances --region ${CLUSTER_AWS_REGION} --filters "Name=instance-state-name,Values=running" "Name=tag-value,Values=nodes.${CLUSTER_FULL_NAME}" | jq --raw-output .Reservations[].Instances[0].SubnetId) && echo "K8s Subnet ID: ${TF_VAR_k8s_subnet_id}" 15 | 16 | # Pause for 3 seconds 17 | sleep 3 18 | 19 | # Change to the Terraform directory and then destroy the Terraform environment 20 | cd terraform/windows-node-aws 21 | terraform destroy -------------------------------------------------------------------------------- /scripts/provision-vagrant.sh: -------------------------------------------------------------------------------- 1 | # Vagrant installation variables 2 | export KUBECTL_VERSION="1.7.6" 3 | export KUBEFED_VERSION="1.7.6" 4 | export KOPS_VERSION="1.7.0" 5 | export HUGO_VERSION="0.27.1" 6 | export TERRAFORM_VERSION="0.10.6" 7 | 8 | # Change to Vagrant home directory 9 | cd /home/vagrant 10 | 11 | # Install git, jq & unzip 12 | sudo apt-get install git -y 13 | sudo apt-get install jq -y 14 | sudo apt-get install unzip -y 15 | 16 | # Install AWS CLI (latest) 17 | curl -s https://s3.amazonaws.com/aws-cli/awscli-bundle.zip -o awscli-bundle.zip 18 | unzip awscli-bundle.zip 19 | sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws 20 | rm -rf awscli-bundle/ awscli-bundle.zip 21 | 22 | # Install Docker (latest) 23 | sudo curl -sSL https://get.docker.com/ | sh 24 | sudo usermod -aG docker vagrant 25 | 26 | # Install Hugo (version specified in Vagrant installation variables above) 27 | wget --quiet https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz 28 | tar -xf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz 29 | sudo chmod +x hugo 30 | sudo mv hugo /usr/local/bin/hugo 31 | rm -rf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz 32 | 33 | # Install Terraform (version specified in Vagrant installation variables above) 34 | wget --quiet https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip 35 | unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip 36 | sudo chmod +x terraform 37 | sudo mv terraform /usr/local/bin/terraform 38 | rm -rf terraform_${TERRAFORM_VERSION}_linux_amd64.zip 39 | 40 | # Install Kubectl (version specified in Vagrant installation variables above) 41 | wget --quiet https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl 42 | sudo chmod +x kubectl 43 | sudo mv kubectl /usr/local/bin/kubectl 44 | 45 | # Install Kubefed (version specified in Vagrant installation variables above) 46 | wget --quiet https://storage.googleapis.com/kubernetes-release/release/v${KUBEFED_VERSION}/bin/linux/amd64/kubefed 47 | sudo chmod +x kubefed 48 | sudo mv kubefed /usr/local/bin/kubefed 49 | 50 | # Install Kops (version specified in Vagrant installation variables above) 51 | wget --quiet https://github.com/kubernetes/kops/releases/download/${KOPS_VERSION}/kops-linux-amd64 52 | sudo chmod +x kops-linux-amd64 53 | sudo mv kops-linux-amd64 /usr/local/bin/kops 54 | 55 | # Setup autocomplete for Kubectl 56 | echo "source <(kubectl completion bash)" >>~/.profile 57 | -------------------------------------------------------------------------------- /scripts/variables.sh: -------------------------------------------------------------------------------- 1 | # General variables 2 | export DOMAIN_NAME="k8s.kumorilabs.com" # Must be updated 3 | 4 | # Cluster variables 5 | export CLUSTER_ALIAS="usa" 6 | export CLUSTER_FULL_NAME="${CLUSTER_ALIAS}.${DOMAIN_NAME}" # Leave as-is 7 | export CLUSTER_AWS_REGION="us-east-1" 8 | export CLUSTER_AWS_AZ="us-east-1a" 9 | export CLUSTER_MASTER_SIZE="t2.medium" 10 | export CLUSTER_NODE_SIZE="t2.medium" 11 | export CLUSTER_NODE_COUNT="2" 12 | export AWS_KEYPAIR_PUB_KEY_PATH="~/.ssh/id_rsa.pub" 13 | export K8S_VERSION="1.7.6" 14 | 15 | # Federation variables 16 | export FEDERATION_NAME="fed" 17 | 18 | # Application variables 19 | export HUGO_APP_DOCKER_IMAGE="smesch/hugo-app" 20 | export JENKINS_DOCKER_IMAGE_TAG="smesch/jenkins-kubernetes-leader-custom:2.32.3" 21 | export DOMAIN_NAME_ZONE_ID=$(aws route53 list-hosted-zones \ 22 | | jq -r '.HostedZones[] | select(.Name=="'${DOMAIN_NAME}'.") | .Id' \ 23 | | sed 's/\/hostedzone\///') # Leave as-is -------------------------------------------------------------------------------- /terraform/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kumorilabs/getting-to-know-k8s/977df384e7d1168f5c153e4ce1306e598afa37e9/terraform/.gitkeep -------------------------------------------------------------------------------- /terraform/k8s-windows-node-aws/init.tpl: -------------------------------------------------------------------------------- 1 | 4 | 5 | $admin = [ADSI]("WinNT://./administrator, user") 6 | $admin.SetPassword("${windows_admin_password}") 7 | netsh advfirewall set allprofiles state off 8 | -------------------------------------------------------------------------------- /terraform/k8s-windows-node-aws/main.tf: -------------------------------------------------------------------------------- 1 | # AWS K8s Windows Node 2 | # Main Configuration File 3 | 4 | # Specify AWS as the provider and the AWS region 5 | provider "aws" { 6 | region = "${var.aws_region}" 7 | } 8 | 9 | # Add RDP & WinRM (HTTP) rules to existing K8s nodes security group 10 | resource "aws_security_group_rule" "allow-RDP" { 11 | type = "ingress" 12 | from_port = 3389 13 | to_port = 3389 14 | protocol = "tcp" 15 | cidr_blocks = ["0.0.0.0/0"] 16 | 17 | security_group_id = "${var.k8s_nodes_sg_id}" 18 | } 19 | 20 | resource "aws_security_group_rule" "allow-WinRM" { 21 | type = "ingress" 22 | from_port = 5985 23 | to_port = 5985 24 | protocol = "tcp" 25 | cidr_blocks = ["0.0.0.0/0"] 26 | 27 | security_group_id = "${var.k8s_nodes_sg_id}" 28 | } 29 | 30 | # Create Instance(s) for Windows Node(s) 31 | module "aws-k8s-win-host" { 32 | source = "./modules" 33 | aws_region = "${var.aws_region}" 34 | aws_instance_size = "${var.aws_instance_size}" 35 | windows_admin_password = "${var.windows_admin_password}" 36 | k8s_version = "${var.k8s_version}" 37 | k8s_instance_count = "${var.k8s_instance_count}" 38 | k8s_kube_dns_ip = "${var.k8s_kube_dns_ip}" 39 | k8s_non_masq_cidr = "${var.k8s_non_masq_cidr}" 40 | k8s_cluster_name = "${var.k8s_cluster_name}" 41 | k8s_keypair_name = "${var.k8s_keypair_name}" 42 | k8s_nodes_sg_id = "${var.k8s_nodes_sg_id}" 43 | k8s_subnet_id = "${var.k8s_subnet_id}" 44 | } 45 | 46 | # Post Deployment Tasks 47 | resource "null_resource" "local-post-deployment-tasks" { 48 | depends_on = ["module.aws-k8s-win-host"] 49 | provisioner "local-exec" { 50 | command = "kubectl delete limitrange limits" 51 | } 52 | } -------------------------------------------------------------------------------- /terraform/k8s-windows-node-aws/modules/main.tf: -------------------------------------------------------------------------------- 1 | # Specify AWS as the provider and the AWS region 2 | # provider "aws" { 3 | # region = "${var.aws_region}" 4 | # } 5 | 6 | # Template file for User Data 7 | data "template_file" "init" { 8 | template = "${file("init.tpl")}" 9 | 10 | vars { 11 | windows_admin_password = "${var.windows_admin_password}" 12 | } 13 | } 14 | 15 | data "aws_ami" "windows_server_2016_containers" { 16 | filter { 17 | name = "owner-alias" 18 | values = ["amazon"] 19 | } 20 | 21 | filter { 22 | name = "name" 23 | values = ["Windows_Server-2016-English-Full-Containers*"] 24 | } 25 | 26 | most_recent = true 27 | } 28 | 29 | # Create Instance for Windows Node 30 | resource "aws_instance" "aws-k8s-win-host" { 31 | instance_type = "${var.aws_instance_size}" 32 | ami = "${data.aws_ami.windows_server_2016_containers.id}" // "${lookup(var.aws_amis, var.aws_region)}" 33 | key_name = "${var.k8s_keypair_name}" 34 | vpc_security_group_ids = ["${var.k8s_nodes_sg_id}"] 35 | subnet_id = "${var.k8s_subnet_id}" 36 | iam_instance_profile = "nodes.${var.k8s_cluster_name}" 37 | associate_public_ip_address = true 38 | source_dest_check = false 39 | user_data = "${data.template_file.init.rendered}" 40 | count = "${var.k8s_instance_count}" 41 | tags { 42 | Name = "nodes.${var.k8s_cluster_name}" 43 | KubernetesCluster = "${var.k8s_cluster_name}" 44 | "k8s.io/role/node" = "1" 45 | } 46 | root_block_device { 47 | volume_size = 60 48 | delete_on_termination = true 49 | } 50 | } 51 | 52 | # Add NIC 2 to Windows Node 53 | resource "aws_network_interface" "aws-k8s-win-host-nic2" { 54 | depends_on = ["aws_instance.aws-k8s-win-host"] 55 | description = "aws-k8s-win-host-nic2-docker" 56 | count = "${var.k8s_instance_count}" 57 | subnet_id = "${var.k8s_subnet_id}" 58 | security_groups = ["${var.k8s_nodes_sg_id}"] 59 | source_dest_check = false 60 | 61 | attachment { 62 | instance = "${element(aws_instance.aws-k8s-win-host.*.id, count.index)}" 63 | device_index = 1 64 | } 65 | } 66 | 67 | # Add NIC 3 to Windows Node 68 | resource "aws_network_interface" "aws-k8s-win-host-nic3" { 69 | depends_on = ["aws_network_interface.aws-k8s-win-host-nic2"] 70 | description = "aws-k8s-win-host-nic3-internal" 71 | count = "${var.k8s_instance_count}" 72 | subnet_id = "${var.k8s_subnet_id}" 73 | security_groups = ["${var.k8s_nodes_sg_id}"] 74 | source_dest_check = false 75 | 76 | attachment { 77 | instance = "${element(aws_instance.aws-k8s-win-host.*.id, count.index)}" 78 | device_index = 2 79 | } 80 | } 81 | 82 | # Provision Windows Node(s) 83 | resource "null_resource" "aws-k8s-win-host-provisioning" { 84 | depends_on = ["aws_instance.aws-k8s-win-host"] 85 | count = "${var.k8s_instance_count}" 86 | connection { 87 | type = "winrm" 88 | user = "administrator" 89 | password = "${var.windows_admin_password}" 90 | host = "${element(aws_instance.aws-k8s-win-host.*.public_ip, count.index)}" 91 | port = "5985" 92 | timeout = "20m" 93 | } 94 | provisioner "file" { 95 | source = "~/.kube/config" 96 | destination = "c:/k8s/config" 97 | } 98 | provisioner "file" { 99 | source = "provision" 100 | destination = "c:/k8s" 101 | } 102 | provisioner "remote-exec" { 103 | inline = [ 104 | "powershell.exe -ExecutionPolicy Unrestricted -File C:/k8s/provision-k8s-windows.ps1 -AWSHostname ${element(aws_instance.aws-k8s-win-host.*.private_dns, count.index)} -AWSK8sWinHostNic1 ${element(aws_instance.aws-k8s-win-host.*.private_ip, count.index)} -AWSK8sWinHostNic2 ${element(aws_network_interface.aws-k8s-win-host-nic2.*.private_ip, count.index)} -AWSK8sWinHostNic3 ${element(aws_network_interface.aws-k8s-win-host-nic3.*.private_ip, count.index)} -KubeDnsServiceIp ${var.k8s_kube_dns_ip} -NonMasqCIDR ${var.k8s_non_masq_cidr} -K8sVersion ${var.k8s_version}" 105 | ] 106 | } 107 | } 108 | 109 | # # Enable NAT on Windows Node(s) 110 | # resource "null_resource" "aws-k8s-win-host-nat" { 111 | # depends_on = ["aws_instance.aws-k8s-win-host"] 112 | # count = "${var.k8s_instance_count}" 113 | # connection { 114 | # type = "winrm" 115 | # user = "administrator" 116 | # password = "${var.windows_admin_password}" 117 | # host = "${element(aws_instance.aws-k8s-win-host.*.public_ip, count.index)}" 118 | # port = "5985" 119 | # timeout = "20m" 120 | # } 121 | # provisioner "file" { 122 | # source = "nat" 123 | # destination = "c:/k8s" 124 | # } 125 | # provisioner "remote-exec" { 126 | # inline = [ 127 | # "powershell.exe -ExecutionPolicy Unrestricted -File C:/k8s/enable-rras-nat.ps1" 128 | # ] 129 | # } 130 | # } 131 | 132 | # Post Deployment Tasks 133 | resource "null_resource" "local-post-deployment-tasks" { 134 | depends_on = ["null_resource.aws-k8s-win-host-provisioning"] 135 | count = "${var.k8s_instance_count}" 136 | provisioner "local-exec" { 137 | command = < 8 | [CmdletBinding(DefaultParameterSetName="Standard")] 9 | param( 10 | [parameter(Mandatory=$true)] 11 | [ValidateNotNullOrEmpty()] 12 | $AWSHostname, 13 | 14 | [parameter(Mandatory=$true)] 15 | [ValidateNotNullOrEmpty()] 16 | $AWSK8sWinHostNic1, 17 | 18 | [parameter(Mandatory=$true)] 19 | [ValidateNotNullOrEmpty()] 20 | $AWSK8sWinHostNic2, 21 | 22 | [parameter(Mandatory=$true)] 23 | [ValidateNotNullOrEmpty()] 24 | $AWSK8sWinHostNic3, 25 | 26 | [parameter(Mandatory=$true)] 27 | [ValidateNotNullOrEmpty()] 28 | $KubeDnsServiceIp, 29 | 30 | [parameter(Mandatory=$true)] 31 | [ValidateNotNullOrEmpty()] 32 | $NonMasqCIDR, 33 | 34 | [parameter(Mandatory=$true)] 35 | [ValidateNotNullOrEmpty()] 36 | $K8sVersion 37 | ) 38 | 39 | $global:KubeDir = "c:\k8s" 40 | $global:7ZipBinariesURL = "http://www.7-zip.org/a/7za920.zip" 41 | $global:KubeBinariesURL = "https://dl.k8s.io/v" + ${K8sVersion} + "/kubernetes-node-windows-amd64.tar.gz" 42 | $global:NSSMBinariesURL = "https://nssm.cc/release/nssm-2.24.zip" 43 | $global:KubeletStartFile = $global:KubeDir + "\Start-Kubelet.ps1" 44 | $global:KubeProxyStartFile = $global:KubeDir + "\Start-Kube-proxy.ps1" 45 | $global:TransparentNetworkName = "TransparentNet" 46 | $global:VMSwitchNetworkName = "KubeProxySwitch" 47 | $global:PodInfraContainerName = "apprenda/pause" 48 | 49 | 50 | filter Timestamp {"$(Get-Date -Format o): $_"} 51 | 52 | function 53 | Write-Log($message) 54 | { 55 | $msg = $message | Timestamp 56 | Write-Output $msg 57 | } 58 | 59 | 60 | function 61 | Set-BaseNetwork() 62 | { 63 | $nic1 = Get-NetIPAddress | Where-Object IPAddress -Eq ${AWSK8sWinHostNic1} | Select -ExpandProperty InterfaceAlias 64 | $nic2 = Get-NetIPAddress | Where-Object IPAddress -Eq ${AWSK8sWinHostNic2} | Select -ExpandProperty InterfaceAlias 65 | $nic3 = Get-NetIPAddress | Where-Object IPAddress -Eq ${AWSK8sWinHostNic3} | Select -ExpandProperty InterfaceAlias 66 | 67 | Get-NetAdapter -Name $nic1 | Rename-NetAdapter -NewName "nic-1-external" -PassThru 68 | Get-NetAdapter -Name $nic2 | Rename-NetAdapter -NewName "nic-2-docker" -PassThru 69 | Get-NetAdapter -Name $nic3 | Rename-NetAdapter -NewName "nic-3-internal" -PassThru 70 | 71 | Remove-NetRoute -DestinationPrefix 0.0.0.0/0 -InterfaceAlias "nic-2-docker" -AsJob 72 | Remove-NetRoute -DestinationPrefix 0.0.0.0/0 -InterfaceAlias "nic-3-internal" -AsJob 73 | 74 | New-NetRoute -DestinationPrefix ${NonMasqCIDR} -InterfaceAlias "nic-3-internal" 75 | } 76 | 77 | 78 | function 79 | Get-KubeBinaries() 80 | { 81 | cd $global:KubeDir 82 | do{sleep 10;(New-Object System.Net.WebClient).DownloadFile("$global:7ZipBinariesURL", "$global:KubeDir\7z.zip")}while(!$?);&"$global:KubeDir\7z.zip" 83 | Expand-Archive .\7z.zip -DestinationPath .\7z\ 84 | mv 7z\7za.exe . 85 | do{sleep 10;(New-Object System.Net.WebClient).DownloadFile("$global:KubeBinariesURL", "$global:KubeDir\kubernetes-node-windows-amd64.tar.gz")}while(!$?);&"$global:KubeDir\kubernetes-node-windows-amd64.tar.gz" 86 | cmd /c "$global:KubeDir\7za.exe e kubernetes-node-windows-amd64.tar.gz" 87 | cmd /c "$global:KubeDir\7za.exe x kubernetes-node-windows-amd64.tar" 88 | mv kubernetes\node\bin\*.exe . 89 | Remove-Item -Recurse -Force kubernetes 90 | Remove-Item -Recurse -Force kubernetes-node-windows-amd64* 91 | Remove-Item -Recurse -Force 7z* 92 | } 93 | 94 | 95 | function 96 | Get-NSSMBinary() 97 | { 98 | cd $global:KubeDir 99 | do{sleep 10;(New-Object System.Net.WebClient).DownloadFile("$global:NSSMBinariesURL", "$global:KubeDir\nssm.zip")}while(!$?);&"$global:KubeDir\nssm.zip" 100 | Expand-Archive .\nssm.zip -DestinationPath . 101 | mv nssm-2.24\win64\nssm.exe . 102 | Remove-Item -Recurse -Force nssm.zip 103 | Remove-Item -Recurse -Force nssm-2.24 104 | } 105 | 106 | 107 | function 108 | Get-InfraContainer() 109 | { 110 | Restart-Service docker 111 | Start-Sleep -s 5 112 | docker pull $global:PodInfraContainerName 113 | } 114 | 115 | 116 | function 117 | Get-PodCIDR 118 | { 119 | $argList = @("--hostname-override=${AWSHostname}","--pod-infra-container-image=${global:PodInfraContainerName}","--resolv-conf=""""","--kubeconfig=${global:KubeDir}\config","--require-kubeconfig") 120 | $process = Start-Process -FilePath $global:KubeDir\kubelet.exe -PassThru -ArgumentList $argList 121 | 122 | $podCIDRDiscovered=$false 123 | $podCIDR="" 124 | # Run Kubelet until podCidr is discovered 125 | Write-Host "Waiting to discover the pod CIDR" 126 | while (-not $podCIDRDiscovered) 127 | { 128 | $podCIDR=C:\k8s\kubectl.exe --kubeconfig=${global:KubeDir}\config get nodes/$(${AWSHostname}.ToLower()) -o custom-columns=podCidr:.spec.podCIDR --no-headers 129 | 130 | if ($podCIDR.length -gt 0) 131 | { 132 | $podCIDRDiscovered=$true 133 | } 134 | else 135 | { 136 | Write-Host "Sleeping for 10s, and then try again to discover pod CIDR" 137 | Start-Sleep -sec 10 138 | } 139 | } 140 | 141 | # Stop the Kubelet process now that we have our CIDR, discard the process output 142 | $process | Stop-Process | Out-Null 143 | 144 | return $podCIDR 145 | } 146 | 147 | 148 | function 149 | Get-PodGateway($podCIDR) 150 | { 151 | return $podCIDR.substring(0,$podCIDR.lastIndexOf(".")) + ".1" 152 | } 153 | 154 | 155 | function 156 | Write-KubernetesStartFiles($podCIDR) 157 | { 158 | $podGW=Get-PodGateway($podCIDR) 159 | 160 | $kubeConfig = @" 161 | `$env:CONTAINER_NETWORK="${global:TransparentNetworkName}" 162 | ${global:KubeDir}\kubelet.exe --hostname-override=${AWSHostname} --pod-infra-container-image=${global:PodInfraContainerName} --resolv-conf="" --allow-privileged=true --enable-debugging-handlers=true --cluster-dns=${KubeDnsServiceIp} --cluster-domain=cluster.local --kubeconfig=${global:KubeDir}\config --require-kubeconfig --hairpin-mode=promiscuous-bridge --v=2 --non-masquerade-cidr=${NonMasqCIDR} 163 | "@ 164 | $kubeConfig | Out-File -encoding ASCII -filepath $global:KubeletStartFile 165 | 166 | $kubeProxyStartStr = @" 167 | `$env:INTERFACE_TO_ADD_SERVICE_IP="vEthernet (${global:VMSwitchNetworkName})" 168 | $global:KubeDir\kube-proxy.exe --v=3 --proxy-mode=userspace --hostname-override=${AWSHostname} --kubeconfig=${global:KubeDir}\config --bind-address=${AWSK8sWinHostNic1} 169 | "@ 170 | 171 | $kubeProxyStartStr | Out-File -encoding ASCII -filepath $global:KubeProxyStartFile 172 | } 173 | 174 | 175 | function 176 | Set-DockerNetwork($podCIDR) 177 | { 178 | $podGW=Get-PodGateway($podCIDR) 179 | 180 | # Reduce MTU for both network interfaces to stop RDP from breaking 181 | netsh interface ipv4 set interface "nic-1-external" mtu=1430 store=persistent 182 | netsh interface ipv4 set interface "nic-2-docker" mtu=1430 store=persistent 183 | netsh interface ipv4 set interface "nic-3-internal" mtu=1430 store=persistent 184 | 185 | # Turn off Firewall to enable pods to talk to service endpoints 186 | netsh advfirewall set allprofiles state off 187 | 188 | # Create new transparent network 189 | docker network create --driver=transparent --subnet=${podCIDR} --gateway=${podGW} -o com.docker.network.windowsshim.interface="nic-2-docker" -o com.docker.network.windowsshim.dnsservers=${KubeDnsServiceIp} ${global:TransparentNetworkName} 190 | 191 | # Set IP address for Transparent network 192 | netsh interface ipv4 add address "vEthernet (HNSTransparent)" ${podGW} 255.255.255.0 193 | 194 | # Create VMSwitch for kube-proxy 195 | New-VMSwitch -Name ${global:VMSwitchNetworkName} -SwitchType Internal 196 | 197 | # Enable forwarding on host adapters 198 | netsh interface ipv4 set interface "vEthernet (${global:VMSwitchNetworkName})" for=en 199 | netsh interface ipv4 set interface "vEthernet (HNSTransparent)" for=en 200 | netsh interface ipv4 set interface "nic-1-external" for=en 201 | netsh interface ipv4 set interface "nic-3-internal" for=en 202 | } 203 | 204 | 205 | function 206 | Set-RoutingNat() 207 | { 208 | # Install and enable RRAS 209 | Install-WindowsFeature Routing -IncludeManagementTools 210 | Install-RemoteAccess -VpnType Vpn 211 | 212 | # Pause for 30 seconds 213 | sleep 30 214 | 215 | # Configure RRAS for NAT to enable external connectivity from pods 216 | netsh routing ip nat install 217 | sleep 30 218 | netsh routing ip nat add interface "nic-1-external" 219 | sleep 30 220 | netsh routing ip nat set interface "nic-1-external" mode=full 221 | } 222 | 223 | 224 | function 225 | New-NSSMService 226 | { 227 | # Setup Kubelet service 228 | C:\k8s\nssm install Kubelet C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe 229 | C:\k8s\nssm set Kubelet AppDirectory $global:KubeDir 230 | C:\k8s\nssm set Kubelet AppParameters $global:KubeletStartFile 231 | C:\k8s\nssm set Kubelet DisplayName Kubelet 232 | C:\k8s\nssm set Kubelet Description Kubelet 233 | C:\k8s\nssm set Kubelet Start SERVICE_AUTO_START 234 | C:\k8s\nssm set Kubelet ObjectName LocalSystem 235 | C:\k8s\nssm set Kubelet Type SERVICE_WIN32_OWN_PROCESS 236 | C:\k8s\nssm set Kubelet AppThrottle 1500 237 | C:\k8s\nssm set Kubelet AppStdout $global:KubeDir\kubelet.log 238 | C:\k8s\nssm set Kubelet AppStderr $global:KubeDir\kubelet.err.log 239 | C:\k8s\nssm set Kubelet AppStdoutCreationDisposition 4 240 | C:\k8s\nssm set Kubelet AppStderrCreationDisposition 4 241 | C:\k8s\nssm set Kubelet AppRotateFiles 1 242 | C:\k8s\nssm set Kubelet AppRotateOnline 1 243 | C:\k8s\nssm set Kubelet AppRotateSeconds 86400 244 | C:\k8s\nssm set Kubelet AppRotateBytes 1048576 245 | net start Kubelet 246 | 247 | # Setup Kube-proxy Service 248 | C:\k8s\nssm install Kubeproxy C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe 249 | C:\k8s\nssm set Kubeproxy AppDirectory $global:KubeDir 250 | C:\k8s\nssm set Kubeproxy AppParameters $global:KubeProxyStartFile 251 | C:\k8s\nssm set Kubeproxy DisplayName Kubeproxy 252 | C:\k8s\nssm set Kubeproxy DependOnService Kubelet 253 | C:\k8s\nssm set Kubeproxy Description Kubeproxy 254 | C:\k8s\nssm set Kubeproxy Start SERVICE_AUTO_START 255 | C:\k8s\nssm set Kubeproxy ObjectName LocalSystem 256 | C:\k8s\nssm set Kubeproxy Type SERVICE_WIN32_OWN_PROCESS 257 | C:\k8s\nssm set Kubeproxy AppThrottle 1500 258 | C:\k8s\nssm set Kubeproxy AppStdout $global:KubeDir\kubeproxy.log 259 | C:\k8s\nssm set Kubeproxy AppStderr $global:KubeDir\kubeproxy.err.log 260 | C:\k8s\nssm set Kubeproxy AppRotateFiles 1 261 | C:\k8s\nssm set Kubeproxy AppRotateOnline 1 262 | C:\k8s\nssm set Kubeproxy AppRotateSeconds 86400 263 | C:\k8s\nssm set Kubeproxy AppRotateBytes 1048576 264 | net start Kubeproxy 265 | } 266 | 267 | function 268 | Set-Explorer 269 | { 270 | # Setup explorer so that it is usable 271 | New-Item -Path HKLM:"\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer" 272 | New-Item -Path HKLM:"\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\BrowserEmulation" 273 | New-ItemProperty -Path HKLM:"\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\BrowserEmulation" -Name IntranetCompatibilityMode -Value 0 -Type DWord 274 | New-Item -Path HKLM:"\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\Main" 275 | New-ItemProperty -Path HKLM:"\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\\Main" -Name "Start Page" -Type String -Value http://bing.com 276 | } 277 | 278 | try 279 | { 280 | # Set to false for debugging 281 | if ($true) { 282 | Write-Log "Setting up K8s Windows Node..." 283 | 284 | Write-Log "Setup the base network" 285 | Set-BaseNetwork 286 | 287 | Write-Log "Download Kubernetes binaries" 288 | Get-KubeBinaries 289 | 290 | Write-Log "Download NSSM binary" 291 | Get-NSSMBinary 292 | 293 | Write-Log "Download the pause container for Kubelet" 294 | Get-InfraContainer 295 | 296 | Write-Log "Get the POD CIDR" 297 | $podCIDR = Get-PodCIDR 298 | 299 | Write-Log "Write Kubelet startfile with pod CIDR of $podCIDR" 300 | Write-KubernetesStartFiles $podCIDR 301 | 302 | Write-Log "Setup Docker network with pod CIDR of $podCIDR" 303 | Set-DockerNetwork $podCIDR 304 | 305 | Write-Log "Setup Routing and Remote Access for NAT" 306 | Set-RoutingNat 307 | 308 | Write-Log "Install the NSSM services" 309 | New-NSSMService 310 | 311 | Write-Log "Setup Internet Explorer" 312 | Set-Explorer 313 | 314 | Write-Log "Setup Complete" 315 | } 316 | else 317 | { 318 | # Keep for debugging purposes 319 | Write-Log ".\provision-k8s-windows.ps1 -AWSHostname $AWSHostname -AWSK8sWinHostNic1 $AWSK8sWinHostNic1 -AWSK8sWinHostNic2 $AWSK8sWinHostNic2 -AWSK8sWinHostNic3 $AWSK8sWinHostNic3 -KubeDnsServiceIp $KubeDnsServiceIp -NonMasqCIDR $NonMasqCIDR -K8sVersion $K8sVersion" 320 | } 321 | } 322 | catch 323 | { 324 | Write-Error $_ 325 | } 326 | -------------------------------------------------------------------------------- /terraform/k8s-windows-node-aws/variables.tf: -------------------------------------------------------------------------------- 1 | # AWS K8s Windows Node Variables 2 | variable "aws_region" { 3 | description = "AWS Region" 4 | default = "us-east-1" 5 | } 6 | 7 | variable "aws_instance_size" { 8 | description = "AWS Instance Size for Windows Node" 9 | default = "t2.medium" 10 | } 11 | 12 | variable "windows_admin_password" { 13 | description = "Password for Windows Administrator User" 14 | default = "Password12All4help!" 15 | } 16 | 17 | variable "k8s_version" { 18 | description = "K8s Version" 19 | default = "1.7.6" 20 | } 21 | 22 | variable "k8s_instance_count" { 23 | description = "K8s Number of Instances" 24 | default = "2" 25 | } 26 | 27 | variable "k8s_kube_dns_ip" { 28 | description = "K8s KubeDNS IP" 29 | } 30 | 31 | variable "k8s_non_masq_cidr" { 32 | description = "K8s Non-Masquerade CIDR" 33 | } 34 | 35 | variable "k8s_cluster_name" { 36 | description = "K8s Cluster Name" 37 | } 38 | 39 | variable "k8s_keypair_name" { 40 | description = "K8s Keypair Name" 41 | } 42 | 43 | variable "k8s_nodes_sg_id" { 44 | description = "K8s Nodes Security Group ID" 45 | } 46 | 47 | variable "k8s_subnet_id" { 48 | description = "K8s Subnet ID" 49 | } --------------------------------------------------------------------------------