Skip to content

Commit 4cf5ec7

Browse files
HappyTetrahedrongithub-actions[bot]
andauthored
Update install instructions from guided-setup (#486)
Co-authored-by: github-actions[bot] <username@users.noreply.github.com>
1 parent f101a0a commit 4cf5ec7

5 files changed

Lines changed: 23 additions & 352 deletions

File tree

docs/modules/ROOT/partials/guided-setup/cloudscale-decommission.adoc

Lines changed: 5 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
* &nbsp;&nbsp;<<step-25,And I delete the cluster's OpsGenie heartbeat>>
2828
* &nbsp;&nbsp;<<step-26,And I delete the cluster from Lieutenant>>
2929
* &nbsp;&nbsp;<<step-27,And I delete the Keycloak service>>
30-
* &nbsp;&nbsp;<<step-28,And I remove the cluster from openshift4-clusters>>
3130
3231
[[step-1]]
3332
=== Given I have all prerequisites installed
@@ -70,7 +69,7 @@ if which aws >/dev/null 2>&1 ; then { echo "✅ aws (AWS CLI) is installed."; }
7069
7170
if which restic >/dev/null 2>&1 ; then { echo "✅ restic (Backup CLI) is installed."; } ; else { echo "❌ restic (Backup CLI) is not installed. Please install restic to proceed."; exit 1; } ; fi
7271
73-
if which emergency-credentials-receive >/dev/null 2>&1 ; then { echo "✅ emergency-credentials-receive (Cluster emergency access helper) is installed."; } ; else { echo "❌ emergency-credentials-receive is not installed. Please install it from https://github.com/vshn/emergency-credentials-receive ."; exit 1; } ; fi
72+
if which kharon >/dev/null 2>&1 ; then { echo "✅ kharon (Cluster access helper) is installed."; } ; else { echo "❌ kharon is not installed. Please install it from https://github.com/vshn/kharon ."; exit 1; } ; fi
7473
7574
if which commodore >/dev/null 2>&1 ; then { echo "✅ commodore (Project Syn) is installed."; } ; else { echo "❌ commodore (Project Syn) is not installed. Please install it with 'uv tool install syn-commodore && commodore tool install --missing' ."; exit 1; } ; fi
7675
@@ -314,11 +313,6 @@ This step ensures the emergency credentials for the cluster have been retrieved
314313

315314
==== Inputs
316315

317-
* `cluster_domain`: Domain of the cluster - the part after `api` or `apps`, respectively.
318-
319-
Usually of the form `<CLUSTER_ID>.<BASE_DOMAIN>`
320-
321-
322316
* `passbolt_passphrase`: Your password for Passbolt.
323317

324318
This is required to access the encrypted emergency credentials.
@@ -336,16 +330,15 @@ This is required to access the encrypted emergency credentials.
336330
----
337331
OUTPUT=$(mktemp)
338332
339-
# export INPUT_cluster_domain=
340333
# export INPUT_passbolt_passphrase=
341334
# export INPUT_commodore_cluster_id=
342335
343336
set -euo pipefail
344-
export EMR_KUBERNETES_ENDPOINT=https://api.${INPUT_cluster_domain}:6443
345-
export EMR_PASSPHRASE="${INPUT_passbolt_passphrase}"
346-
emergency-credentials-receive "${INPUT_commodore_cluster_id}"
347-
337+
export KHARON_PASSBOLT_PASSPHRASE="${INPUT_passbolt_passphrase}"
348338
export KUBECONFIG="em-${INPUT_commodore_cluster_id}"
339+
kharon update
340+
kharon emergency-credentials "${INPUT_commodore_cluster_id}"
341+
349342
kubectl get nodes
350343
351344
env -i "kubeconfig_path=$(pwd)/em-${INPUT_commodore_cluster_id}" >> "$OUTPUT"
@@ -1484,56 +1477,3 @@ sleep 2
14841477
14851478
----
14861479

1487-
[[step-28]]
1488-
=== And I remove the cluster from openshift4-clusters
1489-
1490-
This step removes the cluster from https://git.vshn.net/vshn/openshift4-clusters
1491-
1492-
==== Inputs
1493-
1494-
* `commodore_cluster_id`
1495-
* `gitlab_api_token`
1496-
1497-
==== Script
1498-
1499-
[source,bash]
1500-
----
1501-
OUTPUT=$(mktemp)
1502-
1503-
# export INPUT_commodore_cluster_id=
1504-
# export INPUT_gitlab_api_token=
1505-
1506-
set -euo pipefail
1507-
if [ -e openshift4-clusters ]
1508-
then
1509-
rm -rf openshift4-clusters
1510-
fi
1511-
git clone git@git.vshn.net:vshn/openshift4-clusters.git
1512-
pushd openshift4-clusters
1513-
1514-
git rm -rf "${INPUT_commodore_cluster_id}" || true
1515-
1516-
if git diff-index --quiet HEAD
1517-
then
1518-
echo "No changes, skipping commit"
1519-
else
1520-
git checkout -b "remove-${INPUT_commodore_cluster_id}"
1521-
git commit -m"Remove ${INPUT_commodore_cluster_id}"
1522-
git push origin "remove-${INPUT_commodore_cluster_id}"
1523-
1524-
auth="PRIVATE-TOKEN: ${INPUT_gitlab_api_token}"
1525-
1526-
response=$( curl -s -XPOST -H"$auth" -H"Content-Type: application/json" https://git.vshn.net/api/v4/projects/57660/merge_requests -d'{"source_branch":"'remove-${INPUT_commodore_cluster_id}'","target_branch":"main","title":"Remove cluster '${INPUT_commodore_cluster_id}'"}' )
1527-
echo
1528-
echo ">>> Please review and merge the MR at $( echo "$response" | jq -r .web_url )"
1529-
echo
1530-
fi || true
1531-
popd
1532-
1533-
1534-
# echo "# Outputs"
1535-
# cat "$OUTPUT"
1536-
# rm -f "$OUTPUT"
1537-
1538-
----
1539-

docs/modules/ROOT/partials/guided-setup/cloudscale.adoc

Lines changed: 6 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
* &nbsp;&nbsp;<<step-33,And I schedule the first maintenance>>
3636
* <<step-34,Then I configure apt-dater groups for the LoadBalancers>>
3737
* &nbsp;&nbsp;<<step-35,And I remove the bootstrap bucket>>
38-
* &nbsp;&nbsp;<<step-36,And I add the cluster to openshift4-clusters>>
39-
* &nbsp;&nbsp;<<step-37,And I wait for maintenance to complete>>
38+
* &nbsp;&nbsp;<<step-36,And I wait for maintenance to complete>>
4039
4140
[[step-1]]
4241
=== Given I have all prerequisites installed
@@ -79,7 +78,7 @@ if which aws >/dev/null 2>&1 ; then { echo "✅ aws (AWS CLI) is installed."; }
7978
8079
if which restic >/dev/null 2>&1 ; then { echo "✅ restic (Backup CLI) is installed."; } ; else { echo "❌ restic (Backup CLI) is not installed. Please install restic to proceed."; exit 1; } ; fi
8180
82-
if which emergency-credentials-receive >/dev/null 2>&1 ; then { echo "✅ emergency-credentials-receive (Cluster emergency access helper) is installed."; } ; else { echo "❌ emergency-credentials-receive is not installed. Please install it from https://github.com/vshn/emergency-credentials-receive ."; exit 1; } ; fi
81+
if which kharon >/dev/null 2>&1 ; then { echo "✅ kharon (Cluster access helper) is installed."; } ; else { echo "❌ kharon is not installed. Please install it from https://github.com/vshn/kharon ."; exit 1; } ; fi
8382
8483
if which commodore >/dev/null 2>&1 ; then { echo "✅ commodore (Project Syn) is installed."; } ; else { echo "❌ commodore (Project Syn) is not installed. Please install it with 'uv tool install syn-commodore && commodore tool install --missing' ."; exit 1; } ; fi
8584
@@ -2256,7 +2255,6 @@ This step ensures the emergency credentials for the cluster can be retrieved.
22562255
==== Inputs
22572256

22582257
* `kubeconfig_path`
2259-
* `cluster_domain`
22602258
* `commodore_cluster_id`
22612259
* `passbolt_passphrase`: Your password for Passbolt.
22622260

@@ -2275,7 +2273,6 @@ This is required to access the encrypted emergency credentials.
22752273
OUTPUT=$(mktemp)
22762274
22772275
# export INPUT_kubeconfig_path=
2278-
# export INPUT_cluster_domain=
22792276
# export INPUT_commodore_cluster_id=
22802277
# export INPUT_passbolt_passphrase=
22812278
@@ -2293,12 +2290,12 @@ do
22932290
echo -n .
22942291
done
22952292
2296-
export EMR_KUBERNETES_ENDPOINT=https://api.${INPUT_cluster_domain}:6443
2297-
export EMR_PASSPHRASE="${INPUT_passbolt_passphrase}"
2298-
emergency-credentials-receive "${INPUT_commodore_cluster_id}"
2293+
export KHARON_PASSBOLT_PASSPHRASE="${INPUT_passbolt_passphrase}"
2294+
export KUBECONFIG="em-${INPUT_commodore_cluster_id}"
2295+
kharon update
2296+
kharon emergency-credentials "${INPUT_commodore_cluster_id}"
22992297
23002298
yq -i e '.clusters[0].cluster.insecure-skip-tls-verify = true' "em-${INPUT_commodore_cluster_id}"
2301-
export KUBECONFIG="em-${INPUT_commodore_cluster_id}"
23022299
kubectl get nodes
23032300
oc whoami | grep system:serviceaccount:appuio-emergency-credentials-controller: || exit 1
23042301
@@ -2630,108 +2627,6 @@ mc rb "${INPUT_commodore_cluster_id}/${INPUT_commodore_cluster_id}-bootstrap-ign
26302627
----
26312628

26322629
[[step-36]]
2633-
=== And I add the cluster to openshift4-clusters
2634-
2635-
This step adds the cluster to https://git.vshn.net/vshn/openshift4-clusters
2636-
2637-
==== Inputs
2638-
2639-
* `commodore_cluster_id`
2640-
* `kubeconfig_path`
2641-
* `jumphost_fqdn`: FQDN of the jumphost used to connect to this cluster, if any.
2642-
2643-
If no jumphost is used, enter "NONE".
2644-
2645-
2646-
* `socks5_port`: SOCKS5 port number to use for this cluster, of the form 120XX.
2647-
If the cluster shares a proxy jumphost with another cluster, use the same port.
2648-
If the cluster uses a brand new jumphost, choose a new unique port.
2649-
2650-
If the cluster does not use a proxy jumphost, enter "NONE".
2651-
2652-
2653-
2654-
==== Script
2655-
2656-
[source,bash]
2657-
----
2658-
OUTPUT=$(mktemp)
2659-
2660-
# export INPUT_commodore_cluster_id=
2661-
# export INPUT_kubeconfig_path=
2662-
# export INPUT_jumphost_fqdn=
2663-
# export INPUT_socks5_port=
2664-
2665-
set -euo pipefail
2666-
if [ -e openshift4-clusters ]
2667-
then
2668-
rm -rf openshift4-clusters
2669-
fi
2670-
git clone git@git.vshn.net:vshn/openshift4-clusters.git
2671-
pushd openshift4-clusters
2672-
2673-
if [[ -d "${INPUT_commodore_cluster_id}" ]]
2674-
then
2675-
echo "Cluster entry already exists - not touching that!"
2676-
exit 0
2677-
else
2678-
API_URL=$(yq e '.clusters[0].cluster.server' "${INPUT_kubeconfig_path}")
2679-
2680-
mkdir -p "${INPUT_commodore_cluster_id}"
2681-
pushd "${INPUT_commodore_cluster_id}"
2682-
ln -s ../base_envrc .envrc
2683-
cat >.connection_facts <<EOF
2684-
API=${API_URL}
2685-
EOF
2686-
popd
2687-
2688-
port="$( echo "${INPUT_socks5_port}" | tr '[:upper:]' '[:lower:]' )"
2689-
jumphost="$( echo "${INPUT_jumphost_fqdn}" | tr '[:upper:]' '[:lower:]' )"
2690-
2691-
if [[ "$port" != "none" ]] && [[ "$jumphost" != "none" ]]
2692-
then
2693-
cat >> "${INPUT_commodore_cluster_id}/.connection_facts" <<EOF
2694-
JUMPHOST=${INPUT_jumphost_fqdn}
2695-
SOCKS5_PORT=${INPUT_socks5_port}
2696-
EOF
2697-
python foxyproxy_generate.py
2698-
fi
2699-
2700-
git add --force "${INPUT_commodore_cluster_id}"
2701-
git add .
2702-
2703-
if git diff-index --quiet HEAD
2704-
then
2705-
echo "No changes, skipping commit"
2706-
else
2707-
git commit -am "Add cluster ${INPUT_commodore_cluster_id}"
2708-
fi || true
2709-
fi
2710-
popd
2711-
2712-
echo
2713-
echo '#########################################################'
2714-
echo '# #'
2715-
echo '# Please test the cluster connection, and if it works #'
2716-
echo '# as expected, push the commit to the repository. #'
2717-
echo '# #'
2718-
echo '#########################################################'
2719-
echo
2720-
echo "Run the following:"
2721-
echo "cd $(pwd)/openshift4-clusters/${INPUT_commodore_cluster_id}"
2722-
echo "direnv allow ."
2723-
echo "direnv exec . oc whoami"
2724-
echo "git push origin main # only if everything is OK"
2725-
sleep 2
2726-
2727-
2728-
# echo "# Outputs"
2729-
# cat "$OUTPUT"
2730-
# rm -f "$OUTPUT"
2731-
2732-
----
2733-
2734-
[[step-37]]
27352630
=== And I wait for maintenance to complete
27362631

27372632
This step waits for the first maintenance to complete, and then removes the

docs/modules/ROOT/partials/guided-setup/exoscale-decommission.adoc

Lines changed: 5 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
* &nbsp;&nbsp;<<step-21,And I delete the cluster's OpsGenie heartbeat>>
2424
* &nbsp;&nbsp;<<step-22,And I delete the cluster from Lieutenant>>
2525
* &nbsp;&nbsp;<<step-23,And I delete the Keycloak service>>
26-
* &nbsp;&nbsp;<<step-24,And I remove the cluster from openshift4-clusters>>
2726
2827
[[step-1]]
2928
=== Given I have all prerequisites installed
@@ -76,7 +75,7 @@ if which virt-edit >/dev/null 2>&1 ; then { echo "✅ virt-edit (VM image editin
7675
7776
if which cpio >/dev/null 2>&1 ; then { echo "✅ cpio (file archiving) is installed."; } ; else { echo "❌ cpio (file archiving) is not installed. Please install cpio to proceed."; exit 1; } ; fi
7877
79-
if which emergency-credentials-receive >/dev/null 2>&1 ; then { echo "✅ emergency-credentials-receive (Cluster emergency access helper) is installed."; } ; else { echo "❌ emergency-credentials-receive is not installed. Please install it from https://github.com/vshn/emergency-credentials-receive ."; exit 1; } ; fi
78+
if which kharon >/dev/null 2>&1 ; then { echo "✅ kharon (Cluster access helper) is installed."; } ; else { echo "❌ kharon is not installed. Please install it from https://github.com/vshn/kharon ."; exit 1; } ; fi
8079
8180
echo "✅ All prerequisites are met."
8281
@@ -319,11 +318,6 @@ This step ensures the emergency credentials for the cluster have been retrieved
319318

320319
==== Inputs
321320

322-
* `cluster_domain`: Domain of the cluster - the part after `api` or `apps`, respectively.
323-
324-
Usually of the form `<CLUSTER_ID>.<BASE_DOMAIN>`
325-
326-
327321
* `passbolt_passphrase`: Your password for Passbolt.
328322

329323
This is required to access the encrypted emergency credentials.
@@ -341,16 +335,15 @@ This is required to access the encrypted emergency credentials.
341335
----
342336
OUTPUT=$(mktemp)
343337
344-
# export INPUT_cluster_domain=
345338
# export INPUT_passbolt_passphrase=
346339
# export INPUT_commodore_cluster_id=
347340
348341
set -euo pipefail
349-
export EMR_KUBERNETES_ENDPOINT=https://api.${INPUT_cluster_domain}:6443
350-
export EMR_PASSPHRASE="${INPUT_passbolt_passphrase}"
351-
emergency-credentials-receive "${INPUT_commodore_cluster_id}"
352-
342+
export KHARON_PASSBOLT_PASSPHRASE="${INPUT_passbolt_passphrase}"
353343
export KUBECONFIG="em-${INPUT_commodore_cluster_id}"
344+
kharon update
345+
kharon emergency-credentials "${INPUT_commodore_cluster_id}"
346+
354347
kubectl get nodes
355348
356349
env -i "kubeconfig_path=$(pwd)/em-${INPUT_commodore_cluster_id}" >> "$OUTPUT"
@@ -1329,56 +1322,3 @@ sleep 2
13291322
13301323
----
13311324

1332-
[[step-24]]
1333-
=== And I remove the cluster from openshift4-clusters
1334-
1335-
This step removes the cluster from https://git.vshn.net/vshn/openshift4-clusters
1336-
1337-
==== Inputs
1338-
1339-
* `commodore_cluster_id`
1340-
* `gitlab_api_token`
1341-
1342-
==== Script
1343-
1344-
[source,bash]
1345-
----
1346-
OUTPUT=$(mktemp)
1347-
1348-
# export INPUT_commodore_cluster_id=
1349-
# export INPUT_gitlab_api_token=
1350-
1351-
set -euo pipefail
1352-
if [ -e openshift4-clusters ]
1353-
then
1354-
rm -rf openshift4-clusters
1355-
fi
1356-
git clone git@git.vshn.net:vshn/openshift4-clusters.git
1357-
pushd openshift4-clusters
1358-
1359-
git rm -rf "${INPUT_commodore_cluster_id}" || true
1360-
1361-
if git diff-index --quiet HEAD
1362-
then
1363-
echo "No changes, skipping commit"
1364-
else
1365-
git checkout -b "remove-${INPUT_commodore_cluster_id}"
1366-
git commit -m"Remove ${INPUT_commodore_cluster_id}"
1367-
git push origin "remove-${INPUT_commodore_cluster_id}"
1368-
1369-
auth="PRIVATE-TOKEN: ${INPUT_gitlab_api_token}"
1370-
1371-
response=$( curl -s -XPOST -H"$auth" -H"Content-Type: application/json" https://git.vshn.net/api/v4/projects/57660/merge_requests -d'{"source_branch":"'remove-${INPUT_commodore_cluster_id}'","target_branch":"main","title":"Remove cluster '${INPUT_commodore_cluster_id}'"}' )
1372-
echo
1373-
echo ">>> Please review and merge the MR at $( echo "$response" | jq -r .web_url )"
1374-
echo
1375-
fi || true
1376-
popd
1377-
1378-
1379-
# echo "# Outputs"
1380-
# cat "$OUTPUT"
1381-
# rm -f "$OUTPUT"
1382-
1383-
----
1384-

0 commit comments

Comments
 (0)