Skip to content

Instantly share code, notes, and snippets.

View HighwayofLife's full-sized avatar
🥷
Jedi

David Lewis HighwayofLife

🥷
Jedi
View GitHub Profile
@HighwayofLife
HighwayofLife / daemonset.yaml
Created August 19, 2019 16:20
datadog/daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: datadog-agent
namespace: datadog-monitor
spec:
selector:
matchLabels:
app: datadog-agent
updateStrategy:
@HighwayofLife
HighwayofLife / configmap.yaml
Created August 19, 2019 16:42
datadog/configmap.yaml
---
kind: ConfigMap
apiVersion: v1
metadata:
name: dd-agent-config
namespace: datadog-monitor
data:
kube_apiserver_metrics.yaml: |
init_config:
@HighwayofLife
HighwayofLife / drone-kube-runner.yaml
Last active February 18, 2020 08:28
Drone kube runner examples
---
# Source: drone/templates/deployment-runner.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: drone-kube-runner
namespace: pipeline
labels:
app: drone
chart: "drone-2.2.0"
@HighwayofLife
HighwayofLife / cloud_init.yaml
Last active March 5, 2025 12:49
Install Docker via Cloud Init on Ubuntu VM
#cloud-config
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
# Enable ipv4 forwarding, required on CIS hardened machines
@HighwayofLife
HighwayofLife / ceph-before-reboot-script.yaml
Created February 4, 2021 23:05
Ceph Before Reboot Maintenance Script
apiVersion: v1
kind: ConfigMap
metadata:
name: ceph-before-reboot-script
namespace: rook-ceph
data:
status-check.sh: |-
#!/bin/bash
# preflightCheck checks for existence of "dependencies"
preflightCheck() {

Coding Rules and Instructions

  1. Test-Driven Development (TDD) with pytest: Always write a failing test before writing implementation code (Red-Green-Refactor). Use pytest and pytest-fixtures for test setup, execution, and teardown.
  2. KISS (Keep It Simple, Stupid): Favor the simplest solution that meets the requirements.
  3. DRY (Don't Repeat Yourself): Avoid code duplication. Extract reusable logic into functions or classes.
  4. Standard Libraries and Tools: Utilize standard Python libraries (like datetime for date/time, requests for HTTP requests, and logging) and external libraries, including BeautifulSoup4 for HTML parsing, to avoid reinventing the wheel. Favor well-maintained and widely-used libraries.
  5. YAGNI (You Ain't Gonna Need It): Don't implement features or functionality unless they are currently required.
  6. SOLID Principles & Extensibility: Adhere to SOLID principles, promoting maintainability, testability, and future extension. Consider potential future requi