Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions charts/headlamp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ config:
| clusterRoleBinding.create | bool | `true` | Create cluster role binding |
| clusterRoleBinding.clusterRoleName | string | `"cluster-admin"` | Kubernetes ClusterRole name |
| clusterRoleBinding.annotations | object | `{}` | Cluster role binding annotations |
| hostUsers | bool | `true` | Run in host uid namespace |
| podSecurityContext | object | `{}` | Pod security context (e.g., fsGroup: 2000) |
| securityContext.runAsNonRoot | bool | `true` | Run container as non-root |
| securityContext.privileged | bool | `false` | Run container in privileged mode |
Expand All @@ -159,6 +160,8 @@ config:
| securityContext.capabilities | object | `{}` | Container capabilities (e.g., drop: [ALL]) |
| securityContext.readOnlyRootFilesystem | bool | `false` | Mount root filesystem as read-only |

NOTE: for `hostUsers=false` user namespaces must be supported. See: https://kubernetes.io/docs/concepts/workloads/pods/user-namespaces/

### Storage Configuration

| Key | Type | Default | Description |
Expand Down
1 change: 1 addition & 0 deletions charts/headlamp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ spec:
{{- end }}
serviceAccountName: {{ include "headlamp.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
hostUsers: {{ .Values.hostUsers }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- with .Values.initContainers }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
1 change: 1 addition & 0 deletions charts/headlamp/tests/expected_templates/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
1 change: 1 addition & 0 deletions charts/headlamp/tests/expected_templates/extra-args.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
129 changes: 129 additions & 0 deletions charts/headlamp/tests/expected_templates/host-users-override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
# Source: headlamp/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: headlamp
namespace: default
labels:
helm.sh/chart: headlamp-0.39.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.39.0"
app.kubernetes.io/managed-by: Helm
---
# Source: headlamp/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: oidc
namespace: default
type: Opaque
data:
---
# Source: headlamp/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: headlamp-admin
labels:
helm.sh/chart: headlamp-0.39.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.39.0"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: headlamp
namespace: default
---
# Source: headlamp/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: headlamp
namespace: default
labels:
helm.sh/chart: headlamp-0.39.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.39.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP

ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
---
# Source: headlamp/templates/deployment.yaml
# This block of code is used to extract the values from the env.
# This is done to check if the values are non-empty and if they are, they are used in the deployment.yaml.

apiVersion: apps/v1
kind: Deployment
metadata:
name: headlamp
namespace: default
labels:
helm.sh/chart: headlamp-0.39.0
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
app.kubernetes.io/version: "0.39.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
template:
metadata:
labels:
app.kubernetes.io/name: headlamp
app.kubernetes.io/instance: headlamp
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: false
securityContext:
{}
containers:
- name: headlamp
securityContext:
privileged: false
runAsGroup: 101
runAsNonRoot: true
runAsUser: 100
image: "ghcr.io/headlamp-k8s/headlamp:v0.39.0"
imagePullPolicy: IfNotPresent

env:
args:
- "-in-cluster"
- "-in-cluster-context-name=main"
- "-plugins-dir=/headlamp/plugins"
# Check if externalSecret is disabled
ports:
- name: http
containerPort: 4466
protocol: TCP
livenessProbe:
httpGet:
path: "/"
port: http
readinessProbe:
httpGet:
path: "/"
port: http
resources:
{}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
1 change: 1 addition & 0 deletions charts/headlamp/tests/expected_templates/oidc-pkce.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
fsGroup: 2000
runAsGroup: 3000
Expand Down
1 change: 1 addition & 0 deletions charts/headlamp/tests/expected_templates/tls-added.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ spec:
spec:
serviceAccountName: headlamp
automountServiceAccountToken: true
hostUsers: true
securityContext:
{}
containers:
Expand Down
1 change: 1 addition & 0 deletions charts/headlamp/tests/test_cases/host-users-override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hostUsers: false
8 changes: 8 additions & 0 deletions charts/headlamp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ podAnnotations: {}
# -- Labels to add to the pod
podLabels: {}

# -- Controls user namespace isolation for the Headlamp pod.
# When true (default), the pod shares the host user namespace (user namespaces are DISABLED).
# When false, the pod uses a separate user namespace (user namespaces are ENABLED) for stronger isolation,
# if supported by the cluster. Set this to false if your cluster supports user namespaces and you want
# additional isolation; leave as true if user namespaces are not available.
# See: https://kubernetes.io/docs/concepts/workloads/pods/user-namespaces/
hostUsers: true

# -- Headlamp pod's Security Context
podSecurityContext:
{}
Expand Down
Loading