Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chart): add daemonset and node selector (#537)
This adds the ability to run hccm as a `DaemonSet` like other cloud controller managers. There are also nodeSelectors as a new value to set where the DaemonSet (and deployment) should run. The default deployment kind of `Deployment` with 1 replica is not touched. The new configuration options are documented in the README file.
- Loading branch information
1 parent
8775196
commit a94384f
Showing
4 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{{- if eq $.Values.kind "DaemonSet" }} | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: {{ include "hcloud-cloud-controller-manager.name" . }} | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
{{- include "hcloud-cloud-controller-manager.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "hcloud-cloud-controller-manager.selectorLabels" . | nindent 8 }} | ||
spec: | ||
serviceAccountName: {{ include "hcloud-cloud-controller-manager.name" . }} | ||
dnsPolicy: Default | ||
tolerations: | ||
# Allow HCCM itself to schedule on nodes that have not yet been initialized by HCCM. | ||
- key: "node.cloudprovider.kubernetes.io/uninitialized" | ||
value: "true" | ||
effect: "NoSchedule" | ||
- key: "CriticalAddonsOnly" | ||
operator: "Exists" | ||
|
||
# Allow HCCM to schedule on control plane nodes. | ||
- key: "node-role.kubernetes.io/master" | ||
effect: NoSchedule | ||
operator: Exists | ||
- key: "node-role.kubernetes.io/control-plane" | ||
effect: NoSchedule | ||
operator: Exists | ||
|
||
- key: "node.kubernetes.io/not-ready" | ||
effect: "NoExecute" | ||
|
||
{{- if gt (len .Values.additionalTolerations) 0 }} | ||
{{ toYaml .Values.additionalTolerations | nindent 8 }} | ||
{{- end }} | ||
|
||
{{- if gt (len .Values.nodeSelector) 0 }} | ||
nodeSelector: | ||
{{ toYaml .Values.nodeSelector | nindent 8 }} | ||
{{- end }} | ||
|
||
{{- if $.Values.networking.enabled }} | ||
hostNetwork: true | ||
{{- end }} | ||
containers: | ||
- name: hcloud-cloud-controller-manager | ||
command: | ||
- "/bin/hcloud-cloud-controller-manager" | ||
{{- range $key, $value := $.Values.args }} | ||
{{- if not (eq $value nil) }} | ||
- "--{{ $key }}{{ if $value }}={{ $value }}{{ end }}" | ||
{{- end }} | ||
{{- end }} | ||
{{- if $.Values.networking.enabled }} | ||
- "--allocate-node-cidrs=true" | ||
- "--cluster-cidr={{ $.Values.networking.clusterCIDR }}" | ||
{{- end }} | ||
env: | ||
{{- range $key, $value := $.Values.env }} | ||
- name: {{ $key }} | ||
{{- tpl (toYaml $value) $ | nindent 14 }} | ||
{{- end }} | ||
{{- if $.Values.networking.enabled }} | ||
- name: HCLOUD_NETWORK | ||
{{- tpl (toYaml $.Values.networking.network) $ | nindent 14 }} | ||
{{- end }} | ||
{{- if not $.Values.monitoring.enabled }} | ||
- name: HCLOUD_METRICS_ENABLED | ||
value: "false" | ||
{{- end }} | ||
image: {{ $.Values.image.repository }}:{{ tpl $.Values.image.tag . }} # x-release-please-version | ||
ports: | ||
{{- if $.Values.monitoring.enabled }} | ||
- name: metrics | ||
containerPort: 8233 | ||
{{- end }} | ||
resources: | ||
{{- toYaml $.Values.resources | nindent 12 }} | ||
priorityClassName: system-cluster-critical | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters