bcf9273d83f6c62c43a58dcb09274be4553f6092
hardware/index.md
| ... | ... | @@ -2,5 +2,6 @@ |
| 2 | 2 | |
| 3 | 3 | * [arduino](arduino) |
| 4 | 4 | * [trezor](trezor) |
| 5 | +* [thinkpad](thinkpad) |
|
| 5 | 6 | * [neos_smartcam](neos_smartcam) |
| 6 | 7 | * [wacom](wacom) |
hardware/thinkpad.md
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +# thinkpad |
|
| 2 | + |
|
| 3 | +* this turns external logo light off: |
|
| 4 | +``` |
|
| 5 | +echo 0 | sudo tee /sys/class/leds/tpacpi\:\:lid_logo_dot/brightness |
|
| 6 | +``` |
|
| 7 | + |
|
| 8 | +* and this turns external logo light on: |
|
| 9 | +``` |
|
| 10 | +echo 255 | sudo tee /sys/class/leds/tpacpi\:\:lid_logo_dot/brightness |
|
| 11 | +``` |
iac/awx.md
| ... | ... | @@ -0,0 +1,110 @@ |
| 1 | +# awx |
|
| 2 | + |
|
| 3 | +## basic install |
|
| 4 | +follow the [install guide][] but these are the stripped down steps |
|
| 5 | + |
|
| 6 | +* clone repo (use https not ssh) and switch to [latest tag][] |
|
| 7 | +``` |
|
| 8 | +git clone https://github.com/ansible/awx-operator.git |
|
| 9 | +cd awx-operator && \ |
|
| 10 | + git checkout tags/<tag> |
|
| 11 | +``` |
|
| 12 | +* make |
|
| 13 | +``` |
|
| 14 | +make deploy |
|
| 15 | +``` |
|
| 16 | +* this skips the need to have your own `kustomization.yaml` but it seems we need it later any way |
|
| 17 | +``` |
|
| 18 | +apiVersion: kustomize.config.k8s.io/v1beta1 |
|
| 19 | +kind: Kustomization |
|
| 20 | +resources: |
|
| 21 | + # Find the latest tag here: https://github.com/ansible/awx-operator/releases |
|
| 22 | + - github.com/ansible/awx-operator/config/default?ref=<tag> |
|
| 23 | + |
|
| 24 | +# Set the image tags to match the git version from above |
|
| 25 | +images: |
|
| 26 | + - name: quay.io/ansible/awx-operator |
|
| 27 | + newTag: <tag> |
|
| 28 | + |
|
| 29 | +# Specify a custom namespace in which to install AWX |
|
| 30 | +namespace: awx |
|
| 31 | +``` |
|
| 32 | +* check operator is running |
|
| 33 | +``` |
|
| 34 | +kubectl get pods -n awx |
|
| 35 | +``` |
|
| 36 | +* set default namespace |
|
| 37 | +``` |
|
| 38 | +kubectl config set-context --current --namespace=awx |
|
| 39 | +``` |
|
| 40 | +* check or create `awx-demo.yml` |
|
| 41 | +``` |
|
| 42 | +--- |
|
| 43 | +apiVersion: awx.ansible.com/v1beta1 |
|
| 44 | +kind: AWX |
|
| 45 | +metadata: |
|
| 46 | + name: awx-demo |
|
| 47 | +spec: |
|
| 48 | + service_type: nodeport |
|
| 49 | +``` |
|
| 50 | +* add `awx-demo` to `kustomization.yaml` (see, told you we needed it) |
|
| 51 | +``` |
|
| 52 | +... |
|
| 53 | +resources: |
|
| 54 | + - github.com/ansible/awx-operator/config/default?ref=<tag> |
|
| 55 | + # Add this extra line: |
|
| 56 | + - awx-demo.yml |
|
| 57 | +... |
|
| 58 | +``` |
|
| 59 | +* apply changes |
|
| 60 | +``` |
|
| 61 | +kubectl apply -k . |
|
| 62 | +``` |
|
| 63 | +* check deployment |
|
| 64 | +``` |
|
| 65 | +kubectl logs -f deployments/awx-operator-controller-manager -c awx-manager -n awx |
|
| 66 | +kubectl get pods -l "app.kubernetes.io/managed-by=awx-operator" -n awx |
|
| 67 | +kubectl get svc -l "app.kubernetes.io/managed-by=awx-operator" -n awx |
|
| 68 | +``` |
|
| 69 | +## don't need this, and minikube isn't configured |
|
| 70 | +#* install minikube, because we need it and it isn't installed already |
|
| 71 | +#``` |
|
| 72 | +#curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb |
|
| 73 | +#dpkg -i minikube_latest_amd64.deb |
|
| 74 | +#``` |
|
| 75 | +#* get service url |
|
| 76 | +#``` |
|
| 77 | +#minikube service -n awx awx-demo-service --url |
|
| 78 | +#``` |
|
| 79 | +* create ingress.yaml |
|
| 80 | +``` |
|
| 81 | +apiVersion: networking.k8s.io/v1 |
|
| 82 | +kind: Ingress |
|
| 83 | +metadata: |
|
| 84 | + name: awx-demo-service |
|
| 85 | + annotations: |
|
| 86 | + ingress.kubernetes.io/ssl-redirect: "false" |
|
| 87 | +spec: |
|
| 88 | + rules: |
|
| 89 | + - http: |
|
| 90 | + paths: |
|
| 91 | + - path: / |
|
| 92 | + pathType: Prefix |
|
| 93 | + backend: |
|
| 94 | + service: |
|
| 95 | + name: awx-demo-service |
|
| 96 | + port: |
|
| 97 | + number: 80 |
|
| 98 | +``` |
|
| 99 | +* create ingress |
|
| 100 | +``` |
|
| 101 | +kubectl create -f ./ingress.yaml |
|
| 102 | +kubectl describe ingress |
|
| 103 | +``` |
|
| 104 | +* get admin password |
|
| 105 | +``` |
|
| 106 | +kubectl get secret awx-demo-admin-password -o jsonpath="{.data.password}" | base64 --decode ; echo |
|
| 107 | +``` |
|
| 108 | + |
|
| 109 | +[install guide]: https://ansible.readthedocs.io/projects/awx-operator/en/latest/installation/basic-install.html |
|
| 110 | +[latest tag]: https://github.com/ansible/awx-operator/releases |
virtualisation/kubernetes.md
| ... | ... | @@ -1,11 +1,16 @@ |
| 1 | 1 | # kubernetes |
| 2 | 2 | |
| 3 | -- list pods for all namespaces |
|
| 3 | +* list pods for all namespaces |
|
| 4 | 4 | ``` |
| 5 | 5 | kubectl get pods --all-namespaces |
| 6 | 6 | ``` |
| 7 | 7 | |
| 8 | -- get list of containers in pod |
|
| 8 | +* get list of containers in pod |
|
| 9 | 9 | ``` |
| 10 | 10 | kubectl -n <namespace> get pods <pod_name> -o jsonpath='{.spec.containers[*].name}' |
| 11 | 11 | ``` |
| 12 | + |
|
| 13 | +* connect to shell on pod |
|
| 14 | +``` |
|
| 15 | +kubectl exec -it pods/demo -- /bin/bash |
|
| 16 | +``` |