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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ repos:
require_serial: false
additional_dependencies: [prettier@3.9.4]
files: \.(md|ya?ml)$
exclude: ^(CHANGELOG.md|chart/templates/.*|chart/.snapshots/.*|docs/reference/load_balancer_.*\.md|)$
exclude: ^(CHANGELOG.md|chart/templates/.*|chart/.snapshots/.*|deploy/.*|docs/reference/load_balancer_.*\.md|)$

- repo: local
hooks:
Expand Down
12 changes: 12 additions & 0 deletions chart/.snapshots/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ spec:
app.kubernetes.io/name: 'hcloud-cloud-controller-manager'
spec:
serviceAccountName: hcloud-cloud-controller-manager
securityContext:
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
seccompProfile:
type: RuntimeDefault
dnsPolicy: Default
tolerations:
# Allow HCCM itself to schedule on nodes that have not yet been initialized by HCCM.
Expand All @@ -128,6 +134,12 @@ spec:
effect: "NoExecute"
containers:
- name: hcloud-cloud-controller-manager
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
args:
- "--allow-untagged-cloud"
- "--cloud-provider=hcloud"
Expand Down
12 changes: 12 additions & 0 deletions chart/.snapshots/full.daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ spec:
pod-annotation: pod-annotation
spec:
serviceAccountName: hcloud-cloud-controller-manager
securityContext:
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
seccompProfile:
type: RuntimeDefault
dnsPolicy: Default
tolerations:
# Allow HCCM itself to schedule on nodes that have not yet been initialized by HCCM.
Expand Down Expand Up @@ -137,6 +143,12 @@ spec:
foo: bar
containers:
- name: hcloud-cloud-controller-manager
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
command:
- "/bin/hcloud-cloud-controller-manager"
- "--allow-untagged-cloud"
Expand Down
8 changes: 8 additions & 0 deletions chart/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "hcloud-cloud-controller-manager.name" . }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
dnsPolicy: Default
tolerations:
# Allow HCCM itself to schedule on nodes that have not yet been initialized by HCCM.
Expand Down Expand Up @@ -60,6 +64,10 @@ spec:
{{- end }}
containers:
- name: hcloud-cloud-controller-manager
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
command:
- "/bin/hcloud-cloud-controller-manager"
{{- range $key, $value := $.Values.args }}
Expand Down
8 changes: 8 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "hcloud-cloud-controller-manager.name" . }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
dnsPolicy: {{ .Values.dnsPolicy }}
{{- with .Values.dnsConfig }}
dnsConfig:
Expand Down Expand Up @@ -74,6 +78,10 @@ spec:
{{- end }}
containers:
- name: hcloud-cloud-controller-manager
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
args:
{{- range $key, $value := $.Values.args }}
{{- if not (eq $value nil) }}
Expand Down
18 changes: 18 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,24 @@ resources:
cpu: 100m
memory: 50Mi

# Pod-level security context for the hccm Pod.
# See https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
podSecurityContext:
runAsNonRoot: true
runAsUser: 65532
runAsGroup: 65532
seccompProfile:
type: RuntimeDefault

# Container-level security context for the hccm container.
# See https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL

selectorLabels:
app.kubernetes.io/name: '{{ include "hcloud-cloud-controller-manager.name" $ }}'
app.kubernetes.io/instance: "{{ $.Release.Name }}"
Expand Down
12 changes: 12 additions & 0 deletions deploy/ccm-networks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ spec:
app: hcloud-cloud-controller-manager
spec:
serviceAccountName: hcloud-cloud-controller-manager
securityContext:
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
seccompProfile:
type: RuntimeDefault
dnsPolicy: Default
tolerations:
# Allow HCCM itself to schedule on nodes that have not yet been initialized by HCCM.
Expand All @@ -127,6 +133,12 @@ spec:
hostNetwork: true
containers:
- name: hcloud-cloud-controller-manager
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
args:
- "--allow-untagged-cloud"
- "--cloud-provider=hcloud"
Expand Down
12 changes: 12 additions & 0 deletions deploy/ccm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ spec:
app: hcloud-cloud-controller-manager
spec:
serviceAccountName: hcloud-cloud-controller-manager
securityContext:
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
seccompProfile:
type: RuntimeDefault
dnsPolicy: Default
tolerations:
# Allow HCCM itself to schedule on nodes that have not yet been initialized by HCCM.
Expand All @@ -126,6 +132,12 @@ spec:
effect: "NoExecute"
containers:
- name: hcloud-cloud-controller-manager
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
args:
- "--allow-untagged-cloud"
- "--cloud-provider=hcloud"
Expand Down
Loading