=============== LIBRARY RULES =============== From library maintainers: - Context7 defaults to main; the GitHub default develop is for contributions. Use the matching release tag and docs/support-matrix.md for compatibility. Source state and successful CI do not prove a live cluster rollout. - infrastructure.alpininsight.ai/v1beta1 is the provider API group and resource schema version, served by the Kubernetes API server. It is not a provider release number, public website, DNS requirement or CDN location. - The provider implements the legacy v1beta1 CAPI contract. Treat v1beta2 migration, clusterctl packaging and hardware plugins as planned until the support matrix explicitly establishes them as supported. - Use pre-provisioned Linux hosts with independently verified SSH host keys or CA trust. OS and network preparation are prerequisites; this provider does not create cloud VMs, install an OS or manage hardware power. - Follow docs/api-reference.md and shared/crds/ for resource fields. Delete Machines through CAPI; retain claims, quarantine and finalizers until owned cleanup succeeds. Observe durable receipts after unknown outcomes instead of replaying destructive work. - Controller HA uses active/standby peering, host Leases and remote fencing. It does not establish management control-plane HA or a recovery SLO; use docs/operations.md for pause, reboot, cleanup and recovery. - Use docs/installation.md and docs/ssh-key-lifecycle.md for deployment and credential handling. Keep secrets and private inventories out of examples. Internal Python modules are not a supported plugin SDK. ### Candidate metadata label mapping for v1beta2 contract Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/capi-contract-migration.md A planned example of the metadata label configuration required to map the v1beta2 contract to the existing v1beta1 version. This should only be published alongside implementation and successful acceptance evidence. ```yaml metadata: labels: cluster.x-k8s.io/v1beta2: v1beta1 ``` -------------------------------- ### Verify Python package identity and license Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/release-process.md Executes the package check script to validate the version and license metadata of the release artifacts. Use the intended release version instead of the example, and optionally add --offline if dependencies are cached. ```bash uv run --project python --frozen python python/scripts/check_package.py --version v0.4.3 ``` -------------------------------- ### Render provider manifests Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/installation.md Use kustomize to render the provider CRDs and deployment manifests for review before delivery. ```bash kubectl kustomize shared/crds kubectl kustomize python/deploy ``` -------------------------------- ### Check replica readiness and peering status Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/operations.md Use these commands to verify the readiness of a specific provider pod and inspect the ClusterKopfPeering status for the controller. ```bash kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" -n capi-provider-ssh-system \ exec "$PROVIDER_POD" -- python -B -m capi_provider_ssh.readiness kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" get clusterkopfpeerings.kopf.dev capi-provider-ssh ``` -------------------------------- ### Verify controller deployment and peering Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/installation.md Check the status of the controller deployment, pods, and peering objects to ensure the provider is running correctly. ```bash kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" -n capi-provider-ssh-system \ get deployment capi-provider-ssh-controller kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" -n capi-provider-ssh-system \ get pods -l app.kubernetes.io/component=controller kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" get clusterkopfpeerings.kopf.dev capi-provider-ssh ``` -------------------------------- ### Verify GitHub repository state via CLI Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/ci-governance.md Use these GitHub CLI commands to verify vulnerability reporting, CODEOWNERS status, and branch rules for the repository. ```bash gh api repos/alpininsight/capi-provider-ssh/private-vulnerability-reporting gh api repos/alpininsight/capi-provider-ssh/codeowners/errors gh api repos/alpininsight/capi-provider-ssh/rules/branches/develop gh api repos/alpininsight/capi-provider-ssh/rules/branches/main ``` -------------------------------- ### Audit SSH key references and plaintext manifests Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/ssh-key-lifecycle.md Commands to inventory current SSH key references across resources and verify that no plaintext private keys are committed to the deployment directory. ```bash # Inventory current SSH key refs kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" get sshhosts,sshmachines -A -o custom-columns='KIND:.kind,NS:.metadata.namespace,NAME:.metadata.name,KEYSECRET:.spec.sshKeyRef.name,KEYFIELD:.spec.sshKeyRef.key' # Confirm no plaintext private key manifests under deploy/ rg -n "BEGIN OPENSSH PRIVATE KEY|BEGIN RSA PRIVATE KEY" python/deploy ``` -------------------------------- ### Execute full disposable lifecycle test Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/testing.md The command to run the complete disposable lifecycle test suite in a Kind environment. ```bash bash scripts/test-kind-lifecycle.sh ``` -------------------------------- ### Run local validation tests Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/README.md Execute the test suite from the python directory using the isolated dependency environment. ```bash uv sync --frozen --dev uv run pytest -q -m 'not integration and not e2e and not kind' ``` -------------------------------- ### Create verified-ssh-hosts secret Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/ssh-key-lifecycle.md Command to create a Kubernetes secret containing verified OpenSSH host keys for server identity authentication. ```bash kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" -n "$NAMESPACE" create secret generic verified-ssh-hosts \ --from-file=known_hosts=./independently-verified-known_hosts ``` -------------------------------- ### Define an SSHHost inventory entry Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/api-reference.md Illustrative YAML configuration for an SSHHost resource. Requires pre-existing Secrets for authentication and host verification. ```yaml apiVersion: infrastructure.alpininsight.ai/v1beta1 kind: SSHHost metadata: name: worker-a namespace: example-cluster labels: role: worker spec: address: 192.0.2.10 port: 22 user: root sshKeyRef: name: node-client-key sshHostKeyRef: name: node-verified-hosts ``` -------------------------------- ### Measure coverage with pytest-cov Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/testing.md Executes pytest with coverage reporting, outputting results to a temporary directory. This command excludes integration, e2e, and kind tests. ```bash coverage_dir="$(mktemp -d "${TMPDIR:-/tmp}/capi-coverage.XXXXXX")" COVERAGE_FILE="$coverage_dir/.coverage" uv run --frozen pytest -q \ -m 'not integration and not e2e and not kind' \ --cov=capi_provider_ssh --cov-branch --cov-report=term-missing \ --cov-report="json:$coverage_dir/coverage.json" ``` -------------------------------- ### Inspect management cluster state Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/installation.md Verify the management cluster status using an explicitly selected kubeconfig before applying changes. ```bash : "${MANAGEMENT_KUBECONFIG:?set the reviewed management kubeconfig}" kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" version kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" get nodes kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" get clusters,machines -A ``` -------------------------------- ### Patch SSHHost and SSHMachine resources Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/ssh-key-lifecycle.md Imperative commands to update the SSH key reference for a specific SSHHost or SSHMachine during a canary rotation. ```bash # Switch one SSHHost kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" -n "$NAMESPACE" patch sshhost host-a --type=merge \ -p '{"spec":{"sshKeyRef":{"name":"ssh-key-2026q1","key":"value"}}}' # Switch one SSHMachine kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" -n "$NAMESPACE" patch sshmachine cp-0 --type=merge \ -p '{"spec":{"sshKeyRef":{"name":"ssh-key-2026q1","key":"value"}}}' ``` -------------------------------- ### Pause Cluster via kubectl Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/operations.md Use this command to pause a cluster by patching its specification. This prevents the provider from performing further remote operations. ```bash kubectl --kubeconfig "$MANAGEMENT_KUBECONFIG" -n "$NAMESPACE" patch cluster "$CLUSTER" \ --type=merge -p '{"spec":{"paused":true}}' ``` -------------------------------- ### Configure sshHostKeyRef for SSH trust Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/operations.md Required at runtime on direct SSHMachines or selected SSHHosts to define the trust Secret containing verified OpenSSH known_hosts. ```yaml sshKeyRef: name: node-client-key sshHostKeyRef: name: node-verified-hosts key: known_hosts ``` -------------------------------- ### SSHMachine externalEtcd configuration Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/docs/external-etcd.md Defines an SSHMachine resource with an external etcd cluster configuration, including endpoints and certificate references. All referenced Secrets must exist in the same namespace as the SSHMachine. ```yaml apiVersion: infrastructure.alpininsight.ai/v1beta1 kind: SSHMachine metadata: name: cp-0 namespace: default spec: address: 10.0.0.20 port: 22 user: root sshKeyRef: name: ssh-key sshHostKeyRef: name: verified-ssh-hosts externalEtcd: endpoints: - https://10.0.0.10:2379 - https://10.0.0.11:2379 - https://10.0.0.12:2379 caCertRef: name: etcd-ca clientCertRef: name: etcd-client-cert clientKeyRef: name: etcd-client-key files: caFile: /etc/kubernetes/pki/etcd-external/ca.crt certFile: /etc/kubernetes/pki/etcd-external/client.crt keyFile: /etc/kubernetes/pki/etcd-external/client.key ``` -------------------------------- ### Kubernetes Secret structure for SSH keys Source: https://github.com/alpininsight/capi-provider-ssh/blob/main/python/deploy/examples/ssh-key-lifecycle/README.md The required shape for a Kubernetes Secret used by the provider. The provider reads the 'value' key by default, which must contain a base64-encoded private key. ```yaml apiVersion: v1 kind: Secret type: Opaque data: value: ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.