Beta. The CRDs are v1, but until 1.0 a change that cannot be additive is named in the changelog. What that means.
What it installs
config/default installs the operator into the namespace kubeassistant: the CRDs, a ServiceAccount, the ClusterRole and its binding, a Role for the leader election Lease, a two-replica Deployment of ghcr.io/taumatix/kubeassistant:v0.1.0, and a PodDisruptionBudget that keeps one replica up through a node drain. The pod runs non-root, with a read-only root filesystem, every capability dropped and the RuntimeDefault seccomp profile; the namespace enforces the restricted Pod Security profile. Logs are JSON; --zap-devel switches to readable text.
The image is public and built for linux/amd64 and linux/arm64:
docker pull ghcr.io/taumatix/kubeassistant:v0.1.0
You need an MQTT broker that Home Assistant's MQTT integration is connected to. The operator publishes Home Assistant's discovery messages to it.
Steps
1. Create the namespace and, if the broker needs them, the broker credentials. The broker Secret is optional: without it the operator connects anonymously.
kubectl create namespace kubeassistant
kubectl -n kubeassistant create secret generic kubeassistant-broker \
--from-literal=username=kubeassistant --from-file=password=./broker-password
2. Write an overlay that points at your broker. args/1 is --broker; args/0 is --leader-elect. Use config/mirror instead of config/default to turn mirroring on.
# my-kubeassistant/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/taumatix/kubeassistant//config/default?ref=v0.1.0
patches:
- target: {kind: Deployment, name: kubeassistant}
patch: |-
- op: replace
path: /spec/template/spec/containers/0/args/1
value: --broker=mqtts://mosquitto.example:8883
3. Install, then grant the kinds you want to expose (see Security). The sample grants Deployments in the namespace home:
kubectl apply --server-side -k my-kubeassistant
kubectl apply --server-side -f https://raw.githubusercontent.com/taumatix/kubeassistant/v0.1.0/config/samples/target_rbac.yaml
4. Create a binding. config/samples/devicebinding.yaml binds Deployments labelled tier: media in the namespace home.
Running from a checkout
kubectl apply --server-side -k config/crd
go run ./cmd/kubeassistant --broker tcp://mosquitto:1883
The flags are listed under Operating.