examples: Update Kubernetes from v1.7.3 to v1.7.5

* Switch Terraform example to use Typhoon project's module
instead: https://github.com/poseidon/typhoon
* Includes support for Calico and Flannel
This commit is contained in:
Dalton Hubble
2017-09-12 15:04:32 -07:00
parent 4228ccb330
commit d7783a94e9
12 changed files with 50 additions and 39 deletions

View File

@@ -10,7 +10,7 @@ Notable changes between releases.
### Examples / Modules
* Upgrade Kubernetes v1.7.3 example clusters
* Upgrade Kubernetes v1.7.5 example clusters
* Kubernetes examples clusters enable etcd TLS
* Deploy the Container Linux Update Operator (CLUO) to coordinate reboots of Container Linux nodes in Kubernetes clusters. See the cluster [addon docs](Documentation/cluster-addons.md).
* Kubernetes examples (terraform and non-terraform) mask locksmithd

View File

@@ -1,6 +1,6 @@
# Kubernetes
The Kubernetes example provisions a 3 node "self-hosted" Kubernetes v1.7.3 cluster. [bootkube](https://github.com/kubernetes-incubator/bootkube) is run once on a controller node to bootstrap Kubernetes control plane components as pods before exiting. An etcd3 cluster across controllers is used to back Kubernetes.
The Kubernetes example provisions a 3 node Kubernetes v1.7.5 cluster. [bootkube](https://github.com/kubernetes-incubator/bootkube) is run once on a controller node to bootstrap Kubernetes control plane components as pods before exiting. An etcd3 cluster across controllers is used to back Kubernetes.
## Requirements
@@ -11,11 +11,11 @@ Ensure that you've gone through the [matchbox with rkt](getting-started-rkt.md)
* Create the example libvirt client VMs
* `/etc/hosts` entries for `node[1-3].example.com`
Install [bootkube](https://github.com/kubernetes-incubator/bootkube/releases) v0.6.1 and add it on your $PATH.
Install [bootkube](https://github.com/kubernetes-incubator/bootkube/releases) v0.6.2 and add it on your $PATH.
```sh
$ bootkube version
Version: v0.6.1
Version: v0.6.2
```
## Examples
@@ -106,9 +106,9 @@ $ ssh core@node1.example.com 'journalctl -f -u bootkube'
$ export KUBECONFIG=assets/auth/kubeconfig
$ kubectl get nodes
NAME STATUS AGE VERSION
node1.example.com Ready 11m v1.7.3+coreos.0
node2.example.com Ready 11m v1.7.3+coreos.0
node3.example.com Ready 11m v1.7.3+coreos.0
node1.example.com Ready 11m v1.7.5+coreos.0
node2.example.com Ready 11m v1.7.5+coreos.0
node3.example.com Ready 11m v1.7.5+coreos.0
$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE

View File

@@ -30,10 +30,10 @@
* [matchbox with Docker](Documentation/getting-started-docker.md)
* Clusters
* [etcd3](Documentation/getting-started-rkt.md) - Install a 3-node etcd3 cluster
* [Kubernetes](Documentation/bootkube.md) - Install a 3-node self-hosted Kubernetes v1.7.3 cluster
* [Kubernetes](Documentation/bootkube.md) - Install a 3-node Kubernetes v1.7.5 cluster
* Clusters (Terraform-based)
* [etcd3](examples/terraform/etcd3-install/README.md) - Install a 3-node etcd3 cluster
* [Kubernetes](examples/terraform/bootkube-install/README.md) - Install a 3-node self-hosted Kubernetes v1.7.3 cluster
* [Kubernetes](examples/terraform/bootkube-install/README.md) - Install a 3-node Kubernetes v1.7.5 cluster
### Projects

View File

@@ -10,7 +10,7 @@ These examples use [Terraform](https://www.terraform.io/intro/) as a client to M
|-------------------------------|-------------------------------|
| [simple-install](terraform/simple-install) | Install Container Linux with an SSH key |
| [etcd3-install](terraform/etcd3-install) | Install a 3-node etcd3 cluster |
| [bootkube-install](terraform/bootkube-install) | Install a 3-node self-hosted Kubernetes v1.7.3 cluster |
| [bootkube-install](terraform/bootkube-install) | Install a 3-node Kubernetes v1.7.5 cluster |
### Customization
@@ -25,10 +25,10 @@ These examples mount raw Matchbox objects into a Matchbox server's `/var/lib/mat
| simple | CoreOS Container Linux with autologin, using iPXE | stable/1409.7.0 | RAM | [reference](https://coreos.com/os/docs/latest/booting-with-ipxe.html) |
| simple-install | CoreOS Container Linux Install, using iPXE | stable/1409.7.0 | RAM | [reference](https://coreos.com/os/docs/latest/booting-with-ipxe.html) |
| grub | CoreOS Container Linux via GRUB2 Netboot | stable/1409.7.0 | RAM | NA |
| etcd3 | PXE boot a 3 node etcd3 cluster with proxies | stable/1409.7.0 | RAM | None |
| etcd3-install | Install a 3 node etcd3 cluster to disk | stable/1409.7.0 | Disk | None |
| bootkube | PXE boot a self-hosted Kubernetes v1.7.3 cluster | stable/1409.7.0 | Disk | [tutorial](../Documentation/bootkube.md) |
| bootkube-install | Install a self-hosted Kubernetes v1.7.3 cluster | stable/1409.7.0 | Disk | [tutorial](../Documentation/bootkube.md) |
| etcd3 | PXE boot a 3-node etcd3 cluster with proxies | stable/1409.7.0 | RAM | None |
| etcd3-install | Install a 3-node etcd3 cluster to disk | stable/1409.7.0 | Disk | None |
| bootkube | PXE boot a 3-node Kubernetes v1.7.5 cluster | stable/1409.7.0 | Disk | [tutorial](../Documentation/bootkube.md) |
| bootkube-install | Install a 3-node Kubernetes v1.7.5 cluster | stable/1409.7.0 | Disk | [tutorial](../Documentation/bootkube.md) |
### Customization

View File

@@ -123,7 +123,7 @@ storage:
contents:
inline: |
KUBELET_IMAGE_URL=quay.io/coreos/hyperkube
KUBELET_IMAGE_TAG=v1.7.3_coreos.0
KUBELET_IMAGE_TAG=v1.7.5_coreos.0
- path: /etc/ssl/etcd/.empty
filesystem: root
mode: 0644
@@ -154,7 +154,7 @@ storage:
# Wrapper for bootkube start
set -e
BOOTKUBE_ACI="${BOOTKUBE_ACI:-quay.io/coreos/bootkube}"
BOOTKUBE_VERSION="${BOOTKUBE_VERSION:-v0.6.1}"
BOOTKUBE_VERSION="${BOOTKUBE_VERSION:-v0.6.2}"
BOOTKUBE_ASSETS="${BOOTKUBE_ASSETS:-/opt/bootkube/assets}"
exec /usr/bin/rkt run \
--trust-keys-from-https \

View File

@@ -92,7 +92,7 @@ storage:
contents:
inline: |
KUBELET_IMAGE_URL=quay.io/coreos/hyperkube
KUBELET_IMAGE_TAG=v1.7.3_coreos.0
KUBELET_IMAGE_TAG=v1.7.5_coreos.0
- path: /etc/ssl/etcd/.empty
filesystem: root
mode: 0644

View File

@@ -1,6 +1,6 @@
# Self-hosted Kubernetes
# Kubernetes
The self-hosted Kubernetes example shows how to use matchbox to network boot and provision a 3 node "self-hosted" Kubernetes v1.7.3 cluster. [bootkube](https://github.com/kubernetes-incubator/bootkube) is run once on a controller node to bootstrap Kubernetes control plane components as pods before exiting.
The Kubernetes example shows how to use Matchbox to network boot and provision a 3 node Kubernetes v1.7.5 cluster. This example uses [Terraform](https://www.terraform.io/intro/index.html) and a module provided by [Typhoon](https://github.com/poseidon/typhoon) to describe cluster resources. [kubernetes-incubator/bootkube](https://github.com/kubernetes-incubator/bootkube) is run once to bootstrap the Kubernetes control plane.
## Requirements
@@ -61,7 +61,7 @@ Note: The `cached-container-linux-install` profile will PXE boot and install Con
### Optional
You may set certain optional variables to override defaults. Set `experimental_self_hosted_etcd = "true"` to deploy "self-hosted" etcd atop Kubernetes instead of running etcd on hosts directly.
You may set certain optional variables to override defaults. Set `networking` to either "flannel" or "calico" to set the networking provider. [Check upstream](https://typhoon.psdn.io/bare-metal/) for the full list of options.
```hcl
# Optional (defaults)
@@ -69,16 +69,17 @@ You may set certain optional variables to override defaults. Set `experimental_s
# install_disk = "/dev/sda"
# container_linux_oem = ""
# experimental_self_hosted_etcd = "false"
# networking = "flannel"
```
The default is to create a Kubernetes cluster with 1 controller and 2 workers as an example, but check `multi-controller.tfvars.example` for an example which defines 3 controllers and 1 worker.
## Apply
Fetch the [bootkube](../README.md#modules) Terraform [module](https://www.terraform.io/docs/modules/index.html) for bare-metal, which is maintained in the in the matchbox repo.
Fetch the `source` Terraform [module](https://www.terraform.io/docs/modules/index.html).
```sh
$ terraform get
$ terraform get --update
```
Plan and apply to create the resources on Matchbox.
@@ -94,9 +95,9 @@ The module referenced in `cluster.tf` will also generate bootkube assets to `ass
```sh
$ terraform apply
module.cluster.null_resource.copy-kubeconfig.0: Still creating... (5m0s elapsed)
module.cluster.null_resource.copy-kubeconfig.1: Still creating... (5m0s elapsed)
module.cluster.null_resource.copy-kubeconfig.2: Still creating... (5m0s elapsed)
module.cluster.null_resource.copy-secrets.0: Still creating... (5m0s elapsed)
module.cluster.null_resource.copy-secrets.1: Still creating... (5m0s elapsed)
module.cluster.null_resource.copy-secrets.2: Still creating... (5m0s elapsed)
...
module.cluster.null_resource.bootkube-start: Still creating... (8m40s elapsed)
...
@@ -129,9 +130,9 @@ $ sudo ./scripts/libvirt [start|reboot|shutdown|poweroff|destroy]
$ export KUBECONFIG=assets/auth/kubeconfig
$ kubectl get nodes
NAME STATUS AGE VERSION
node1.example.com Ready 11m v1.7.3+coreos.0
node2.example.com Ready 11m v1.7.3+coreos.0
node3.example.com Ready 11m v1.7.3+coreos.0
node1.example.com Ready 11m v1.7.5+coreos.0
node2.example.com Ready 11m v1.7.5+coreos.0
node3.example.com Ready 11m v1.7.5+coreos.0
$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE

View File

@@ -1,15 +1,18 @@
// Self-hosted Kubernetes cluster
// Kubernetes cluster
module "cluster" {
source = "../modules/bootkube"
source = "git::https://github.com/poseidon/typhoon//bare-metal/container-linux/kubernetes?ref=0d6410505d8d65cef94a1a3f2f921327e88adfd2"
matchbox_http_endpoint = "${var.matchbox_http_endpoint}"
ssh_authorized_key = "${var.ssh_authorized_key}"
cluster_name = "${var.cluster_name}"
# install
matchbox_http_endpoint = "${var.matchbox_http_endpoint}"
container_linux_channel = "${var.container_linux_channel}"
container_linux_version = "${var.container_linux_version}"
ssh_authorized_key = "${var.ssh_authorized_key}"
# Machines
# cluster
cluster_name = "${var.cluster_name}"
k8s_domain_name = "${var.k8s_domain_name}"
# machines
controller_names = "${var.controller_names}"
controller_macs = "${var.controller_macs}"
controller_domains = "${var.controller_domains}"
@@ -18,10 +21,10 @@ module "cluster" {
worker_domains = "${var.worker_domains}"
# bootkube assets
k8s_domain_name = "${var.k8s_domain_name}"
asset_dir = "${var.asset_dir}"
asset_dir = "${var.asset_dir}"
# Optional
networking = "${var.networking}"
cached_install = "${var.cached_install}"
install_disk = "${var.install_disk}"
container_linux_oem = "${var.container_linux_oem}"

View File

@@ -23,3 +23,4 @@ cached_install = "true"
# install_disk = "/dev/sda"
# container_linux_oem = ""
# experimental_self_hosted_etcd = "false"
# networking = "flannel"

View File

@@ -62,6 +62,12 @@ variable "k8s_domain_name" {
type = "string"
}
variable "networking" {
description = "Choice of networking provider (flannel or calico)"
type = "string"
default = "flannel"
}
variable "asset_dir" {
description = "Path to a directory where generated assets should be placed (contains secrets)"
type = "string"

View File

@@ -4,7 +4,7 @@
set -eu
DEST=${1:-"bin"}
VERSION="v0.6.1"
VERSION="v0.6.2"
URL="https://github.com/kubernetes-incubator/bootkube/releases/download/${VERSION}/bootkube.tar.gz"

View File

@@ -4,7 +4,7 @@
set -eu
DEST=${1:-"bin"}
VERSION="v1.7.3"
VERSION="v1.7.5"
URL="https://storage.googleapis.com/kubernetes-release/release/${VERSION}/bin/linux/amd64/kubectl"