From 217c0fd088c0ae2343d632b8d173be7e41943869 Mon Sep 17 00:00:00 2001
From: Vincent SELLIER <vincent.sellier@softwareheritage.org>
Date: Wed, 9 Aug 2023 10:52:15 +0200
Subject: [PATCH] sysadmin/support: Add an howto to connect to the kubernetes
 running rancher

Related to swh/infra/sysadm-environment#4998
---
 .pre-commit-config.yaml                       |  1 +
 docs/sysadm/support-services/index.rst        |  1 +
 .../support-services/rancher/howtos.rst       | 33 +++++++++++++++++++
 .../sysadm/support-services/rancher/index.rst | 10 ++++++
 4 files changed, 45 insertions(+)
 create mode 100644 docs/sysadm/support-services/rancher/howtos.rst
 create mode 100644 docs/sysadm/support-services/rancher/index.rst

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 33a226de..59cb0de5 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -17,6 +17,7 @@ repos:
     hooks:
       - id: codespell
         name: Check source code spelling
+        args: [-L aks]
         stages: [commit]
 
   - repo: local
diff --git a/docs/sysadm/support-services/index.rst b/docs/sysadm/support-services/index.rst
index 40741e28..c5c136eb 100644
--- a/docs/sysadm/support-services/index.rst
+++ b/docs/sysadm/support-services/index.rst
@@ -5,3 +5,4 @@ Support services
    :maxdepth: 2
 
    gitlab/index
+   rancher/index
diff --git a/docs/sysadm/support-services/rancher/howtos.rst b/docs/sysadm/support-services/rancher/howtos.rst
new file mode 100644
index 00000000..749f9181
--- /dev/null
+++ b/docs/sysadm/support-services/rancher/howtos.rst
@@ -0,0 +1,33 @@
+.. _rancher_howtos:
+
+.. admonition:: Intended audience
+   :class: important
+
+   sysadm staff members
+
+
+Rancher howtos
+==============
+
+How to connect to the underlying kubernetes
+-------------------------------------------
+
+- Add the following line in your `/etc/hosts`
+
+.. code::
+
+    192.168.200.18 euwest-rancher-3a905e13.1bef1012-0a93-4a25-8419-ac60363bf3d2.privatelink.westeurope.azmk8s.io
+
+
+- Get the cluster credentials
+
+.. code:: bash
+
+    az aks get-credentials --resource-group euwest-rancher --name euwest-rancher  -f rancher-admin.yaml
+
+
+- Test the connectivity
+
+.. code:: bash
+
+    kubectl --kubeconfig rancher-admin.yaml get nodes
diff --git a/docs/sysadm/support-services/rancher/index.rst b/docs/sysadm/support-services/rancher/index.rst
new file mode 100644
index 00000000..c7176df3
--- /dev/null
+++ b/docs/sysadm/support-services/rancher/index.rst
@@ -0,0 +1,10 @@
+.. _rancher:
+
+Rancher
+=======
+
+.. toctree::
+   :maxdepth: 1
+
+   howtos
+
-- 
GitLab