Skip to content

Install in observe-only mode

The first step for every user: install Shadewright so that it watches and records, and changes nothing. Two ways are below: a kustomize overlay on the release manifests, and the Helm chart. The next step is your first proposal. Settings are in the configuration reference; if something does not start, see troubleshooting.

What is built and what is not is on the Get started page: read its box first.

Install with kubectl and kustomize

Observe-only means the analyzer watches the namespaces you name and records Incident objects, and nothing else happens: no model is called (nothing calls one yet), no settings entry names a repository, and spec.paused is true, so the executor could not write to Git even if a request existed. It writes only its own control state: Incidents, the budget ConfigMap, the settings status and Events.

What you need:

  • A cluster with kubectl access that may create CRDs, ClusterRoles and a namespace. Kubernetes 1.32 or later: the executor lists requests with CRD field selectors. The CRDs use CEL validation rules, so the API server must support them. The tested Kubernetes versions are in the compatibility page; the envtest suites run against Kubernetes 1.37.
  • The namespaces to watch already exist.
  • kubectl with built-in kustomize (kubectl apply -k).

The base is config/default of the release tag v0.2.0, so the manifests match the images. Both Deployments use the placeholder image controller:latest, and the two images are published as separate repositories, so the overlay replaces each by digest. Check the digests against the release before you use them. Create a directory outside any Git repository of the project with two files.

kustomization.yaml:

resources:
  - github.com/pkalin/shadewright/config/default?ref=v0.2.0
  - watch-rolebinding.yaml
patches:
  - target:
      kind: Deployment
      name: shadewright-executor
    patch: |-
      - op: replace
        path: /spec/template/spec/containers/0/image
        value: ghcr.io/pkalin/shadewright-executor@sha256:88e2ab1f102509d2b4ff0656b2a7b6fac270967f3511fd214bdab010f6d326f3
  - target:
      kind: Deployment
      name: shadewright-analyzer
    patch: |-
      - op: replace
        path: /spec/template/spec/containers/0/image
        value: ghcr.io/pkalin/shadewright-analyzer@sha256:df08dcc65a3396fa5d3d63222c1bb20869234979ed74b3c6d6c0ae338c708aab
      # The base passes --watch-namespaces=demo and --cluster-id=lab. A repeated flag takes its last value,
      # so appending is enough.
      - op: add
        path: /spec/template/spec/containers/0/args/-
        value: --watch-namespaces=default
      - op: add
        path: /spec/template/spec/containers/0/args/-
        value: --cluster-id=my-cluster

A release whose config/default has the verifier (shadewright-verifier, the third Deployment, ADR-0030) needs one more patch in the same list, with that release's verifier digest, and the same namespaces as the analyzer:

  - target:
      kind: Deployment
      name: shadewright-verifier
    patch: |-
      - op: replace
        path: /spec/template/spec/containers/0/image
        value: ghcr.io/pkalin/shadewright-verifier@sha256:<verifier digest of the release>
      # The base passes --watch-namespaces=demo. The verifier does not start with an empty list.
      - op: add
        path: /spec/template/spec/containers/0/args/-
        value: --watch-namespaces=default

watch-rolebinding.yaml (one RoleBinding per watched namespace, with that namespace in metadata.namespace; add one more document for each namespace in the flag):

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: shadewright-analyzer-watch
  namespace: default
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: shadewright-analyzer-watch-role
subjects:
  - kind: ServiceAccount
    name: shadewright-analyzer
    namespace: shadewright-system

With the verifier, add its RoleBinding in each namespace of its --watch-namespaces too, as one more document of the same file:

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: shadewright-verifier-watch
  namespace: default
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: shadewright-verifier-watch-role
subjects:
  - kind: ServiceAccount
    name: shadewright-verifier
    namespace: shadewright-system

The base's config/watch is not used: it holds the lab's demo namespace only. Choose the cluster ID once, because changing it starts every Incident afresh (cluster ID).

Review what you are about to apply, then apply it and the settings:

