Skip to content

Instantly share code, notes, and snippets.

@jasonbrooks
Last active November 3, 2017 14:44
Show Gist options
  • Save jasonbrooks/779ebd2721ec90cc6f0a497068a6d297 to your computer and use it in GitHub Desktop.
Save jasonbrooks/779ebd2721ec90cc6f0a497068a6d297 to your computer and use it in GitHub Desktop.

How to Migrate to Fedora 27 Atomic Kubernetes in System Containers

Starting with version 27 of Fedora Atomic Host, the rpms for Kubernetes, Flannel and Etcd are no longer "baked into" the image, but are available instead as system containers.

System containers can serve as drop-in replacements for components that had been included in the Fedora Atomic image. Once installed, these components will be manageable using the same systemctl commands that apply to regular rpm-installed components.

To replace Kubernetes, Flannel and Etcd with system containers, you would run the following commands.

System containers for master nodes

# atomic install --system --system-package=no --name kube-apiserver registry.fedoraproject.org/f27/kubernetes-apiserver

# atomic install --system --system-package=no --name kube-controller-manager registry.fedoraproject.org/f27/kubernetes-controller-manager

# atomic install --system --system-package=no --name kube-scheduler registry.fedoraproject.org/f27/kubernetes-scheduler

Note: the kube-apiserver system container provides the kubectl client.

System containers for worker nodes

# atomic install --system --system-package=no --name kubelet registry.fedoraproject.org/f27/kubernetes-kubelet

# atomic install --system --system-package=no --name kube-proxy registry.fedoraproject.org/f27/kubernetes-proxy

System container for etcd

# atomic install --system --system-package=no --name etcd registry.fedoraproject.org/f27/etcd

When installed with the name "etcd," the etcd system container expects to find stores etcd data in /var/lib/etcd/etcd.etcd. The etcd rpm is configured by default to store data in /var/lib/etcd/default.etcd, and the ansible scripts in kubernetes/contrib use /var/lib/etcd. On a system running etcd as configured by the kubernetes/contrib ansible scripts, you'd move your data as follows:

# systemctl stop etcd

# cp -r /var/lib/etcd/member /var/lib/etcd/etcd.etcd/

Note: the etcd container provides the etcdctl client.

System container for flannel

# atomic install --system --system-package=no --name flanneld registry.fedoraproject.org/f27/flannel

Updating system containers

TK

An alternative to system containers

An altenative to system containers is package layering, which allows you to layer rpms onto your ostree installation. You could install all of the kubernetes, etcd and flannel packages using the command:

# rpm-ostree install kubernetes flannel etcd -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment