[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78D2B2G3S3VWCDF544J446G":3,"skill-same:01M78D2B2G3S3VWCDF544J446G":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M78D2B2G3S3VWCDF544J446G","kubernetes-deployment",null,"Use this skill for CLUSTER-LEVEL Kubernetes operations: Minikube\u002Fk3s lifecycle, GCP firewall rules, minikube tunnel debugging, and bootstrap-secret patterns. NOT for app-service Helm deploys or upgrade orchestration (use deployment) or Helm chart template authoring (use helm-chart-expert).","atretyak1985\u002Fswarmery","atretyak1985","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1436737?v=4","01M78CTSX57YH0EYY9YGH0TWKX","Andrii Tretiak","01M78CTSXRPJPYQ7GNPMP45TYX",8,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Fplugins\u002Finfra-pack\u002Fskills\u002Fkubernetes-deployment\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: kubernetes-deployment\ndescription: \"Use this skill for CLUSTER-LEVEL Kubernetes operations: Minikube\u002Fk3s lifecycle, GCP firewall rules, minikube tunnel debugging, and bootstrap-secret patterns. NOT for app-service Helm deploys or upgrade orchestration (use deployment) or Helm chart template authoring (use helm-chart-expert).\"\nversion: \"1.0.0\"\nowner: \"swarmery-infra\"\ndocs:\n  status: reviewed\n  source_sha: f43e8968c4b3\n  updated: 2026-08-06\n---\n\n# Purpose\n\nProvides cluster-level Kubernetes infrastructure operations for the platform, producing diagnostic reports or verified shell command sequences for Minikube\u002Fk3s cluster management, GCP firewall rules, minikube tunnel debugging, bootstrap-secret patterns, and NetworkPolicy configuration. This skill handles the infrastructure layer beneath Helm deploys; it defers Helm upgrade orchestration to `deployment` and chart template authoring to `helm-chart-expert`.\n\n# When to use this skill\n\n- Trigger A -- Managing Minikube (local), k3s (edge device), or staging (cloud VM + Minikube; project.json → cloud.envAlias) cluster infrastructure\n- Trigger B -- Creating or debugging GCP firewall rules for the staging VM\n- Trigger C -- Diagnosing minikube tunnel or ingress-nginx connectivity issues\n- Trigger D -- Running bootstrap-secret scripts before first deploy\n- Trigger E -- Configuring NetworkPolicy namespace selectors\n- Trigger F -- Diagnosing cluster\u002Fversions drift after a failed verify step\n\n# When NOT to use this skill\n\n- Anti-trigger A -- Helm upgrade orchestration (deploy-and-verify cycle) -> use `deployment` instead\n- Anti-trigger B -- Writing or debugging Helm chart templates or `_helpers.tpl` -> use `helm-chart-expert` instead\n- Anti-trigger C -- Building or pushing Docker images -> use `docker-build` instead\n- Anti-trigger D -- Configuring Keycloak realm, clients, or Auth.js -> use `keycloak` instead\n- Anti-trigger E -- Detecting IaC config drift -> use `infrastructure-as-code` instead\n- Anti-trigger F -- Checking migration safety -> use `migration-check` instead\n- Anti-trigger G -- Staging-environment operational recovery (SSH runbooks, secret rotation, VM troubleshooting) -> follow the project's environment runbooks\n- Anti-trigger H -- Promoting an image across environments (dev -> staging -> production) -> use `release-promotion` instead\n\n# Required environment\n\n- Runtime mount: `.claude\u002Fskills\u002Fkubernetes-deployment\u002FSKILL.md`\n- Tools \u002F libraries: `helm` (v3.10+), `kubectl` (v1.28+), `gcloud` CLI, `bash`\n- Scripts: the infrastructure repo's `files\u002FinitEnv.sh`, `files\u002FupdateEnv.sh`, and bootstrap-secret script (project.json → repos)\n- KUBECONFIG: `$REPO_ROOT\u002F\u003Cterraform-repo>\u002Fenvironments\u002F$ENV\u002F.minikube\u002Fremote-minikube-config.yaml` (for the staging cluster)\n- Reversibility profile: hard-to-reverse -- GCP firewall changes and cluster reconfiguration affect shared infrastructure; confirm before applying\n\n# Inputs\n\n- `operation: \"cluster-mgmt\" | \"firewall\" | \"tunnel-debug\" | \"bootstrap-secrets\" | \"networkpolicy\" | \"drift-check\"` -- the infrastructure operation needed\n- `environment: string` -- target environment (localdev, `\u003CenvAlias>`, prod)\n- `symptom: string` (optional) -- error message or behavior being debugged\n\n# Outputs\n\n- Format: shell command sequence with dry-run shown first, or ordered diagnostic steps with expected output\n- Length budget: max 80 lines for cluster management commands; max 120 lines for connectivity diagnosis\n- Output template:\n  ```\n  Operation: {operation} on {environment}\n  Cluster: {cluster-type} ({status})\n  Pre-flight: {pass | fail with details}\n  Commands: {numbered list of commands with expected output}\n  Verification: {verification command and expected result}\n  ```\n\n# Procedure\n\n1. **Identify environment and operation** -- Determine target cluster and what infrastructure operation is needed. Set KUBECONFIG and verify cluster connectivity. Checkpoint: `kubectl cluster-info` succeeds and returns the expected cluster URL.\n\n2. **Pre-flight checks** -- For bootstrap-secrets: verify which secrets exist using the bootstrap-secret probe pattern. For connectivity debugging: check minikube-tunnel status (`sudo systemctl status minikube-tunnel`). For firewall: list existing rules on the correct network. Checkpoint: Pre-flight data collected; current state documented before any changes.\n\n3. **Dry-run or read-only diagnosis first** -- For firewall rules: show the `gcloud compute firewall-rules create` command with `--dry-run` equivalent (describe what will be created). For tunnel issues: run diagnostic commands (`ss -tlnp`, `kubectl get svc -n ingress-nginx`). Always show what will change before changing it. Checkpoint: Operator has reviewed the planned change or diagnosis output.\n\n4. **Execute** -- Run the infrastructure operation. For cluster management: use `--wait --atomic --timeout` contract where Helm is involved. For firewall: always include `--network` flag explicitly. Checkpoint: Operation completed without error; `gcloud`\u002F`kubectl` exit code 0.\n\n5. **Verify** -- Check that the infrastructure change took effect. For firewall: `gcloud compute firewall-rules list` confirms the rule on the correct network. For tunnel: ports 80\u002F443 are bound. For bootstrap-secrets: `kubectl get secret` confirms presence. Checkpoint: Verification command confirms the expected state.\n\n# Self-check before returning\n\n- [ ] Every file cited has been read; no claim references an unopened file.\n- [ ] Output matches the format above.\n- [ ] Uncertain claims tagged `[LOW-CONFIDENCE]`.\n- [ ] No hardcoded paths or environment-specific values leaked.\n- [ ] Every `helm upgrade` I suggested shows `--dry-run` as a preceding step.\n- [ ] I used `$NAMESPACE` placeholder, not hardcoded namespace names.\n- [ ] I used `$GCP_PROJECT_ID` placeholder, not hardcoded GCP project IDs.\n- [ ] I used `$REPO_ROOT` or relative paths, not absolute developer home paths.\n- [ ] GCP firewall rules include explicit `--network` flag (not relying on default VPC).\n- [ ] NetworkPolicy selectors use `kubernetes.io\u002Fmetadata.name`, not custom `name:` labels.\n- [ ] I cited the specific pod\u002Fservice\u002Fdeployment status that led to my diagnosis.\n\n# Common mistakes to avoid\n\n- DO NOT create GCP firewall rules without `--network` flag -- gcloud silently defaults to the `default` VPC; the staging VM may be on a different network.\n- DO NOT use the minikube ingress addon -- it creates a NodePort service; use Helm-managed ingress-nginx with `type: LoadBalancer` for minikube tunnel to work.\n- DO NOT hardcode GCP project IDs in commands -- use `$GCP_PROJECT_ID`.\n- DO NOT hardcode absolute developer paths -- use `$REPO_ROOT` or relative paths.\n- DO NOT assume ingress-nginx ClusterIP is stable after Helm upgrade -- restart minikube-tunnel to clear stale SSH tunnel processes.\n- DO NOT skip `--atomic` on shared-cluster deploys -- without it, a failed upgrade leaves the cluster in a broken state.\n- DO NOT confuse this skill with `deployment` -- this skill handles infrastructure below the Helm upgrade; `deployment` handles the deploy-and-verify cycle.\n\n# Escalation\n\n- Stop and ask when: bootstrap secrets are missing and the user has not run the repo's bootstrap-secret script.\n- Stop and ask when: the KUBECONFIG cannot reach the cluster.\n- Stop and ask when: a rollback would target a digest two versions back (cluster\u002Fversions drift).\n- Stop and ask when: the user requests a destructive operation (`helm uninstall`, `kubectl delete namespace`).\n- Refuse and explain when: asked to create firewall rules that open all ports (0-65535) to `0.0.0.0\u002F0`.\n\n\u003Cexamples>\n\u003Cexample>\n\u003Cuser_task>Create a GCP firewall rule to allow HTTPS to the staging VM\u003C\u002Fuser_task>\n\u003Cprocedure_trace>\nStep 1: Identify — target is the staging environment, operation is firewall.\nStep 2: Pre-flight — list existing rules on minikube-network.\n  gcloud compute firewall-rules list --project=\"$GCP_PROJECT_ID\" \\\n    --format=\"table(name,network.basename(),allowed[].map().firewall_rule().list())\"\nStep 3: Dry-run — show planned command.\nStep 4: Execute:\n  gcloud compute firewall-rules create allow-https \\\n    --project=\"$GCP_PROJECT_ID\" \\\n    --network=minikube-network \\\n    --direction=INGRESS \\\n    --priority=1000 \\\n    --action=ALLOW \\\n    --rules=tcp:443 \\\n    --source-ranges=0.0.0.0\u002F0\nStep 5: Verify — list rules and confirm allow-https is on minikube-network.\n\u003C\u002Fprocedure_trace>\n\u003Coutput>\nOperation: firewall on staging\nCluster: Minikube on cloud VM (connected)\nPre-flight: No existing HTTPS rule on minikube-network\nCommands:\n  1. gcloud compute firewall-rules create allow-https --network=minikube-network ...\nVerification: gcloud compute firewall-rules list shows allow-https on minikube-network\n\u003C\u002Foutput>\n\u003C\u002Fexample>\n\n\u003Cexample>\n\u003Cuser_task>Bootstrap secrets are missing on a fresh staging cluster\u003C\u002Fuser_task>\n\u003Cprocedure_trace>\nStep 1: Identify — target is the staging environment, operation is bootstrap-secrets.\nStep 2: Pre-flight — run the bootstrap-secret probe:\n  ssh $SSH_OPTS \"$SSH_TARGET\" bash &lt;&lt;'PROBE_EOF'\n  MISSING=()\n  for s in \u003Capp>-auth-secret \u003Capp>-ws-api-secret \u003Capp>-maps-api-key; do\n    kubectl get secret \"$s\" -n \"$NAMESPACE\" >\u002Fdev\u002Fnull 2>&1 || MISSING+=(\"$s\")\n  done\n  if [ ${#MISSING[@]} -gt 0 ]; then\n    echo \"ERROR: missing bootstrap secrets: ${MISSING[*]}\" >&2\n    exit 10\n  fi\n  PROBE_EOF\n  # Result: 3 secrets missing\nStep 3: Show recovery plan.\nStep 4: Execute the bootstrap-secret script on the VM.\nStep 5: Verify all 3 secrets exist.\n\u003C\u002Fprocedure_trace>\n\u003Coutput>\nOperation: bootstrap-secrets on staging\nCluster: Minikube on cloud VM (connected)\nPre-flight: 3 secrets missing (\u003Capp>-auth-secret, \u003Capp>-ws-api-secret, \u003Capp>-maps-api-key)\nCommands:\n  1. Run the bootstrap-secret script with --maps-api-key from GCP Secret Manager\nVerification: kubectl get secret confirms all 3 secrets in the $NAMESPACE namespace\n\u003C\u002Foutput>\n\u003C\u002Fexample>\n\u003C\u002Fexamples>\n\n# Failure modes\n\n- Mode: GCP firewall on wrong network -- symptom: HTTPS times out even though rule exists -- detection: `gcloud compute firewall-rules list` shows rule on `default` not `minikube-network` -- action: recreate with explicit `--network=minikube-network`\n- Mode: Stale SSH tunnel after ingress upgrade -- symptom: ports 80\u002F443 unreachable after Helm upgrade -- detection: `sudo ss -tlnp | grep -E ':(80|443)'` shows old PID -- action: `sudo systemctl restart minikube-tunnel`\n- Mode: ingress-nginx is NodePort (not LoadBalancer) -- symptom: minikube tunnel does nothing for ports 80\u002F443 -- detection: `kubectl get svc -n ingress-nginx` shows type NodePort -- action: disable minikube addon, deploy ingress-nginx via Helm with `type: LoadBalancer`\n- Mode: Missing bootstrap secrets -- symptom: deploy fails with `envsubst` producing empty values -- detection: `kubectl get secret \u003Cname> -n $NAMESPACE` returns NotFound -- action: run the repo's bootstrap-secret script on the VM\n- Mode: Cluster\u002Fversions drift after failed verify -- symptom: cluster state does not match the version-pinning repo's `current_digest` -- detection: SSH to cluster, read Deployment image digest, compare to `current_digest` -- action: `helm rollback \u003Crelease> -n $NAMESPACE` (reverts one helm revision), then rerun the rollback pipeline\n\n# Related skills\n\n- `deployment` -- defer to deployment for Helm upgrade orchestration (the deploy-and-verify cycle); compose when a cluster issue blocks a deploy\n- `helm-chart-expert` -- defer to it for chart template authoring; compose when a deployment issue traces back to a template bug\n- `infrastructure-as-code` -- defer to it for IaC drift detection; compose when a manual kubectl fix needs to be captured in code\n- `keycloak` -- defer to it for Keycloak realm\u002Fclient config; compose when Keycloak pod issues involve ingress or firewall\n- `docker-build` -- defer to it for image builds; this skill only consumes image tags\u002Fdigests\n- `release-promotion` -- defer to it for cross-environment promotion; compose when a drift check reveals promotion state mismatch\n- `gitops-promotion` -- defer to it for GitOps pull-based reconciliation patterns\n\n# How to use\n\n## What it does\n\nThis skill handles the Kubernetes layer underneath your Helm deploys: bringing local, edge, or cloud clusters up and keeping them reachable. It covers cluster lifecycle, cloud firewall rules for the cluster VM, tunnel and ingress connectivity debugging, bootstrap-secret checks, NetworkPolicy selectors, and version-drift diagnosis. You get a read-only diagnosis or a reviewed command sequence — never a silent change to shared infrastructure.\n\n## When to use it\n\n- Traffic to a cluster VM is blocked and you suspect a missing or misplaced firewall rule.\n- Ports 80\u002F443 stop responding after an ingress upgrade and you need to trace the tunnel.\n- A first deploy into a fresh cluster fails because bootstrap secrets were never created.\n- Cluster state no longer matches the pinned image digest and you need to find the drift.\n\n## When not to use it\n\n- Running the Helm upgrade-and-verify cycle — use the `deployment` skill.\n- Writing or fixing chart templates and `_helpers.tpl` — use `helm-chart-expert`.\n- Building or pushing container images — use `docker-build`.\n- Moving an image from one environment to the next — use `release-promotion`.\n\n## How to invoke\n\n```\nSkill(skill: \"infra-pack:kubernetes-deployment\")\n```\n\nInvoke it, then state the operation, the target environment, and the symptom you are seeing.\n\n## Inputs\n\n- `operation` — one of `cluster-mgmt`, `firewall`, `tunnel-debug`, `bootstrap-secrets`, `networkpolicy`, `drift-check` — required.\n- `environment` — the target environment, for example `localdev` or `\u003CenvAlias>` — required.\n- `symptom` — the error message or the behavior you are debugging — optional.\n\n## What you get back\n\nA short report: the operation and cluster status, a pre-flight result, a numbered list of commands with the output each should produce, and one verification command. Cluster commands stay under 80 lines; connectivity diagnosis under 120. Nothing destructive runs without asking you first, and every proposed change is shown before it is applied.\n\n## Worked example\n\n```\nSkill(skill: \"infra-pack:kubernetes-deployment\")\n\"HTTPS to the cluster VM times out in \u003CenvAlias>. Open port 443.\"\n\n→ Pre-flight lists existing rules and finds no HTTPS rule on the cluster network.\n→ You review the create command, with an explicit --network flag, before it runs.\n→ Verification: the rules list shows the new rule on the correct network, not the default VPC.\n```\n\n## Related\n\n- `deployment` — prefer it when the Helm release itself is what you are changing.\n- `helm-chart-expert` — prefer it when the failure traces back to a chart template.\n- `infrastructure-as-code` — prefer it to capture a manual cluster fix back into code.\n- `keycloak` — prefer it for identity config; compose the two when an auth pod fails on ingress.\n","# Purpose\n\nProvides cluster-level Kubernetes infrastructure operations for the platform, producing diagnostic reports or verified shell command sequences for Minikube\u002Fk3s cluster management, GCP firewall rules, minikube tunnel debugging, bootstrap-secret patterns, and NetworkPolicy configuration. This skill handles the infrastructure layer beneath Helm deploys; it defers Helm upgrade orchestration to `deployment` and chart template authoring to `helm-chart-expert`.\n\n# When to use this skill\n\n- Trigger A -- Managing Minikube (local), k3s (edge device), or staging (cloud VM + Minikube; project.json → cloud.envAlias) cluster infrastructure\n- Trigger B -- Creating or debugging GCP firewall rules for the staging VM\n- Trigger C -- Diagnosing minikube tunnel or ingress-nginx connectivity issues\n- Trigger D -- Running bootstrap-secret scripts before first deploy\n- Trigger E -- Configuring NetworkPolicy namespace selectors\n- Trigger F -- Diagnosing cluster\u002Fversions drift after a failed verify step\n\n# When NOT to use this skill\n\n- Anti-trigger A -- Helm upgrade orchestration (deploy-and-verify cycle) -> use `deployment` instead\n- Anti-trigger B -- Writing or debugging Helm chart templates or `_helpers.tpl` -> use `helm-chart-expert` instead\n- Anti-trigger C -- Building or pushing Docker images -> use `docker-build` instead\n- Anti-trigger D -- Configuring Keycloak realm, clients, or Auth.js -> use `keycloak` instead\n- Anti-trigger E -- Detecting IaC config drift -> use `infrastructure-as-code` instead\n- Anti-trigger F -- Checking migration safety -> use `migration-check` instead\n- Anti-trigger G -- Staging-environment operational recovery (SSH runbooks, secret rotation, VM troubleshooting) -> follow the project's environment runbooks\n- Anti-trigger H -- Promoting an image across environments (dev -> staging -> production) -> use `release-promotion` instead\n\n# Required environment\n\n- Runtime mount: `.claude\u002Fskills\u002Fkubernetes-deployment\u002FSKILL.md`\n- Tools \u002F libraries: `helm` (v3.10+), `kubectl` (v1.28+), `gcloud` CLI, `bash`\n- Scripts: the infrastructure repo's `files\u002FinitEnv.sh`, `files\u002FupdateEnv.sh`, and bootstrap-secret script (project.json → repos)\n- KUBECONFIG: `$REPO_ROOT\u002F\u003Cterraform-repo>\u002Fenvironments\u002F$ENV\u002F.minikube\u002Fremote-minikube-config.yaml` (for the staging cluster)\n- Reversibility profile: hard-to-reverse -- GCP firewall changes and cluster reconfiguration affect shared infrastructure; confirm before applying\n\n# Inputs\n\n- `operation: \"cluster-mgmt\" | \"firewall\" | \"tunnel-debug\" | \"bootstrap-secrets\" | \"networkpolicy\" | \"drift-check\"` -- the infrastructure operation needed\n- `environment: string` -- target environment (localdev, `\u003CenvAlias>`, prod)\n- `symptom: string` (optional) -- error message or behavior being debugged\n\n# Outputs\n\n- Format: shell command sequence with dry-run shown first, or ordered diagnostic steps with expected output\n- Length budget: max 80 lines for cluster management commands; max 120 lines for connectivity diagnosis\n- Output template:\n  ```\n  Operation: {operation} on {environment}\n  Cluster: {cluster-type} ({status})\n  Pre-flight: {pass | fail with details}\n  Commands: {numbered list of commands with expected output}\n  Verification: {verification command and expected result}\n  ```\n\n# Procedure\n\n1. **Identify environment and operation** -- Determine target cluster and what infrastructure operation is needed. Set KUBECONFIG and verify cluster connectivity. Checkpoint: `kubectl cluster-info` succeeds and returns the expected cluster URL.\n\n2. **Pre-flight checks** -- For bootstrap-secrets: verify which secrets exist using the bootstrap-secret probe pattern. For connectivity debugging: check minikube-tunnel status (`sudo systemctl status minikube-tunnel`). For firewall: list existing rules on the correct network. Checkpoint: Pre-flight data collected; current state documented before any changes.\n\n3. **Dry-run or read-only diagnosis first** -- For firewall rules: show the `gcloud compute firewall-rules create` command with `--dry-run` equivalent (describe what will be created). For tunnel issues: run diagnostic commands (`ss -tlnp`, `kubectl get svc -n ingress-nginx`). Always show what will change before changing it. Checkpoint: Operator has reviewed the planned change or diagnosis output.\n\n4. **Execute** -- Run the infrastructure operation. For cluster management: use `--wait --atomic --timeout` contract where Helm is involved. For firewall: always include `--network` flag explicitly. Checkpoint: Operation completed without error; `gcloud`\u002F`kubectl` exit code 0.\n\n5. **Verify** -- Check that the infrastructure change took effect. For firewall: `gcloud compute firewall-rules list` confirms the rule on the correct network. For tunnel: ports 80\u002F443 are bound. For bootstrap-secrets: `kubectl get secret` confirms presence. Checkpoint: Verification command confirms the expected state.\n\n# Self-check before returning\n\n- [ ] Every file cited has been read; no claim references an unopened file.\n- [ ] Output matches the format above.\n- [ ] Uncertain claims tagged `[LOW-CONFIDENCE]`.\n- [ ] No hardcoded paths or environment-specific values leaked.\n- [ ] Every `helm upgrade` I suggested shows `--dry-run` as a preceding step.\n- [ ] I used `$NAMESPACE` placeholder, not hardcoded namespace names.\n- [ ] I used `$GCP_PROJECT_ID` placeholder, not hardcoded GCP project IDs.\n- [ ] I used `$REPO_ROOT` or relative paths, not absolute developer home paths.\n- [ ] GCP firewall rules include explicit `--network` flag (not relying on default VPC).\n- [ ] NetworkPolicy selectors use `kubernetes.io\u002Fmetadata.name`, not custom `name:` labels.\n- [ ] I cited the specific pod\u002Fservice\u002Fdeployment status that led to my diagnosis.\n\n# Common mistakes to avoid\n\n- DO NOT create GCP firewall rules without `--network` flag -- gcloud silently defaults to the `default` VPC; the staging VM may be on a different network.\n- DO NOT use the minikube ingress addon -- it creates a NodePort service; use Helm-managed ingress-nginx with `type: LoadBalancer` for minikube tunnel to work.\n- DO NOT hardcode GCP project IDs in commands -- use `$GCP_PROJECT_ID`.\n- DO NOT hardcode absolute developer paths -- use `$REPO_ROOT` or relative paths.\n- DO NOT assume ingress-nginx ClusterIP is stable after Helm upgrade -- restart minikube-tunnel to clear stale SSH tunnel processes.\n- DO NOT skip `--atomic` on shared-cluster deploys -- without it, a failed upgrade leaves the cluster in a broken state.\n- DO NOT confuse this skill with `deployment` -- this skill handles infrastructure below the Helm upgrade; `deployment` handles the deploy-and-verify cycle.\n\n# Escalation\n\n- Stop and ask when: bootstrap secrets are missing and the user has not run the repo's bootstrap-secret script.\n- Stop and ask when: the KUBECONFIG cannot reach the cluster.\n- Stop and ask when: a rollback would target a digest two versions back (cluster\u002Fversions drift).\n- Stop and ask when: the user requests a destructive operation (`helm uninstall`, `kubectl delete namespace`).\n- Refuse and explain when: asked to create firewall rules that open all ports (0-65535) to `0.0.0.0\u002F0`.\n\n\u003Cexamples>\n\u003Cexample>\n\u003Cuser_task>Create a GCP firewall rule to allow HTTPS to the staging VM\u003C\u002Fuser_task>\n\u003Cprocedure_trace>\nStep 1: Identify — target is the staging environment, operation is firewall.\nStep 2: Pre-flight — list existing rules on minikube-network.\n  gcloud compute firewall-rules list --project=\"$GCP_PROJECT_ID\" \\\n    --format=\"table(name,network.basename(),allowed[].map().firewall_rule().list())\"\nStep 3: Dry-run — show planned command.\nStep 4: Execute:\n  gcloud compute firewall-rules create allow-https \\\n    --project=\"$GCP_PROJECT_ID\" \\\n    --network=minikube-network \\\n    --direction=INGRESS \\\n    --priority=1000 \\\n    --action=ALLOW \\\n    --rules=tcp:443 \\\n    --source-ranges=0.0.0.0\u002F0\nStep 5: Verify — list rules and confirm allow-https is on minikube-network.\n\u003C\u002Fprocedure_trace>\n\u003Coutput>\nOperation: firewall on staging\nCluster: Minikube on cloud VM (connected)\nPre-flight: No existing HTTPS rule on minikube-network\nCommands:\n  1. gcloud compute firewall-rules create allow-https --network=minikube-network ...\nVerification: gcloud compute firewall-rules list shows allow-https on minikube-network\n\u003C\u002Foutput>\n\u003C\u002Fexample>\n\n\u003Cexample>\n\u003Cuser_task>Bootstrap secrets are missing on a fresh staging cluster\u003C\u002Fuser_task>\n\u003Cprocedure_trace>\nStep 1: Identify — target is the staging environment, operation is bootstrap-secrets.\nStep 2: Pre-flight — run the bootstrap-secret probe:\n  ssh $SSH_OPTS \"$SSH_TARGET\" bash &lt;&lt;'PROBE_EOF'\n  MISSING=()\n  for s in \u003Capp>-auth-secret \u003Capp>-ws-api-secret \u003Capp>-maps-api-key; do\n    kubectl get secret \"$s\" -n \"$NAMESPACE\" >\u002Fdev\u002Fnull 2>&1 || MISSING+=(\"$s\")\n  done\n  if [ ${#MISSING[@]} -gt 0 ]; then\n    echo \"ERROR: missing bootstrap secrets: ${MISSING[*]}\" >&2\n    exit 10\n  fi\n  PROBE_EOF\n  # Result: 3 secrets missing\nStep 3: Show recovery plan.\nStep 4: Execute the bootstrap-secret script on the VM.\nStep 5: Verify all 3 secrets exist.\n\u003C\u002Fprocedure_trace>\n\u003Coutput>\nOperation: bootstrap-secrets on staging\nCluster: Minikube on cloud VM (connected)\nPre-flight: 3 secrets missing (\u003Capp>-auth-secret, \u003Capp>-ws-api-secret, \u003Capp>-maps-api-key)\nCommands:\n  1. Run the bootstrap-secret script with --maps-api-key from GCP Secret Manager\nVerification: kubectl get secret confirms all 3 secrets in the $NAMESPACE namespace\n\u003C\u002Foutput>\n\u003C\u002Fexample>\n\u003C\u002Fexamples>\n\n# Failure modes\n\n- Mode: GCP firewall on wrong network -- symptom: HTTPS times out even though rule exists -- detection: `gcloud compute firewall-rules list` shows rule on `default` not `minikube-network` -- action: recreate with explicit `--network=minikube-network`\n- Mode: Stale SSH tunnel after ingress upgrade -- symptom: ports 80\u002F443 unreachable after Helm upgrade -- detection: `sudo ss -tlnp | grep -E ':(80|443)'` shows old PID -- action: `sudo systemctl restart minikube-tunnel`\n- Mode: ingress-nginx is NodePort (not LoadBalancer) -- symptom: minikube tunnel does nothing for ports 80\u002F443 -- detection: `kubectl get svc -n ingress-nginx` shows type NodePort -- action: disable minikube addon, deploy ingress-nginx via Helm with `type: LoadBalancer`\n- Mode: Missing bootstrap secrets -- symptom: deploy fails with `envsubst` producing empty values -- detection: `kubectl get secret \u003Cname> -n $NAMESPACE` returns NotFound -- action: run the repo's bootstrap-secret script on the VM\n- Mode: Cluster\u002Fversions drift after failed verify -- symptom: cluster state does not match the version-pinning repo's `current_digest` -- detection: SSH to cluster, read Deployment image digest, compare to `current_digest` -- action: `helm rollback \u003Crelease> -n $NAMESPACE` (reverts one helm revision), then rerun the rollback pipeline\n\n# Related skills\n\n- `deployment` -- defer to deployment for Helm upgrade orchestration (the deploy-and-verify cycle); compose when a cluster issue blocks a deploy\n- `helm-chart-expert` -- defer to it for chart template authoring; compose when a deployment issue traces back to a template bug\n- `infrastructure-as-code` -- defer to it for IaC drift detection; compose when a manual kubectl fix needs to be captured in code\n- `keycloak` -- defer to it for Keycloak realm\u002Fclient config; compose when Keycloak pod issues involve ingress or firewall\n- `docker-build` -- defer to it for image builds; this skill only consumes image tags\u002Fdigests\n- `release-promotion` -- defer to it for cross-environment promotion; compose when a drift check reveals promotion state mismatch\n- `gitops-promotion` -- defer to it for GitOps pull-based reconciliation patterns\n\n# How to use\n\n## What it does\n\nThis skill handles the Kubernetes layer underneath your Helm deploys: bringing local, edge, or cloud clusters up and keeping them reachable. It covers cluster lifecycle, cloud firewall rules for the cluster VM, tunnel and ingress connectivity debugging, bootstrap-secret checks, NetworkPolicy selectors, and version-drift diagnosis. You get a read-only diagnosis or a reviewed command sequence — never a silent change to shared infrastructure.\n\n## When to use it\n\n- Traffic to a cluster VM is blocked and you suspect a missing or misplaced firewall rule.\n- Ports 80\u002F443 stop responding after an ingress upgrade and you need to trace the tunnel.\n- A first deploy into a fresh cluster fails because bootstrap secrets were never created.\n- Cluster state no longer matches the pinned image digest and you need to find the drift.\n\n## When not to use it\n\n- Running the Helm upgrade-and-verify cycle — use the `deployment` skill.\n- Writing or fixing chart templates and `_helpers.tpl` — use `helm-chart-expert`.\n- Building or pushing container images — use `docker-build`.\n- Moving an image from one environment to the next — use `release-promotion`.\n\n## How to invoke\n\n```\nSkill(skill: \"infra-pack:kubernetes-deployment\")\n```\n\nInvoke it, then state the operation, the target environment, and the symptom you are seeing.\n\n## Inputs\n\n- `operation` — one of `cluster-mgmt`, `firewall`, `tunnel-debug`, `bootstrap-secrets`, `networkpolicy`, `drift-check` — required.\n- `environment` — the target environment, for example `localdev` or `\u003CenvAlias>` — required.\n- `symptom` — the error message or the behavior you are debugging — optional.\n\n## What you get back\n\nA short report: the operation and cluster status, a pre-flight result, a numbered list of commands with the output each should produce, and one verification command. Cluster commands stay under 80 lines; connectivity diagnosis under 120. Nothing destructive runs without asking you first, and every proposed change is shown before it is applied.\n\n## Worked example\n\n```\nSkill(skill: \"infra-pack:kubernetes-deployment\")\n\"HTTPS to the cluster VM times out in \u003CenvAlias>. Open port 443.\"\n\n→ Pre-flight lists existing rules and finds no HTTPS rule on the cluster network.\n→ You review the create command, with an explicit --network flag, before it runs.\n→ Verification: the rules list shows the new rule on the correct network, not the default VPC.\n```\n\n## Related\n\n- `deployment` — prefer it when the Helm release itself is what you are changing.\n- `helm-chart-expert` — prefer it when the failure traces back to a chart template.\n- `infrastructure-as-code` — prefer it to capture a manual cluster fix back into code.\n- `keycloak` — prefer it for identity config; compose the two when an auth pod fails on ingress.\n",{"docs":24,"name":5,"owner":28,"version":29,"description":7},{"status":25,"updated":26,"source_sha":27},"reviewed",1785974400000,"f43e8968c4b3","swarmery-infra","1.0.0","main","2d9e918cc79c9b17b59356780ff0a3da38a3e98a","plugins\u002Finfra-pack\u002Fskills\u002Fkubernetes-deployment",5,"https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery","https:\u002F\u002Fatretyak1985.github.io\u002Fswarmery\u002F","https:\u002F\u002Fgithub.com\u002Fatretyak1985","2026-11-11 04:29:12",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add atretyak1985\u002Fswarmery --skill kubernetes-deployment",{"tool":44,"command":45},"bunx","bunx skills add atretyak1985\u002Fswarmery --skill kubernetes-deployment",{"tool":47,"command":48},"pnpm","pnpm dlx skills add atretyak1985\u002Fswarmery --skill kubernetes-deployment","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Fplugins\u002Finfra-pack\u002Fskills\u002Fkubernetes-deployment\u002FSKILL.md",true,[],[53,60,66,73,80,87],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M78D4T1FFWFW19Z44AHH5BSY","short-desc","Too short.","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fshort-desc\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M78D4S0TWT42WXFJHC1DBN0R","no-frontmatter","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fno-frontmatter\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M78D4Q14P8DJ4W78N62F3EG2","global-skill","Fixture global skill (minimal user-scope shape, format doc §2.3).","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fglobal-skill\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M78D4N1JHGQJQ7EZ43KY5SV3","documented-skill","Fixture skill whose usage guide deliberately omits the Worked example subsection.","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fskills\u002Fdocumented-skill\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M78D4KVNZ03GBKGDFJZWW5FJ","z","NOT auto-discovered — only skills\u002F is scanned for plugins (§2.2).","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fplugins\u002Fcache\u002Fmkt\u002Ftoolpack\u002F1.0.0\u002Fworkflow-skills\u002Fz\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M78D4JMBRZWK51HFE5RZJGHC","y","Plugin skill y from toolpack — stored as \"toolpack:y\".","https:\u002F\u002Fgithub.com\u002Fatretyak1985\u002Fswarmery\u002Fblob\u002Fmain\u002Ftools\u002Fswarmery\u002Ftestdata\u002Fsysconfig\u002Fclaude\u002Fplugins\u002Fcache\u002Fmkt\u002Ftoolpack\u002F1.0.0\u002Fskills\u002Fy\u002FSKILL.md",[],[]]