Skip to content

Commit

Permalink
docs: Add registry HA procedure
Browse files Browse the repository at this point in the history
Refs: #2002
  • Loading branch information
TeddyAndrieux committed May 28, 2021
1 parent e10ea20 commit 19b5e48
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/operation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ do not have a working MetalK8s_ setup.
solutions
changing_node_hostname
metalk8s-utils
registry_ha
listening_processes
troubleshooting/index
sosreport
78 changes: 78 additions & 0 deletions docs/operation/registry_ha.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
Registry HA
===========

MetalK8s come with his own registry used to serve all images used by MetalK8s
containers, so that it can run fully offline, this registry container sit on
the Bootstrap node.

Highly available registry allow to lose the Bootstrap node and still be able
to schedule pods on nodes that need to pull some container images. So it
means, lose of Bootstrap node should have no impact on the workload pods
running in the cluster.

.. note::

This procedure only talk about registry HA as Bootstrap HA is not
supported for the moment, so it's only a part of the Bootstrap
functionnaly. Check this ticket for more informations
https://github.com/scality/metalk8s/issues/2002

Prepare the node
----------------

In order to be able to schedule a repository pod on a node that will
be used as registry, you need this node to be part of the MetalK8s
cluster, no specific roles or taints is needed, this pods can be scheduled
on any node.

All ISOs listed in ``archives`` section of
``/etc/metalk8s/bootstrap.yaml`` and of ``/etc/metalk8s/solutions.yaml``
from the Bootstrap node must be on the exact same place on the node
that will be used as registry.

Deploy the registry
-------------------

Connect on the node where you want to deploy this registry and run the
following salt states

- Prepare all the MetalK8s ISOs

.. parsed-literal::
root@node-1 $ salt-call state.sls \\
metalk8s.archives.mounted \\
saltenv=metalk8s-|version|
- If you have some solutions, prepare solutions ISOs

.. parsed-literal::
root@node-1 $ salt-call state.sls \\
metalk8s.solutions.available \\
saltenv=metalk8s-|version|
- Deploy the registry container

.. parsed-literal::
root@node-1 $ salt-call state.sls \\
metalk8s.repo.installed \\
saltenv=metalk8s-|version|
Reconfigure all nodes
---------------------

In order to have registry HA we need to reconfigure all containerd to
use both registry as endpoint so that if one is down containerd
automatically pull from the other registry.

For this you need to run a state on all node using Salt Master

.. parsed-literal::
root@bootstrap $ kubectl exec -n kube-system -c salt-master \\
--kubeconfig=/etc/kubernetes/admin.conf \\
salt-master-bootstrap -- salt '*' state.sls \\
metalk8s.container-engine saltenv=metalk8s-|version|

0 comments on commit 19b5e48

Please sign in to comment.