neiam
/mutant-operator
An Experimental Operator
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
cleanup
ba49bfc · gmorell · 2025-04-22 03:55
Files changed
modified
README.md
+44
−0
@@ -1,2 +1,46 @@
| 1 | 1 | # Mutant Operations |
| 2 | 2 | |
| 3 | +A Kubernetes Operator | |
| 4 | + | |
| 5 | +# Motivation | |
| 6 | + | |
| 7 | +Don't you wish there was a way to run x deployments with y tweaks? | |
| 8 | + | |
| 9 | +## Usage | |
| 10 | + | |
| 11 | +```yaml | |
| 12 | +apiVersion: neiam.org/v1 | |
| 13 | +kind: MutantDeployment | |
| 14 | +metadata: | |
| 15 | + name: nginx-mutant | |
| 16 | +spec: | |
| 17 | + deployment: | |
| 18 | + apiVersion: apps/v1 | |
| 19 | + kind: Deployment | |
| 20 | + metadata: | |
| 21 | + name: nginx-deployment | |
| 22 | + spec: | |
| 23 | + replicas: 3 | |
| 24 | + selector: | |
| 25 | + matchLabels: | |
| 26 | + app: nginx | |
| 27 | + template: | |
| 28 | + metadata: | |
| 29 | + labels: | |
| 30 | + app: nginx | |
| 31 | + spec: | |
| 32 | + containers: | |
| 33 | + - name: nginx | |
| 34 | + image: nginx:1.21 | |
| 35 | + ports: | |
| 36 | + - containerPort: 80 | |
| 37 | + mutations: | |
| 38 | + - label: canary | |
| 39 | + env: | |
| 40 | + NGINX_VERSION: "1.22" | |
| 41 | + instances: 1 | |
| 42 | + - label: experimental | |
| 43 | + env: | |
| 44 | + NGINX_EXPERIMENTAL: "true" | |
| 45 | + instances: 3 | |
| 46 | +``` |
deleted
docker-compose.yml
+0
−13
@@ -1,13 +0,0 @@
| 1 | −version: "3.9" | |
| 2 | −services: | |
| 3 | − postgres: | |
| 4 | − image: postgres:15 | |
| 5 | −# container_name: mutantops | |
| 6 | − environment: | |
| 7 | − POSTGRES_USER: postgres | |
| 8 | − POSTGRES_PASSWORD: postgres | |
| 9 | − POSTGRES_DB: mutantops | |
| 10 | − ports: | |
| 11 | − - "5432:5432" | |
| 12 | − volumes: | |
| 13 | − - ./init:/docker-entrypoint-initdb.d |
deleted
docker-entrypoint-init.sql
+0
−24
@@ -1,24 +0,0 @@
| 1 | −-- init/init.sql | |
| 2 | −CREATE TABLE jobs | |
| 3 | −( | |
| 4 | − id SERIAL PRIMARY KEY, | |
| 5 | − label TEXT NOT NULL, | |
| 6 | − env JSONB NOT NULL, | |
| 7 | − instances INTEGER NOT NULL | |
| 8 | −); | |
| 9 | − | |
| 10 | −CREATE TABLE job_history | |
| 11 | −( | |
| 12 | − job_id INTEGER PRIMARY KEY | |
| 13 | −); | |
| 14 | − | |
| 15 | −-- Example job (spawns 3 pods with test env vars) | |
| 16 | −INSERT INTO jobs (label, env, instances) | |
| 17 | −VALUES ('pinenote', | |
| 18 | − '[ | |
| 19 | − { | |
| 20 | − "name": "SNAP_RES", | |
| 21 | − "value": "960x540" | |
| 22 | − } | |
| 23 | − ]', | |
| 24 | − 3); |
modified
operator.yml
+6
−3
@@ -1,6 +1,7 @@
| 1 | 1 | apiVersion: apps/v1 |
| 2 | 2 | kind: Deployment |
| 3 | 3 | metadata: |
| 4 | + namespace: mutants | |
| 4 | 5 | name: mutantops-operator |
| 5 | 6 | spec: |
| 6 | 7 | replicas: 1 |
@@ -28,11 +29,13 @@ spec:
| 28 | 29 | fieldPath: metadata.name |
| 29 | 30 | - name: OPERATOR_NAME |
| 30 | 31 | value: "mutantops-operator" |
| 32 | + | |
| 31 | 33 | --- |
| 32 | 34 | apiVersion: v1 |
| 33 | 35 | kind: ServiceAccount |
| 34 | 36 | metadata: |
| 35 | 37 | name: mutantops-operator |
| 38 | + namespace: mutants | |
| 36 | 39 | --- |
| 37 | 40 | apiVersion: rbac.authorization.k8s.io/v1 |
| 38 | 41 | kind: ClusterRole |
@@ -95,6 +98,6 @@ roleRef:
| 95 | 98 | kind: ClusterRole |
| 96 | 99 | name: mutantops-operator |
| 97 | 100 | subjects: |
| 98 | −- kind: ServiceAccount | |
| 99 | − name: mutantops-operator | |
| 100 | − namespace: default | |
| 101 | + - kind: ServiceAccount | |
| 102 | + name: mutantops-operator | |
| 103 | + namespace: mutants |
Parents: 240d6b1