kubectl kustomize . | less
kubectl apply -k .
kubectl wait --for=condition=Established \
  crd/incidents.remediation.shadewright.io crd/remediationpolicies.remediation.shadewright.io \
  crd/remediationrequests.remediation.shadewright.io crd/remediationsettings.remediation.shadewright.io
kubectl apply -f - <<'EOF'
apiVersion: remediation.shadewright.io/v1alpha1
kind: RemediationSettings
metadata:
  name: default
spec:
  paused: true
  analysis:
    maxAnalysesPerDay: 0
EOF

Check it:

kubectl -n shadewright-system rollout status deploy/shadewright-analyzer deploy/shadewright-executor
kubectl -n shadewright-system rollout status deploy/shadewright-verifier   # with the verifier
kubectl -n shadewright-system logs deploy/shadewright-analyzer | grep "Watching namespaces"
kubectl get remediationsettings default -o jsonpath='{.status}{"\n"}'
kubectl -n shadewright-system get incidents
kubectl shadewright doctor -n shadewright-system   # the kubectl plugin, read-only

kubectl shadewright doctor checks the CRDs, the settings, the kill switch, the Deployments, the repositories and their Flux sources in one command, and lists the Flux sources that deliver the workloads of the watched namespaces; in observe-only mode it warns about the kill switch, the analysis limit of 0, the missing repository and the namespaces the analyzer does not watch, and fails nothing. Expect both Deployments ready (a Pod turns Ready once its informers have synced, see health probes), a log line with your namespaces and cluster ID, and in the settings status the platform detection, the DetectionFailed condition False and NoWatchedNamespaces False. An analyzer started with no namespace (the Helm chart's default) logs Watching no namespaces instead, reports NoWatchedNamespaces True once a settings object exists, and records no Incident. Incidents appear once a watched namespace has a symptom the collector knows (for example an OOMKilled container or a failing pod); each carries the condition AnalysisDue with reason AnalysisDisabled, which is what analysis.maxAnalysesPerDay: 0 does. The logs are the controller-runtime development format until you pass --zap-devel=false.

The executor Deployment carries the label azure.workload.identity/use: "true" and its ServiceAccount a placeholder client ID. Both are inert off AKS and in observe-only mode, where the executor never opens a repository. They matter in the next step.

To remove observe-only, kubectl delete -k . and delete the settings object first. Removing the CRDs deletes every Incident. The order for an install that has requests is in upgrade and uninstall.

Install with Helm instead

The chart installs the same objects as config/default, except the helper roles (off by default) and the Namespace, plus one RoleBinding per watched namespace, with the images, cluster ID, watched namespaces and workload identity as values. With no values the published chart installs an idle Shadewright: no watched namespace, no Azure workload identity, the cluster ID from the kube-system UID, and the release's images by digest.

Pick a version on the releases page, verify the chart (the commands are in verify a release and in the release's own notes), then install it from the registry:

helm install shadewright oci://ghcr.io/pkalin/charts/shadewright --version <version> \
  --namespace shadewright-system --create-namespace \
  --set clusterId=my-cluster --set 'analyzer.watchNamespaces={default}'

clusterId is optional (it defaults to the UID of kube-system); analyzer.watchNamespaces is what makes the analyzer watch anything. The verifier follows it while verifier.watchNamespaces is unset, and the chart deploys the verifier only when that list is not empty: with no namespace (the default) there is no verifier, so with executor.verification.enabled a merged request can end only Inconclusive, never Succeeded. With a verifier deployed, the executor reads its report as untrusted evidence and decides Cleared (#683). There is no helm repo add step because the chart is an OCI artifact, and --version is required for a pre-release such as 0.2.0-rc.1, because Helm does not pick pre-releases by itself. For the strict path, install the digest you verified: oci://ghcr.io/pkalin/charts/shadewright@sha256:<chart digest> in place of the reference and --version (see the configuration reference).

To run a triage or escalation deployment on the Anthropic API (ADR-0037), create a Secret with the key in the release namespace yourself (the chart never creates it) and pass --set analyzer.analysis.anthropic.apiKey.secretName=<secret> (key api-key, or set secretKey), or an apiKey.volume source such as a Secrets Store CSI volume. The chart mounts it read-only into the analyzer only. Use a dedicated vendor workspace with a spend limit for the key, and rotate it by updating the Secret: no restart is needed. See Model API key for the values and who can read the key.

An install that calls only Anthropic deployments needs no Azure settings for the model: with a triage model the chart requires at least one of analyzer.analysis.endpointSuffixes and the Anthropic API key (analyzer.analysis.anthropic.apiKey), and analyzer.identity.azure.clientId exactly when endpointSuffixes or a record store (analyzer.analysis.recordStore.azureBlob.account) is set. With the key only, the analyzer starts without a workload identity and builds no Azure token source. The chart does not read settings.spec: the settings object is created once and an upgrade does not change it, so the chart cannot know which deployments it holds. An analyzer started without endpointSuffixes refuses every Foundry deployment (ProviderNotConfigured, the Incident shows it). Leave apiVersion out of an Anthropic deployment: only provider Anthropic may leave it out, and a value there is not sent. The Chart workflow installs this shape on Kind with test/chart/testdata/anthropic-only-values.yaml (a dummy key in a Secret the script creates); run the same install locally with make test-chart-anthropic (needs Docker and Kind).

For development, install from a clone with ./dist/chart in place of the OCI reference. A clone has no image digests: pass --set executor.image.digest=sha256:<digest> --set analyzer.image.digest=sha256:<digest> --set verifier.image.digest=sha256:<digest> for the release whose tag you checked out, or --set image.allowTag=true to run the appVersion tag with images built from that same clone.

The same settings object and checks as above apply (--set settings.create=true and settings.spec create it from values, only when it does not exist; Helm never changes it afterwards). Uninstalling keeps the CRDs by default (crd.keep), so Incidents survive. The commands to upgrade the release and to uninstall it, what stays behind (the CRDs and the settings object) and how to remove it are in upgrade with Helm, uninstall with Helm and the settings object.

Install the analyzer without the executor

To try Shadewright on a cluster with real workloads, install only the analyzer. Nothing in the release can write to Git then: the analyzer reads the cluster, records Incidents and, with a triage model, diagnoses them.

helm install shadewright oci://ghcr.io/pkalin/charts/shadewright --version <version> \
  --namespace shadewright-system --create-namespace \
  --set executor.enabled=false --set-json 'verifier.watchNamespaces=[]' \
  --set 'analyzer.watchNamespaces={default}'

executor.enabled=false leaves out every object of the executor: Deployment, ServiceAccount, Roles and bindings, PodDisruptionBudget, metrics Service, NetworkPolicy, leader election Lease, ServiceMonitor and its subject in the metrics authentication binding. The analyzer's identity and grants are the same as with the executor. The verifier only works on requests the executor has merged, so the example also sets verifier.watchNamespaces to an empty list, which leaves it out too. A source checkout needs no executor image digest in this mode.

The chart refuses executor.enabled=false together with a value that only configures an executor, and the message names it: executor.replicas other than 1, executor.identity.azure.clientId, executor.identity.azure.tenantId, executor.identity.azure.projectToken, executor.serviceAccount.annotations, executor.goMemLimit, executor.reviewerHints.enabled, executor.verification.enabled, executor.verification.nodeGrace other than 1m, executor.extraArgs and executor.metricsTLS.secretName. Image, resources and Pod placement values are not refused and have no effect.

What the analyzer leaves, and where to read it:

  • Leave analyzer.analysis.actionPolicies empty. A proposed action with no policy ends the analysis with the reason NoPolicyForAction: no RemediationRequest is created and the Incident goes to Escalated.
  • The Incident shows its phase and the outcome of the last analysis in the Analyzed condition, with kubectl get incident <name> -o yaml or kubectl shadewright status (check status). The diagnosis text is not on the Incident: it is in the analyzer log (the Analyzed Incident line, field summary) and, when a record store is configured, in the analysis record whose ID is in status.analysisRecords.
  • With action policies set, the analyzer still creates RemediationRequests. Nothing sets a phase on them without an executor, so kubectl get remediationrequests shows an empty Phase, and nothing checks, expires or cancels them.

To go on to proposals, upgrade with executor.enabled=true and the executor's identity (first proposal). An executor started later treats a request with no phase as a new one and runs the policy check on it.

The Chart workflow installs this shape on Kind (hack/chart-analyzer-only-install-test.sh: no executor or verifier object, an Incident for a workload whose image does not exist, no request); run it locally with make test-chart-analyzer-only (needs Docker and Kind, builds only the analyzer image).

Azure workload identity without the webhook

The chart assumes the Azure workload identity mutating webhook: it sets the ServiceAccount annotation azure.workload.identity/client-id and the Pod label azure.workload.identity/use, and the webhook adds the token volume and the AZURE_* variables. On a cluster without the webhook, set identity.azure.projectToken for the component and the chart renders those itself. It applies to the analyzer and the executor; the verifier has no cloud identity.

helm install shadewright oci://ghcr.io/pkalin/charts/shadewright --version <version> \
  --set executor.identity.azure.clientId=<executor client ID> \
  --set executor.identity.azure.tenantId=<tenant ID> \
  --set executor.identity.azure.projectToken=true

The same three values exist under analyzer.identity.azure (needed when the analyzer uses Foundry or a Blob record store). With projectToken the Pod gets:

  • a projected ServiceAccount token volume, azure-identity-token: audience api://AzureADTokenExchange, expiry 3600 seconds, mounted read-only at /var/run/secrets/azure/tokens;
  • AZURE_CLIENT_ID and AZURE_TENANT_ID from the two values, AZURE_FEDERATED_TOKEN_FILE set to /var/run/secrets/azure/tokens/azure-identity-token, and AZURE_AUTHORITY_HOST set to https://login.microsoftonline.com/ (the public cloud; the binaries accept only the public, US Government and China hosts);
  • no azure.workload.identity/use label, so a cluster that does have the webhook does not mutate the Pod a second time.

The ServiceAccount annotation stays. The managed identity and its federated credential are the same as with the webhook (subject system:serviceaccount:<namespace>:<ServiceAccount>, audience api://AzureADTokenExchange), so the mode grants nothing more. The chart refuses projectToken without both clientId and tenantId, and tenantId without projectToken. The tenant ID is not a secret; keep it in your own values file, not in a public repository. The kubelet rotates the token in the volume.

OpenAI-compatible inference

For an analyzer using only OpenAI-compatible endpoints, set analyzer.analysis.disableFoundry=true, declare exact bases, APIs and nonempty allowed model lists under openAICompatible.endpoints, and leave analyzer.identity.azure.clientId empty unless Blob records are enabled. The optional key is an existing Secret or CSI file mounted in the analyzer only; attach its source to that endpoint. A keyless cluster Service needs verified HTTPS and service egress fields on its endpoint declaration. Run that Service in a namespace where only cluster administrators create pods: the right to create pods there, or to edit the Service or its EndpointSlices, is equivalent to holding the key and the redacted context. A Service address in 100.64.0.0/10 is refused. If the cluster's pod or Service ranges are routable addresses outside the private ones, list them in openAICompatible.inClusterCIDRs: the analyzer then refuses to connect a public endpoint to them, and the egress rule of a declared port other than 443 excepts them. To find a cluster's ranges: the pod ranges are in kubectl get nodes -o jsonpath='{.items[*].spec.podCIDRs}' (empty with some CNIs, which keep them in their own configuration, such as the Cilium IPPool or the Calico IPPool objects); the Service range is the API server's --service-cluster-ip-range, kubectl get servicecidrs on clusters that serve that API, or the cluster's settings at your cloud (for AKS, az aks show --query networkProfile). Plain HTTP is refused. Follow the installation and qualification runbook.