一键导入
nais
Nais-deployment, GCP-ressurser, pod-lifecycle og feilsøking på plattformen
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Nais-deployment, GCP-ressurser, pod-lifecycle og feilsøking på plattformen
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generer conventional commit-meldinger med Nav-relevante scopes og breaking change-format
Expert builder for the Aksel design system (Nav / @navikt) React components, design tokens, layout primitives, theming (light/dark), icons, CSS, the Tailwind preset, version migrations, and Figma-to-code. Trigger on any frontend UI task that mentions Aksel, Nav/Navikt, "designsystemet", or @navikt/ds-* / @navikt/aksel-* packages — or that asks to add, create, build, or refactor a component (button, input, modal, table, alert, card, form) or layout, or to implement a design from Figma (a pasted figma.com/design/...?node-id link, "implement this design", "build this from Figma", design-to-code). Strong signals "using/with aksel", "@navikt/ds-react", "design system", a pasted figma.com link. If the work is frontend UI and there is any Aksel signal, invoke this skill unless the user explicitly opts out.
Generer Architecture Decision Records (ADR) med flerperspektiv-review tilpasset Nav
Azure AD, TokenX, ID-porten, Maskinporten og JWT-validering for Nav-applikasjoner
Strukturert intervju som avdekker blindsoner i Nav-prosjekter — personvern, auth, avhengigheter og observerbarhet
Arkitekturplanlegging med beslutningstrær for auth, kommunikasjon, database og Nais-konfigurasjon
| name | nais |
| description | Nais-deployment, GCP-ressurser, pod-lifecycle og feilsøking på plattformen |
| license | MIT |
| compatibility | Application deployed on Nais (Kubernetes on GCP) |
| metadata | {"domain":"platform","tags":"nais kubernetes gcp deployment infrastructure troubleshooting"} |
Patterns and procedures for deploying, configuring, and troubleshooting applications on Nais (Kubernetes on GCP).
# Check pod status
kubectl get pods -n <namespace> -l app=<app-name>
# View pod logs
kubectl logs -n <namespace> -l app=<app-name> --tail=100
# Describe pod (events, errors)
kubectl describe pod -n <namespace> <pod-name>
# View Nais app status
kubectl get app -n <namespace> <app-name> -o yaml
# Restart deployment (rolling)
kubectl rollout restart deployment/<app-name> -n <namespace>
# Port-forward for local debugging
kubectl port-forward -n <namespace> svc/<app-name> 8080:80
Every Nais application requires:
apiVersion: nais.io/v1alpha1
kind: Application
metadata:
name: app-name
namespace: team-namespace
labels:
team: team-namespace
spec:
image: { { image } } # Replaced by CI/CD
port: 8080
# Observability (required)
prometheus:
enabled: true
path: /metrics
# Health checks (required)
liveness:
path: /isalive
initialDelay: 5
readiness:
path: /isready
initialDelay: 5
# Resources (required)
resources:
requests:
cpu: 50m
memory: 256Mi
limits:
memory: 512Mi
When Kubernetes terminates a pod on NAIS:
sleep 5 — gives LB time to stop routing new trafficterminationGracePeriodSeconds (default 30s): SIGKILLKey insight: Readiness probes are NOT involved in shutdown. Your app just needs to handle SIGTERM, finish in-flight requests, and exit cleanly.
Common anti-patterns:
false on SIGTERM — unnecessaryterminationGracePeriodSeconds too low — must be > 5s (preStop) + drain timepreStop hook with extra sleep — NAIS already injects sleep 5gcp:
sqlInstances:
- type: POSTGRES_15
databases:
- name: myapp-db
envVarPrefix: DB
Application receives: DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD
kafka:
pool: nav-dev # or nav-prod
azure:
application:
enabled: true
tenant: nav.no
tokenx:
enabled: true
accessPolicy:
inbound:
rules:
- application: calling-app
namespace: calling-namespace
outbound:
rules:
- application: downstream-app
namespace: downstream-namespace
ingresses:
- https://myapp.intern.dev.nav.no # Internal dev
- https://myapp.dev.nav.no # External dev
replicas:
min: 2
max: 4
cpuThresholdPercentage: 80
| Size | CPU request | Memory request | Memory limit |
|---|---|---|---|
| Small | 50m | 256Mi | 512Mi |
| Medium | 100m | 512Mi | 1Gi |
| Large | 200m | 1Gi | 2Gi |
Never set CPU limits — causes throttling. Use requests only.
kubectl logs -n namespace pod-namekubectl describe pod -n namespace pod-namekafka.pool is correct (nav-dev/nav-prod).nais/app.yaml manifest/isalive, /isready, /metrics).nais/app-prod.yaml)accessPolicy defaults to deny-all — you must explicitly allow trafficpreStop: sleep 5 — don't add your own{{ image }} in manifest is replaced by CI/CD — don't hardcode imagesapp-dev.yaml, app-prod.yaml) are the normaccessPolicy for network traffickubectl get app <name> -o yaml to verify deploymentaccessPolicy)