Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
| // ~/docker/config.json | |
| { | |
| "credsStore": "desktop", | |
| "credHelpers": { | |
| "docker.pkg.github.com": "gh", | |
| "ghcr.io": "gh" | |
| } | |
| } |
| substitutions: | |
| device_name: demo2 | |
| friendly_name: Demo 2 | |
| ## Boilerplate | |
| esphome: | |
| name: ${device_name} | |
| platform: ESP32 | |
| board: m5stack-core-esp32 |
| # Controlling my Buva Qstream ventilation system using: | |
| # * A Wemos D1 mini lite (an ESP8266 based board) | |
| # * A Wemos power shield so I can power the Wemos from the ventilation units 12V supply. | |
| # * A simple PWM to 10V convertor like this: https://www.cheaptech.nl/pwm-signaal-te-voltage-converter-1-3-khz-0-10-v-pw.html | |
| # * The amazing ESPHome firmware tool: https://esphome.io | |
| # * Home Assistant to tie it all together: https://www.home-assistant.io | |
| # | |
| # I used to use a Raspberry Pi and some Python code for this. See https://gist.github.com/SqyD/a927ab612df767a0cc892bcde23d025c | |
| # The Wemos approach seems more stable and doesn't require external USB power. |
| extension UIColor { | |
| // get a complementary color to this color | |
| // https://gist.github.com/klein-artur/025a0fa4f167a648d9ea | |
| var complementary: UIColor { | |
| let ciColor = CIColor(color: self) | |
| // get the current values and make the difference from white: | |
| let compRed: CGFloat = 1.0 - ciColor.red |
| # This will use osd.5 as an example | |
| # ceph commands are expected to be run in the rook-toolbox | |
| 1) disk fails | |
| 2) remove disk from node | |
| 3) mark out osd. `ceph osd out osd.5` | |
| 4) remove from crush map. `ceph osd crush remove osd.5` | |
| 5) delete caps. `ceph auth del osd.5` | |
| 6) remove osd. `ceph osd rm osd.5` | |
| 7) delete the deployment `kubectl delete deployment -n rook-ceph rook-ceph-osd-id-5` | |
| 8) delete osd data dir on node `rm -rf /var/lib/rook/osd5` |
| apiVersion: extensions/v1beta1 | |
| kind: PodSecurityPolicy | |
| metadata: | |
| name: restricted | |
| annotations: | |
| seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default' | |
| apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' | |
| seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default' | |
| apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' | |
| spec: |
| I have run an nginx container... | |
| docker ps | |
| CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
| 6d67de07731d nginx "nginx -g 'daemon ..." 40 minutes ago Up 40 minutes 80/tcp, 443/tcp epic_goldberg | |
| I want to use Debian for debug: | |
| docker run -it --pid=container:6d67de07731d --net=container:6d67de07731d --cap-add sys_admin debian | |
| I can see the nginx process: |
| #!/bin/bash | |
| wget -r -nc -p --html-extension -k -D google.com -np https://landing.google.com/sre/book/ |
| from checks import AgentCheck | |
| import re | |
| import requests | |
| rx0 = re.compile(r'^# TYPE \S+ (\S+)$') | |
| rx1 = re.compile(r'(\w+)(?:{(\S+)})? ([-+]?\d*\.\d+|\d+)') | |
| rx2 = re.compile(r'(\w+)="(\S*?)",?') | |
| class PrometheusCheck(AgentCheck): |