Skip to content

Commit

Permalink
Fixed long line listings and syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
fsundermeyer committed Feb 26, 2024
1 parent 3901f21 commit 917cb77
Show file tree
Hide file tree
Showing 22 changed files with 404 additions and 328 deletions.
12 changes: 6 additions & 6 deletions asciidoc/components/adoc/metallb.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ K3S comes with its own service load balancer named Klipper. You https://metallb.

MetalLB leverages Helm (and other methods as well), so:

[,console]
[,bash]
----
helm repo add metallb https://metallb.github.io/metallb
helm install --create-namespace -n metallb-system metallb metallb/metallb
Expand All @@ -50,7 +50,7 @@ done

At this point, the installation is completed. Now it is time to https://metallb.universe.tf/configuration/[configure] using our example values:

[,console]
[,yaml]
----
cat <<-EOF | kubectl apply -f -
apiVersion: metallb.io/v1beta1
Expand All @@ -66,7 +66,7 @@ spec:
EOF
----

[,console]
[,yaml]
----
cat <<-EOF | kubectl apply -f -
apiVersion: metallb.io/v1beta1
Expand Down Expand Up @@ -113,7 +113,7 @@ We will leverage this <<ingress-with-metallb,later>>.

Let's create an example deployment:

[,console]
[,yaml]
----
cat <<- EOF | kubectl apply -f -
---
Expand Down Expand Up @@ -188,7 +188,7 @@ EOF

And finally, the service:

[,console]
[,yaml]
----
cat <<- EOF | kubectl apply -f -
apiVersion: v1
Expand Down Expand Up @@ -265,7 +265,7 @@ curl http://192.168.122.11

As Traefik is already serving as an ingress controller, we can expose any http/https traffic via an `Ingress` object such as:

[,console]
[,yaml]
----
IP=$(kubectl get svc -n kube-system traefik -o jsonpath="{.status.loadBalancer.ingress[0].ip}")
cat <<- EOF | kubectl apply -f -
Expand Down
51 changes: 31 additions & 20 deletions asciidoc/demo_setup/adoc/elemental-utm-aarch64.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,19 @@ The trick here is there is no ARM64 image yet, but just a Raspberry Pi one... so

