Skip to content

Commit

Permalink
Merge pull request #26446 from mbruzek/juju-master-worker
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Implementing a proper master/worker split in the juju cluster code.

```
release-note-none
```

General updates to the cluster/juju Kubernetes provider, to bring it up to date.

Updating the skydns templates to version 11
Updating the etcd container definition to include arch.
Updating the master template to include arch and version for hyperkube container.
Adding dns_domain configuration options.
Adding storage layer options.

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
  • Loading branch information
k8s-merge-robot authored Jul 6, 2016
2 parents 5e7c309 + b45002b commit 203e1e9
Show file tree
Hide file tree
Showing 10 changed files with 546 additions and 284 deletions.
39 changes: 36 additions & 3 deletions cluster/juju/layers/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,45 @@ juju add-relation kubernetes etcd
For your convenience this charm supports some configuration options to set up
a Kuberentes cluster that works in your environment:

**version**: Set the version of the Kubernetes containers to deploy.
The default value is "v1.0.6". Changing the version causes the all the
Kubernetes containers to be restarted.
**version**: Set the version of the Kubernetes containers to deploy. The
version string must be in the following format "v#.#.#" where the numbers
match with the
[kubernetes release labels](https://github.com/kubernetes/kubernetes/releases)
of the [kubernetes github project](https://github.com/kubernetes/kubernetes).
Changing the version causes the all the Kubernetes containers to be restarted.

**cidr**: Set the IP range for the Kubernetes cluster. eg: 10.1.0.0/16

# Storage
The kubernetes charm is built to handle multiple storage devices if the cloud
provider works with
[Juju storage](https://jujucharms.com/docs/devel/charms-storage).

The 16.04 (xenial) release introduced [ZFS](https://en.wikipedia.org/wiki/ZFS)
to Ubuntu. The xenial charm can use ZFS witha raidz pool. A raidz pool
distributes parity along with the data (similar to a raid5 pool) and can suffer
the loss of one drive while still retaining data. The raidz pool requires a
minimum of 3 disks, but will accept more if they are provided.

You can add storage to the kubernetes charm in increments of 3 or greater:

```
juju add-storage kubernetes/0 disk-pool=ebs,3,1G
```

**Note**: Due to a limitation of raidz you can not add individual disks to an
existing pool. Should you need to expand the storage of the raidz pool, the
additional add-storage commands must be the same number of disks as the original
command. At this point the charm will have two raidz pools added together, both
of which could handle the loss of one disk each.

The storage code handles the addition of devices to the charm and when it
recieves three disks creates a raidz pool that is mounted at the /srv/kubernetes
directory by default. If you need the storage in another location you must
change the `mount-point` value in layer.yaml before the charms is deployed.

To avoid data loss you must attach the storage before making the connection to
the etcd cluster.

## State Events
While this charm is meant to be a top layer, it can be used to build other
Expand Down
19 changes: 13 additions & 6 deletions cluster/juju/layers/kubernetes/config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
options:
version:
type: string
default: "v1.1.7"
default: "v1.2.3"
description: |
The version of Kubernetes to use in this charm. The version is
inserted in the configuration files that specify the hyperkube
container to use when starting a Kubernetes cluster. Changing this
value will restart the Kubernetes cluster.
The version of Kubernetes to use in this charm. The version is inserted
in the configuration files that specify the hyperkube container to use
when starting a Kubernetes cluster. Changing this value will restart the
Kubernetes cluster.
cidr:
type: string
default: 10.1.0.0/16
description: |
Network CIDR to assign to K8s service groups
Network CIDR to assign to Kubernetes service groups. This must not
overlap with any IP ranges assigned to nodes for pods.
dns_domain:
type: string
default: cluster.local
description: |
The domain name to use for the Kubernetes cluster by the
skydns service.
7 changes: 6 additions & 1 deletion cluster/juju/layers/kubernetes/layer.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
includes: ['layer:docker', 'layer:flannel', 'layer:tls', 'interface:etcd']
includes: ['layer:leadership', 'layer:docker', 'layer:flannel', 'layer:storage', 'layer:tls', 'interface:etcd']
repo: https://github.com/mbruzek/layer-k8s.git
options:
storage:
storage-driver: zfs
mount-point: '/srv/kubernetes'
2 changes: 2 additions & 0 deletions cluster/juju/layers/kubernetes/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ subordinate: false
requires:
etcd:
interface: etcd
series:
- 'trusty'
Loading

0 comments on commit 203e1e9

Please sign in to comment.