harden k3s workloads and ingress
This commit is contained in:
@@ -20,6 +20,9 @@ spec:
|
||||
app: n8n
|
||||
|
||||
spec:
|
||||
securityContext:
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: n8n
|
||||
image: docker.n8n.io/n8nio/n8n:2.32.7
|
||||
@@ -28,6 +31,12 @@ spec:
|
||||
ports:
|
||||
- containerPort: 5678
|
||||
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
|
||||
env:
|
||||
# ------------------------------------------------
|
||||
# n8n URL / reverse proxy
|
||||
|
||||
@@ -8,3 +8,4 @@ resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- ingress.yaml
|
||||
- network-policy.yaml
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-ingress-from-traefik-and-namespace
|
||||
namespace: n8n
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
- podSelector: {}
|
||||
@@ -14,11 +14,19 @@ spec:
|
||||
labels:
|
||||
app: n8n-postgres
|
||||
spec:
|
||||
securityContext:
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:17-alpine
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: n8n
|
||||
|
||||
@@ -11,3 +11,4 @@ resources:
|
||||
- nightscout-deployment.yaml
|
||||
- nightscout-service.yaml
|
||||
- nightscout-ingress.yaml
|
||||
- network-policy.yaml
|
||||
|
||||
@@ -15,12 +15,20 @@ spec:
|
||||
labels:
|
||||
app: mongodb
|
||||
spec:
|
||||
securityContext:
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: mongodb
|
||||
image: mongo:4.4
|
||||
ports:
|
||||
- containerPort: 27017
|
||||
name: mongo
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
volumeMounts:
|
||||
- name: mongo-data
|
||||
mountPath: /data/db
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-ingress-from-traefik-and-namespace
|
||||
namespace: nightscout
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
- podSelector: {}
|
||||
@@ -13,12 +13,20 @@ spec:
|
||||
labels:
|
||||
app: nightscout
|
||||
spec:
|
||||
securityContext:
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: nightscout
|
||||
image: nightscout/cgm-remote-monitor:latest
|
||||
ports:
|
||||
- containerPort: 1337
|
||||
name: http
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: nightscout-config
|
||||
|
||||
@@ -9,3 +9,4 @@ resources:
|
||||
- vaultwarden-service.yaml
|
||||
- vaultwarden-ingress.yaml
|
||||
- vaultwarden-admin.yaml
|
||||
- network-policy.yaml
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-ingress-from-traefik-and-namespace
|
||||
namespace: vaultwarden
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
- podSelector: {}
|
||||
@@ -16,6 +16,9 @@ spec:
|
||||
labels:
|
||||
app: vaultwarden
|
||||
spec:
|
||||
securityContext:
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: vaultwarden
|
||||
# Pinned deliberately: this migration should not also be an upgrade.
|
||||
@@ -23,6 +26,11 @@ spec:
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
env:
|
||||
- name: DOMAIN
|
||||
value: https://vault.aleshym.co
|
||||
|
||||
@@ -9,3 +9,4 @@ resources:
|
||||
- vikunja-deployment.yaml
|
||||
- vikunja-service.yaml
|
||||
- vikunja-ingress.yaml
|
||||
- network-policy.yaml
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: allow-ingress-from-traefik-and-namespace
|
||||
namespace: vikunja
|
||||
spec:
|
||||
podSelector: {}
|
||||
policyTypes:
|
||||
- Ingress
|
||||
ingress:
|
||||
- from:
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: kube-system
|
||||
- podSelector: {}
|
||||
@@ -26,12 +26,19 @@ spec:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: vikunja
|
||||
image: vikunja/vikunja:2.6.0
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 3456
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
env:
|
||||
- name: VIKUNJA_SERVICE_PUBLICURL
|
||||
value: https://vikunja.aleshym.co/
|
||||
|
||||
Reference in New Issue
Block a user