From a351cd5517294de593d706bcdff8d8e7cd8ee140 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Wed, 13 Feb 2019 21:16:37 -0500 Subject: [PATCH 1/7] Rev versions of containerd and Kubernetes --- build/amis/README.md | 2 +- build/amis/ansible/roles/containerd/defaults/main.yml | 4 ++-- build/amis/packer/packer.json | 2 +- cmd/clusterctl/examples/aws/machines.yaml.template | 6 +++--- docs/amis.md | 4 ++-- docs/creating-multinode-controlplane-clusters.md | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/amis/README.md b/build/amis/README.md index baa0dd2220..69961ccea8 100644 --- a/build/amis/README.md +++ b/build/amis/README.md @@ -22,7 +22,7 @@ The following variables can be overriden when building images using the `-var` o | Variable | Default | Description | | ---------------------- | --------- | ----------------------------- | -| kubernetes_version | 1.13.2-00 | Kubernetes Version to install | +| kubernetes_version | 1.13.3-00 | Kubernetes Version to install | | kubernetes_cni_version | 0.6.0-00 | CNI Version to install | For example, to build all images for use with Kubernetes 1.11.3 for build version 1: diff --git a/build/amis/ansible/roles/containerd/defaults/main.yml b/build/amis/ansible/roles/containerd/defaults/main.yml index ffe3363396..7c848b6c2c 100644 --- a/build/amis/ansible/roles/containerd/defaults/main.yml +++ b/build/amis/ansible/roles/containerd/defaults/main.yml @@ -12,5 +12,5 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -containerd_version: "1.2.1" -containerd_sha256: 329d44850685f8b511779c00763df50dd24257b3a1c594aff57e77bcee1b1269 +containerd_version: "1.2.4" +containerd_sha256: "3391758c62d17a56807ddac98b05487d9e78e5beb614a0602caab747b0eda9e0" \ No newline at end of file diff --git a/build/amis/packer/packer.json b/build/amis/packer/packer.json index ce3821a655..53d3884143 100644 --- a/build/amis/packer/packer.json +++ b/build/amis/packer/packer.json @@ -3,7 +3,7 @@ "aws_access_key": "", "aws_secret_key": "", "build_timestamp": "{{timestamp}}", - "kubernetes_version": "1.13.2-00", + "kubernetes_version": "1.13.3-00", "kubernetes_cni_version": "0.6.0-00", "existing_ansible_ssh_args": "{{env `ANSIBLE_SSH_ARGS`}}", "ami_groups": "all", diff --git a/cmd/clusterctl/examples/aws/machines.yaml.template b/cmd/clusterctl/examples/aws/machines.yaml.template index 4bf4b845fd..113715e2dd 100644 --- a/cmd/clusterctl/examples/aws/machines.yaml.template +++ b/cmd/clusterctl/examples/aws/machines.yaml.template @@ -10,8 +10,8 @@ items: set: controlplane spec: versions: - kubelet: v1.13.2 - controlPlane: v1.13.2 + kubelet: v1.13.3 + controlPlane: v1.13.3 providerSpec: value: apiVersion: awsprovider/v1alpha1 @@ -28,7 +28,7 @@ items: set: node spec: versions: - kubelet: v1.13.2 + kubelet: v1.13.3 providerSpec: value: apiVersion: awsprovider/v1alpha1 diff --git a/docs/amis.md b/docs/amis.md index b25f82c23c..ff2c5f1ab6 100644 --- a/docs/amis.md +++ b/docs/amis.md @@ -4,14 +4,14 @@ -- [Kubernetes Version v1.13.2](#kubernetes-version-v1132) +- [Kubernetes Version v1.13.3](#kubernetes-version-v1133) - [Amazon Linux 2](#amazon-linux-2) - [CentOS 7](#centos-7) - [Ubuntu 18.04 (Bionic)](#ubuntu-1804-bionic) -## Kubernetes Version v1.13.2 +## Kubernetes Version v1.13.3 ### Amazon Linux 2 diff --git a/docs/creating-multinode-controlplane-clusters.md b/docs/creating-multinode-controlplane-clusters.md index c0d1f9527a..5e45d7087f 100644 --- a/docs/creating-multinode-controlplane-clusters.md +++ b/docs/creating-multinode-controlplane-clusters.md @@ -28,8 +28,8 @@ Now that you have a cluster with a single instance control plane, more control p set: controlplane spec: versions: - kubelet: v1.13.2 - controlPlane: v1.13.2 + kubelet: v1.13.3 + controlPlane: v1.13.3 providerSpec: value: apiVersion: awsprovider/v1alpha1 From abdabf741530ba5a3def300a246674ff2e2614f9 Mon Sep 17 00:00:00 2001 From: Naadir Jeewa Date: Thu, 14 Feb 2019 12:31:18 +0000 Subject: [PATCH 2/7] Fix incorrect packer-goss instructions Signed-off-by: Naadir Jeewa Signed-off-by: Naadir Jeewa --- build/amis/README.md | 14 ++++++++++++-- build/amis/packer/Makefile | 22 ++++++++++++++++++++++ docs/README.md | 2 +- docs/packer.md | 33 --------------------------------- 4 files changed, 35 insertions(+), 36 deletions(-) create mode 100644 build/amis/packer/Makefile delete mode 100644 docs/packer.md diff --git a/build/amis/README.md b/build/amis/README.md index 69961ccea8..a9a7d3e4d5 100644 --- a/build/amis/README.md +++ b/build/amis/README.md @@ -6,8 +6,18 @@ This directory contains tooling for building base images for use as nodes in Kub ### Prerequisites for all images -- [Packer](https://www.packer.io/docs/installation.html) +- [Packer](https://www.packer.io/intro/getting-started/install.html) - [Ansible](http://docs.ansible.com/ansible/latest/intro_installation.html) version >= 2.4.0.0 +- [goss](https://github.com/YaleUniversity/packer-provisioner-goss) + +#### Installing the goss plugin + +To install `packer-goss` plugin the following should be executed inside of the +`build/amis/packer` directory: + +```bash +make plugins +``` ### Prerequisites for Amazon Web Services @@ -21,7 +31,7 @@ This directory contains tooling for building base images for use as nodes in Kub The following variables can be overriden when building images using the `-var` option when calling `packer build`: | Variable | Default | Description | -| ---------------------- | --------- | ----------------------------- | +|------------------------|-----------|-------------------------------| | kubernetes_version | 1.13.3-00 | Kubernetes Version to install | | kubernetes_cni_version | 0.6.0-00 | CNI Version to install | diff --git a/build/amis/packer/Makefile b/build/amis/packer/Makefile new file mode 100644 index 0000000000..bce6d05933 --- /dev/null +++ b/build/amis/packer/Makefile @@ -0,0 +1,22 @@ +HOSTOS := $(shell go env GOHOSTOS) +HOSTARCH := $(shell go env GOARCH) +BINARYPATHPATTERN :=${HOSTOS}-${HOSTARCH} +VERSION := v0.3.0 + +PLUGINS_GOSS_URL := https://github.com/YaleUniversity/packer-provisioner-goss/releases/download/$(VERSION)/packer-provisioner-goss-$(VERSION)-$(BINARYPATHPATTERN) +PLUGINS_GOSS_SHA256-linux-amd64 := 28be39d0ddf9ad9c14e432818261abed2f2bd83257cfba213e19d5c59b710d03 +PLUGINS_GOSS_SHA256-darwin-amd64 := 7ae43b5dbd26a166c8673fc7299e91d1c2244c7d2b3b558ce04e2e53acfa6f88 + + +${HOME}/.packer.d/plugins/packer-provisioner-goss: + mkdir -p ${HOME}/.packer.d + mkdir -p ${HOME}/.packer.d/plugins + mkdir -p /tmp/packer-plugins + curl -L -o /tmp/packer-plugins/packer-provisioner-goss ${PLUGINS_GOSS_URL} + echo ${PLUGINS_GOSS_SHA256-$(BINARYPATHPATTERN)} */tmp/packer-plugins/packer-provisioner-goss > /tmp/packer-plugins/SHA256SUMS + shasum -c /tmp/packer-plugins/SHA256SUMS + mv /tmp/packer-plugins/packer-provisioner-goss ${HOME}/.packer.d/plugins + chmod +x ${HOME}/.packer.d/plugins/packer-provisioner-goss + +.PHONY: plugins +plugins: ${HOME}/.packer.d/plugins/packer-provisioner-goss diff --git a/docs/README.md b/docs/README.md index 6eb03f73b7..7ce4153031 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,7 +5,7 @@ - [Getting started](getting-started.md) - [List of AMIs](amis.md) - [Accessing cluster instances](accessing-instances.md) -- [Packer](packer.md) +- [Building AMIs with Packer](../build/amis/README.md) ## Development diff --git a/docs/packer.md b/docs/packer.md deleted file mode 100644 index 088d942a46..0000000000 --- a/docs/packer.md +++ /dev/null @@ -1,33 +0,0 @@ -# Using Packer and baking AMIs - -## Overview - -[Packer](http://packer.io/) is well known tool for baking images of any kind. -We use it to bake our AMIs. - -## Prerequisites - -* `packer` binary -* [packer-goss](https://github.com/YaleUniversity/packer-provisioner-goss) plugin -* ansible - -## Plugin instalation - -To install `packer-goss` plugin the following should be executed inside of the -`build/amis/packer` directory: - -```bash -$ curl -o packer-goss https://github.com/YaleUniversity/packer-provisioner-goss/releases/download/v0.3.0/packer-provisioner-goss-v0.3.0-linux-amd64 - -$ chmod +x packer-goss -``` - -## Running Packer - -The following command should build all the AMIs: - -```bash -$ AWS_REGION=us-east-1 packer build -var-file=base-images-us-east-1.json packer.json -``` - -**NOTE** that AWS credentials have to be set. \ No newline at end of file From d569edfda505dc2f276fe22dac67a5fe1fe17b7e Mon Sep 17 00:00:00 2001 From: Naadir Jeewa Date: Thu, 14 Feb 2019 12:31:18 +0000 Subject: [PATCH 3/7] packer: Simplify goss, add containerd tests Signed-off-by: Naadir Jeewa Signed-off-by: Naadir Jeewa --- build/amis/packer/goss/goss.yaml | 15 +++++++++------ build/amis/packer/goss/redhat-vars.yaml | 4 +--- build/amis/packer/goss/ubuntu-vars.yaml | 4 +--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/build/amis/packer/goss/goss.yaml b/build/amis/packer/goss/goss.yaml index 0928a07b7c..f434fc6cbd 100644 --- a/build/amis/packer/goss/goss.yaml +++ b/build/amis/packer/goss/goss.yaml @@ -1,9 +1,12 @@ package: -{{range $name, $vers := index .Vars "packages"}} - {{$name}}: + cloud-init: installed: true versions: - {{range $vers}} - - {{.}} - {{end}} -{{end}} \ No newline at end of file + - "{{ .Vars.cloud_init_version }}" +service: + containerd: + enabled: true + running: true +command: + crictl ps: + exit-status: 0 diff --git a/build/amis/packer/goss/redhat-vars.yaml b/build/amis/packer/goss/redhat-vars.yaml index 4496239eff..932732f632 100644 --- a/build/amis/packer/goss/redhat-vars.yaml +++ b/build/amis/packer/goss/redhat-vars.yaml @@ -1,3 +1 @@ -packages: - cloud-init: - - "18.3+52.gc5f78957" \ No newline at end of file +cloud_init_version: "18.3+52.gc5f78957" diff --git a/build/amis/packer/goss/ubuntu-vars.yaml b/build/amis/packer/goss/ubuntu-vars.yaml index cf3416869b..ca4efa67b2 100644 --- a/build/amis/packer/goss/ubuntu-vars.yaml +++ b/build/amis/packer/goss/ubuntu-vars.yaml @@ -1,3 +1 @@ -packages: - cloud-init: - - "18.3-52-gc5f78957-1~bddeb~18.04.1" \ No newline at end of file +cloud_init_version: "18.3-52-gc5f78957-1~bddeb~18.04.1" From 97b0fbd7069a297e30d9039998b8acf638833a90 Mon Sep 17 00:00:00 2001 From: Naadir Jeewa Date: Thu, 14 Feb 2019 12:31:18 +0000 Subject: [PATCH 4/7] Packer: Update sample base AMIs Signed-off-by: Naadir Jeewa Signed-off-by: Naadir Jeewa --- build/amis/packer/base-images-us-east-1.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/amis/packer/base-images-us-east-1.json b/build/amis/packer/base-images-us-east-1.json index 08bd71c370..5d18028772 100644 --- a/build/amis/packer/base-images-us-east-1.json +++ b/build/amis/packer/base-images-us-east-1.json @@ -1,5 +1,5 @@ { - "ubuntu_18_04_ami": "ami-0ac019f4fcb7cb7e6", - "centos_7_ami": "ami-77ec9308", - "amazon_2_ami": "ami-04681a1dbd79675a5" -} \ No newline at end of file + "ubuntu_18_04_ami": "ami-0ac019f4fcb7cb7e6", + "centos_7_ami": "ami-77ec9308", + "amazon_2_ami": "ami-009d6802948d06e52" +} From 80953234075d03721a82237d43a3cc1c02d686aa Mon Sep 17 00:00:00 2001 From: Naadir Jeewa Date: Thu, 14 Feb 2019 12:31:18 +0000 Subject: [PATCH 5/7] ansible: Enable pipelining Signed-off-by: Naadir Jeewa Signed-off-by: Naadir Jeewa --- build/amis/ansible/ansible.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/amis/ansible/ansible.cfg b/build/amis/ansible/ansible.cfg index 38fac81143..c0307c03ef 100644 --- a/build/amis/ansible/ansible.cfg +++ b/build/amis/ansible/ansible.cfg @@ -16,3 +16,6 @@ remote_tmp = /tmp/.ansible/ filter_plugins = ./filter_plugins retry_files_enabled = False + +[ssh_connection] +pipelining = True From b743194a08b90b5fe78fd5d9c01765794535ad16 Mon Sep 17 00:00:00 2001 From: Naadir Jeewa Date: Thu, 14 Feb 2019 12:31:18 +0000 Subject: [PATCH 6/7] packer: Run goss with sudo Signed-off-by: Naadir Jeewa Signed-off-by: Naadir Jeewa --- build/amis/packer/packer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/amis/packer/packer.json b/build/amis/packer/packer.json index 53d3884143..4a8459e2c1 100644 --- a/build/amis/packer/packer.json +++ b/build/amis/packer/packer.json @@ -102,6 +102,7 @@ { "type": "goss", "vars_file": "goss/redhat-vars.yaml", + "use_sudo": true, "tests": [ "goss/goss.yaml" ], @@ -113,6 +114,7 @@ { "type": "goss", "vars_file": "goss/ubuntu-vars.yaml", + "use_sudo": true, "tests": [ "goss/goss.yaml" ], From 6e9348d884c946620885acf22e6c8735626d2bc1 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Thu, 14 Feb 2019 16:39:49 -0500 Subject: [PATCH 7/7] temp --- build/amis/packer/Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build/amis/packer/Makefile b/build/amis/packer/Makefile index bce6d05933..ea7f1db329 100644 --- a/build/amis/packer/Makefile +++ b/build/amis/packer/Makefile @@ -1,3 +1,20 @@ +# Copyright 2019 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# If you update this file, please follow +# https://suva.sh/posts/well-documented-makefiles + HOSTOS := $(shell go env GOHOSTOS) HOSTARCH := $(shell go env GOARCH) BINARYPATHPATTERN :=${HOSTOS}-${HOSTARCH}