Deploy NIS2 Shield on Kubernetes for hospitals, municipalities, and large enterprises. Production-ready Helm chart with security hardening.
git clone https://github.com/nis2shield/infrastructure.git
cd infrastructure
helm install nis2shield ./charts/nis2shield \
--namespace nis2 \
--create-namespace
kubectl port-forward svc/nis2shield-webapp 8080:8000 -n nis2
# Visit http://localhost:8080
Create a values-prod.yaml file with your production settings:
# values-prod.yaml
webapp:
image:
repository: your-registry/nis2-app
tag: v1.0.0
replicaCount: 3
ingress:
enabled: true
className: nginx
hosts:
- host: app.yourdomain.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: app-tls
hosts:
- app.yourdomain.com
database:
persistence:
size: 50Gi
replicator:
enabled: true
dryRun: false
cloud:
apiUrl: https://backup.yourdomain.com/api
tokenSecret: cloud-backup-credentials
encryption:
publicKeySecret: encryption-keys
networkPolicies:
enabled: true
helm install nis2shield ./charts/nis2shield \
--namespace nis2-prod \
--create-namespace \
-f values-prod.yaml
The Helm chart implements Kubernetes security best practices for NIS2 compliance:
runAsNonRoot: truereadOnlyRootFilesystem: trueallowPrivilegeEscalation: falsecapabilities: drop: ALLseccompProfile: RuntimeDefaultautomountServiceAccountToken: falseEnable the Crypto-Replicator for zero-trust cloud backup. The cloud cannot decrypt your data.
# Generate keys (keep private key OFFLINE!)
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -pubout -out public.pem
# Create Kubernetes secret
kubectl create secret generic encryption-keys \
--from-file=public.pem=public.pem \
-n nis2-prod
kubectl create secret generic cloud-backup-credentials \
--from-literal=cloud-token=your-api-token \
-n nis2-prod
replicator:
enabled: true
dryRun: false # Important!
cloud:
apiUrl: https://your-backup-api.com
tokenSecret: cloud-backup-credentials
tokenKey: cloud-token
encryption:
publicKeySecret: encryption-keys
publicKeySecretKey: public.pem
keyId: prod-2024
Keep Private Key Safe!
Store private.pem in a secure offline
location (HSM, air-gapped system). You'll need it for disaster recovery.
For production, you may want to use a managed database like AWS RDS or Google Cloud SQL:
database:
enabled: true
external:
enabled: true
host: mydb.xxxxx.eu-west-1.rds.amazonaws.com
port: 5432
database: nis2_production
username: nis2admin
existingSecret: rds-credentials # Must contain 'password' key
# Create the secret first
kubectl create secret generic rds-credentials \
--from-literal=password=your-db-password \
-n nis2-prod
helm upgrade nis2shield ./charts/nis2shield \
-n nis2-prod \
-f values-prod.yaml
# List history
helm history nis2shield -n nis2-prod
# Rollback to previous version
helm rollback nis2shield 1 -n nis2-prod
# Get pods
kubectl get pods -n nis2-prod -l app.kubernetes.io/instance=nis2shield
# Check logs
kubectl logs -n nis2-prod -l app.kubernetes.io/component=webapp
# Describe deployment
kubectl describe deployment nis2shield-webapp -n nis2-prod
helm uninstall nis2shield -n nis2-prod
# Note: PVCs are not deleted automatically
kubectl delete pvc -n nis2-prod -l app.kubernetes.io/instance=nis2shield