apiVersion: apps/v1
kind: Deployment
metadata:
namespace: mutants
name: mutantops-operator
spec:
replicas: 1
selector:
matchLabels:
app: mutantops-operator
template:
metadata:
labels:
app: mutantops-operator
spec:
serviceAccountName: mutantops-operator
containers:
- name: mutantops-operator
image: ghcr.io/neiam/mutant-operator:latest
imagePullPolicy: Always
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "mutantops-operator"
# Optional admin token for the HTTP API: listing, creating and deleting
# Mutations. A Mutation's own variants only need its own token, from
# its generated <name>-secret. Create the secret with:
# kubectl -n mutants create secret generic mutantops-api \
# --from-literal=token="$(openssl rand -hex 32)"
- name: MUTANT_API_TOKEN
valueFrom:
secretKeyRef:
name: mutantops-api
key: token
optional: true
ports:
- name: http
containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: mutantops-api
namespace: mutants
spec:
selector:
app: mutantops-operator
ports:
- name: http
port: 80
targetPort: http
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mutantops-operator
namespace: mutants
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: mutantops-operator
# Only what the operator uses: generated Deployments, MutantDeployments
# (read), Mutations and their status, and each Mutation's generated Secret
# (get/create only; garbage collection deletes it with the Mutation).
rules:
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: ["neiam.org"]
resources: ["mutantdeployments"]
verbs: ["get", "list", "watch"]
- apiGroups: ["neiam.org"]
resources: ["mutations"]
verbs: ["get", "list", "watch", "create", "patch", "delete"]
- apiGroups: ["neiam.org"]
resources: ["mutations/status"]
verbs: ["get", "patch", "update"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: mutantops-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: mutantops-operator
subjects:
- kind: ServiceAccount
name: mutantops-operator
namespace: mutants
neiam
/mutant-operator
An Experimental Operator
public · Issues · Pulls · Labels · Forks · Compare · Actions failure · Badges · Packages
⭐
Log in to mark this repository.
2.7 KiB · text
History
241f400