grimoire

personal wiki
git clone git://git.pyratebeard.net/grimoire.git
Log | Files | Refs

commit bcf9273d83f6c62c43a58dcb09274be4553f6092
parent 63ed72e66e2a59019bfca0743d02bb0bb48c7810
Author: pyratebeard <root@pyratebeard.net>
Date:   Tue,  5 Mar 2024 10:33:34 +0000

updates

Diffstat:
Mhardware/index.md | 1+
Ahardware/thinkpad.md | 11+++++++++++
Aiac/awx.md | 110+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mvirtualisation/kubernetes.md | 9+++++++--
4 files changed, 129 insertions(+), 2 deletions(-)

diff --git a/hardware/index.md b/hardware/index.md @@ -2,5 +2,6 @@ * [arduino](arduino) * [trezor](trezor) +* [thinkpad](thinkpad) * [neos_smartcam](neos_smartcam) * [wacom](wacom) diff --git a/hardware/thinkpad.md b/hardware/thinkpad.md @@ -0,0 +1,11 @@ +# thinkpad + +* this turns external logo light off: +``` +echo 0 | sudo tee /sys/class/leds/tpacpi\:\:lid_logo_dot/brightness +``` + +* and this turns external logo light on: +``` +echo 255 | sudo tee /sys/class/leds/tpacpi\:\:lid_logo_dot/brightness +``` diff --git a/iac/awx.md b/iac/awx.md @@ -0,0 +1,110 @@ +# awx + +## basic install +follow the [install guide][] but these are the stripped down steps + +* clone repo (use https not ssh) and switch to [latest tag][] +``` +git clone https://github.com/ansible/awx-operator.git +cd awx-operator && \ + git checkout tags/<tag> +``` +* make +``` +make deploy +``` +* this skips the need to have your own `kustomization.yaml` but it seems we need it later any way +``` +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + # Find the latest tag here: https://github.com/ansible/awx-operator/releases + - github.com/ansible/awx-operator/config/default?ref=<tag> + +# Set the image tags to match the git version from above +images: + - name: quay.io/ansible/awx-operator + newTag: <tag> + +# Specify a custom namespace in which to install AWX +namespace: awx +``` +* check operator is running +``` +kubectl get pods -n awx +``` +* set default namespace +``` +kubectl config set-context --current --namespace=awx +``` +* check or create `awx-demo.yml` +``` +--- +apiVersion: awx.ansible.com/v1beta1 +kind: AWX +metadata: + name: awx-demo +spec: + service_type: nodeport +``` +* add `awx-demo` to `kustomization.yaml` (see, told you we needed it) +``` +... +resources: + - github.com/ansible/awx-operator/config/default?ref=<tag> + # Add this extra line: + - awx-demo.yml +... +``` +* apply changes +``` +kubectl apply -k . +``` +* check deployment +``` +kubectl logs -f deployments/awx-operator-controller-manager -c awx-manager -n awx +kubectl get pods -l "app.kubernetes.io/managed-by=awx-operator" -n awx +kubectl get svc -l "app.kubernetes.io/managed-by=awx-operator" -n awx +``` +## don't need this, and minikube isn't configured +#* install minikube, because we need it and it isn't installed already +#``` +#curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb +#dpkg -i minikube_latest_amd64.deb +#``` +#* get service url +#``` +#minikube service -n awx awx-demo-service --url +#``` +* create ingress.yaml +``` +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: awx-demo-service + annotations: + ingress.kubernetes.io/ssl-redirect: "false" +spec: + rules: + - http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: awx-demo-service + port: + number: 80 +``` +* create ingress +``` +kubectl create -f ./ingress.yaml +kubectl describe ingress +``` +* get admin password +``` +kubectl get secret awx-demo-admin-password -o jsonpath="{.data.password}" | base64 --decode ; echo +``` + +[install guide]: https://ansible.readthedocs.io/projects/awx-operator/en/latest/installation/basic-install.html +[latest tag]: https://github.com/ansible/awx-operator/releases diff --git a/virtualisation/kubernetes.md b/virtualisation/kubernetes.md @@ -1,11 +1,16 @@ # kubernetes -- list pods for all namespaces +* list pods for all namespaces ``` kubectl get pods --all-namespaces ``` -- get list of containers in pod +* get list of containers in pod ``` kubectl -n <namespace> get pods <pod_name> -o jsonpath='{.spec.containers[*].name}' ``` + +* connect to shell on pod +``` +kubectl exec -it pods/demo -- /bin/bash +```