This is an optional step to enable the Elemental UI extension in Rancher (see https://ranchermanager.docs.rancher.com/integrations-in-rancher/rancher-extensions[more about Rancher extensions]):

[,console]
[,bash]
----
helm repo add rancher-charts https://charts.rancher.io/
helm upgrade --create-namespace -n cattle-ui-plugin-system --install ui-plugin-operator rancher-charts/ui-plugin-operator
helm upgrade --create-namespace -n cattle-ui-plugin-system --install ui-plugin-operator-crd rancher-charts/ui-plugin-operator-crd
helm upgrade --create-namespace -n cattle-ui-plugin-system \
--install ui-plugin-operator rancher-charts/ui-plugin-operator
helm upgrade --create-namespace -n cattle-ui-plugin-system \
--install ui-plugin-operator-crd rancher-charts/ui-plugin-operator-crd
# Wait for the operator to be up
while ! kubectl wait --for condition=ready -n cattle-ui-plugin-system $(kubectl get pods -n cattle-ui-plugin-system -l app.kubernetes.io/instance=ui-plugin-operator -o name) --timeout=10s; do sleep 2 ; done
while ! kubectl wait --for condition=ready -n cattle-ui-plugin-system \
$(kubectl get pods -n cattle-ui-plugin-system \
-l app.kubernetes.io/instance=ui-plugin-operator -o name) \
--timeout=10s; do sleep 2 ; done
# Deploy the elemental UI plugin
# NOTE: TABs and then spaces...
Expand Down Expand Up @@ -84,16 +89,18 @@ image::elemental-ui-plugin.png[width=90%]

Elemental is managed by an operator deployed via Helm as:

[,console]
[,bash]
----
helm upgrade --create-namespace -n cattle-elemental-system --install --set image.imagePullPolicy=Always elemental-operator oci://registry.opensuse.org/isv/rancher/elemental/dev/charts/rancher/elemental-operator-chart
helm upgrade --create-namespace -n cattle-elemental-system --install \
--set image.imagePullPolicy=Always elemental-operator \
oci://registry.opensuse.org/isv/rancher/elemental/dev/charts/rancher/elemental-operator-chart
----

https://github.com/rancher/elemental-operator/blob/main/chart/values.yaml[The values.yaml file have some variables interesting to see]

After a few seconds you should see the operator pod appear on the `cattle-elemental-system` namespace:

[,console]
[,shell]
----
kubectl get pods -n cattle-elemental-system
NAME READY STATUS RESTARTS AGE
Expand All @@ -114,7 +121,7 @@ It is out of the scope of this document to provide an explanation about the reso
In order to deploy more than one elemental machine, be sure that `spec.config.elemental.registration.emulated-tpm-seed=-1` is set in your `MachineRegistration` so the seed used for the TPM emulation is randomized per machine. Otherwise, you will get the same TPM Hash for all deployed machines and only the last one to be registered will be valid. See the official docs for http://elemental.docs.rancher.com/tpm[tpm] and http://elemental.docs.rancher.com/machineregistration-reference/#configelementalregistration[machineregistration] for more information.
====

[,console]
[,yaml]
----
cat <<- EOF | kubectl apply -f -
apiVersion: elemental.cattle.io/v1beta1
Expand All @@ -133,7 +140,7 @@ spec:
EOF
----

[,console]
[,yaml]
----
cat <<- EOF | kubectl apply -f -
kind: Cluster
Expand Down Expand Up @@ -165,7 +172,7 @@ spec:
EOF
----

[,console]
[,yaml]
----
cat <<- 'EOF' | kubectl apply -f -
apiVersion: elemental.cattle.io/v1beta1
Expand Down Expand Up @@ -216,16 +223,17 @@ The steps below should to be ran in a linux machine (`SLE Micro` for example).

First step is to download the `machineregistration` object that will instruct where to get the config for the node to be installed:

[,console]
[,bash]
----
curl -k $(kubectl get machineregistration -n fleet-default my-nodes -o jsonpath="{.status.registrationURL}") -o livecd-cloud-config.yaml
curl -k $(kubectl get machineregistration -n fleet-default my-nodes \
-o jsonpath="{.status.registrationURL}") -o livecd-cloud-config.yaml
----

image::registration-endpoint.png[width=90%]

Then, the `rpi.raw` image is downloaded and checked the integrity just to be safe:

[,console]
[,bash]
----
curl -Lk https://download.opensuse.org/repositories/isv:/Rancher:/Elemental:/Stable:/Teal53/images/rpi.raw -o rpi.raw
curl -Lk https://download.opensuse.org/repositories/isv:/Rancher:/Elemental:/Stable:/Teal53/images/rpi.raw.sha256 -o rpi.raw.sha256
Expand All @@ -234,7 +242,7 @@ sha256sum -c rpi.raw.sha256

Finally, the `livecd-cloud-config.yaml` file is injected in the vanilla `rpi.raw` image:

[,console]
[,bash]
----
IMAGE=rpi.raw
DEST=$(mktemp -d)
Expand Down Expand Up @@ -282,7 +290,7 @@ The operating system disk device should be the first one, then the USB, so the U

After a while, a new `machineinventory` host will be present:

[,console]
[,yaml]
----
kubectl get machineinventory -n fleet-default m-ed0a3f46-d6f8-4737-9884-e3a898094994 -o yaml
Expand Down Expand Up @@ -326,14 +334,16 @@ status:

Finally, labeling the `machineinventory` of the discovered new host will trigger the installation:

[,console]
[,bash]
----
kubectl -n fleet-default label machineinventory $(kubectl get machineinventory -n fleet-default --no-headers -o custom-columns=":metadata.name") location=europe
kubectl -n fleet-default label machineinventory $(kubectl get \
machineinventory -n fleet-default --no-headers \
-o custom-columns=":metadata.name") location=europe
----

image::new-cluster.png[width=90%]

[,console]
[,shell]
----
kubectl get cluster -n fleet-default
NAME READY KUBECONFIG
Expand All @@ -342,9 +352,10 @@ my-cluster true my-cluster-kubeconfig

Profit!

[,console]
[,shell]
----
kubectl get secret -n fleet-default my-cluster-kubeconfig -o jsonpath='{.data.value}' | base64 -d >> ~/my-cluster-kubeconfig
kubectl get secret -n fleet-default my-cluster-kubeconfig \
-o jsonpath='{.data.value}' | base64 -d >> ~/my-cluster-kubeconfig
KUBECONFIG=~/my-cluster-kubeconfig kubectl get nodes
NAME STATUS ROLES AGE VERSION
Expand Down
Loading

0 comments on commit 917cb77

Please sign in to comment.