Skip to content

Commit

Permalink
Rev versions of containerd and Kubernetes (#576)
Browse files Browse the repository at this point in the history
* Rev versions of containerd and Kubernetes

* Fix incorrect packer-goss instructions

Signed-off-by: Naadir Jeewa <[email protected]>
Signed-off-by: Naadir Jeewa <[email protected]>

* packer: Simplify goss, add containerd tests

Signed-off-by: Naadir Jeewa <[email protected]>
Signed-off-by: Naadir Jeewa <[email protected]>

* Packer: Update sample base AMIs

Signed-off-by: Naadir Jeewa <[email protected]>
Signed-off-by: Naadir Jeewa <[email protected]>

* ansible: Enable pipelining

Signed-off-by: Naadir Jeewa <[email protected]>
Signed-off-by: Naadir Jeewa <[email protected]>

* packer: Run goss with sudo

Signed-off-by: Naadir Jeewa <[email protected]>
Signed-off-by: Naadir Jeewa <[email protected]>

* temp
  • Loading branch information
detiber authored and k8s-ci-robot committed Feb 14, 2019
1 parent e456e75 commit 699b324
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 63 deletions.
16 changes: 13 additions & 3 deletions build/amis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -21,8 +31,8 @@ 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.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:
Expand Down
3 changes: 3 additions & 0 deletions build/amis/ansible/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
remote_tmp = /tmp/.ansible/
filter_plugins = ./filter_plugins
retry_files_enabled = False

[ssh_connection]
pipelining = True
4 changes: 2 additions & 2 deletions build/amis/ansible/roles/containerd/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
39 changes: 39 additions & 0 deletions build/amis/packer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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}
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
8 changes: 4 additions & 4 deletions build/amis/packer/base-images-us-east-1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ubuntu_18_04_ami": "ami-0ac019f4fcb7cb7e6",
"centos_7_ami": "ami-77ec9308",
"amazon_2_ami": "ami-04681a1dbd79675a5"
}
"ubuntu_18_04_ami": "ami-0ac019f4fcb7cb7e6",
"centos_7_ami": "ami-77ec9308",
"amazon_2_ami": "ami-009d6802948d06e52"
}
15 changes: 9 additions & 6 deletions build/amis/packer/goss/goss.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package:
{{range $name, $vers := index .Vars "packages"}}
{{$name}}:
cloud-init:
installed: true
versions:
{{range $vers}}
- {{.}}
{{end}}
{{end}}
- "{{ .Vars.cloud_init_version }}"
service:
containerd:
enabled: true
running: true
command:
crictl ps:
exit-status: 0
4 changes: 1 addition & 3 deletions build/amis/packer/goss/redhat-vars.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
packages:
cloud-init:
- "18.3+52.gc5f78957"
cloud_init_version: "18.3+52.gc5f78957"
4 changes: 1 addition & 3 deletions build/amis/packer/goss/ubuntu-vars.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
packages:
cloud-init:
- "18.3-52-gc5f78957-1~bddeb~18.04.1"
cloud_init_version: "18.3-52-gc5f78957-1~bddeb~18.04.1"
4 changes: 3 additions & 1 deletion build/amis/packer/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -102,6 +102,7 @@
{
"type": "goss",
"vars_file": "goss/redhat-vars.yaml",
"use_sudo": true,
"tests": [
"goss/goss.yaml"
],
Expand All @@ -113,6 +114,7 @@
{
"type": "goss",
"vars_file": "goss/ubuntu-vars.yaml",
"use_sudo": true,
"tests": [
"goss/goss.yaml"
],
Expand Down
6 changes: 3 additions & 3 deletions cmd/clusterctl/examples/aws/machines.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,7 +28,7 @@ items:
set: node
spec:
versions:
kubelet: v1.13.2
kubelet: v1.13.3
providerSpec:
value:
apiVersion: awsprovider/v1alpha1
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/amis.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<!-- TOC -->

- [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)

<!-- TOC -->

## Kubernetes Version v1.13.2
## Kubernetes Version v1.13.3

### Amazon Linux 2

Expand Down
4 changes: 2 additions & 2 deletions docs/creating-multinode-controlplane-clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 0 additions & 33 deletions docs/packer.md

This file was deleted.

0 comments on commit 699b324

Please sign in to comment.