Skip to content

Commit

Permalink
Merge pull request #126 from adberger/master
Browse files Browse the repository at this point in the history
[vcluster]: fix nodeSelector overrides for all components, fix: make affinity for coredns configurable
  • Loading branch information
adberger committed Jan 4, 2024
2 parents cc98285 + 00438ec commit 55dc456
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 44 deletions.
4 changes: 2 additions & 2 deletions charts/vcluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: vcluster
description: Virtual Kubernetes Cluster
type: application
version: 0.5.2
version: 0.5.4
appVersion: 0.1.0
keywords:
- vcluster
Expand All @@ -15,5 +15,5 @@ maintainers:
email: sre@bedag.ch
dependencies:
- name: common
version: 2.2.4
version: 2.14.1
repository: https://charts.bitnami.com/bitnami
4 changes: 2 additions & 2 deletions charts/vcluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__This Chart is under active development! We try to improve documentation and values consistency over time__

![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.5.4](https://img.shields.io/badge/Version-0.5.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Virtual Kubernetes Cluster

Expand All @@ -18,7 +18,7 @@ Virtual Kubernetes Cluster

| Repository | Name | Version |
|------------|------|---------|
| https://charts.bitnami.com/bitnami | common | 2.2.4 |
| https://charts.bitnami.com/bitnami | common | 2.14.1 |

# Major Changes

Expand Down
17 changes: 5 additions & 12 deletions charts/vcluster/manifests/kubernetes/coredns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,15 @@ spec:
{{- end }}
priorityClassName: {{ $kubernetes.coredns.priorityClassName }}
serviceAccountName: coredns
{{- with $kubernetes.coredns.affinity }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values: ["kube-dns"]
topologyKey: kubernetes.io/hostname
{{- with $kubernetes.coredns.tolerations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $kubernetes.coredns.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $kubernetes.coredns.nodeSelector }}
{{- with $kubernetes.coredns.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ spec:
{{- include "autoscaler.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
annotations:
{{- include "pkg.components.pod_annotations" (dict "annotations" $manifest.podAnnotations "ctx" $) | nindent 8 }}
labels:
labels:
{{- include "pkg.components.pod_labels" (dict "labels" $manifest.podLabels "ctx" $) | nindent 8 }}
{{- include "autoscaler.selectorLabels" . | nindent 8 }}
spec:
Expand Down Expand Up @@ -89,7 +89,7 @@ spec:
{{- with $manifest.volumeMounts }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $manifest.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $manifest.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 8 }}
{{- end }}
{{- with (include "pkg.components.affinity" (dict "affinity" $manifest.affinity "ctx" $)) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
annotations:
{{- include "pkg.components.pod_annotations" (dict "annotations" $kubernetes.admin.podAnnotations "ctx" $) | nindent 8 }}
spec:
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $kubernetes.admin.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $kubernetes.admin.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 8 }}
{{- end }}
{{- with (include "pkg.components.tolerations" (dict "tolerations" $kubernetes.admin.tolerations "ctx" $)) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
checksum/config: {{ include (print $.Template.BasePath "/components/kubernetes/apiserver/config.yaml" ) . | sha256sum }}
{{- include "pkg.components.pod_annotations" (dict "annotations" $kubernetes.apiServer.podAnnotations "ctx" $) | nindent 8 }}
spec:
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $kubernetes.apiServer.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $kubernetes.apiServer.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 8 }}
{{- end }}
{{- with (include "pkg.components.tolerations" (dict "tolerations" $kubernetes.apiServer.tolerations "ctx" $)) }}
Expand Down Expand Up @@ -168,7 +168,7 @@ spec:
{{- end }}
{{- if (eq $kubernetes.konnectivity.server.mode "GRPC") }}
- mountPath: /run/konnectivity-server
name: konnectivity-uds
name: konnectivity-uds
{{- end }}
{{- end }}
{{- with $kubernetes.apiServer.volumeMounts }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
annotations:
{{- include "pkg.components.pod_annotations" (dict "annotations" $kubernetes.controllerManager.podAnnotations "ctx" $) | nindent 8 }}
spec:
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $kubernetes.controllerManager.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $kubernetes.controllerManager.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 8 }}
{{- end }}
{{- with (include "pkg.components.tolerations" (dict "tolerations" $kubernetes.controllerManager.tolerations "ctx" $)) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
annotations:
{{- include "pkg.components.pod_annotations" (dict "annotations" $kubernetes.etcd.backup.podAnnotations "ctx" $) | nindent 12 }}
spec:
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $kubernetes.etcd.backup.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $kubernetes.etcd.backup.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 10 }}
{{- end }}
{{- with (include "pkg.components.tolerations" (dict "tolerations" $kubernetes.etcd.backup.tolerations "ctx" $)) }}
Expand Down Expand Up @@ -96,7 +96,7 @@ spec:
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
env:
{{- if $kubernetes.etcd.backup.injectProxy }}
{{- include "pkg.common.env.w-proxy" $ | nindent 12 }}
{{- else }}
Expand All @@ -109,7 +109,7 @@ spec:
- name: ETCDCTL_CERT
value: /pki/etcd/peer/tls.crt
- name: ETCDCTL_KEY
value: /pki/etcd/peer/tls.key
value: /pki/etcd/peer/tls.key
- name: ETCDCTL_ENDPOINTS
value: {{ $fullName }}-etcd:{{ $kubernetes.etcd.ports.client }}
{{- with $kubernetes.etcd.backup.envs }}
Expand Down Expand Up @@ -151,7 +151,7 @@ spec:
secretName: {{ $fullName }}-pki-etcd-server
name: pki-etcd-certs-server
- name: snapshots
persistentVolumeClaim:
persistentVolumeClaim:
claimName: {{ $kubernetes.etcd.backup.persistence.existingClaim | default (printf "%s-etcd-backup" $fullName) }}
{{- with $kubernetes.etcd.backup.volumes }}
{{- toYaml . | nindent 10 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ $fullName }}-etcd
labels:
labels:
{{- include "kubernetes.labels" $ | nindent 4 }}
{{ include "pkg.common.labels.component" $ }}: {{ $component_name }}
{{- with (include "pkg.components.labels" (dict "labels" $kubernetes.etcd.labels "ctx" $)) }}
Expand Down Expand Up @@ -43,7 +43,7 @@ spec:
annotations:
{{- include "pkg.components.pod_annotations" (dict "annotations" $kubernetes.etcd.podAnnotations "ctx" $) | nindent 8 }}
spec:
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $kubernetes.etcd.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $kubernetes.etcd.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 8 }}
{{- end }}
{{- with (include "pkg.components.tolerations" (dict "tolerations" $kubernetes.etcd.tolerations "ctx" $)) }}
Expand Down Expand Up @@ -109,7 +109,7 @@ spec:
envFrom:
{{- toYaml . | nindent 8 }}
{{- end }}
env:
env:
{{- if $kubernetes.etcd.injectProxy }}
{{- include "pkg.common.env.w-proxy" $ | nindent 8 }}
{{- else }}
Expand Down Expand Up @@ -191,7 +191,7 @@ spec:
{{- end }}
{{- if and $kubernetes.etcd.backup.enabled $kubernetes.etcd.backup.persistence.mountOnETCD }}
- name: snapshots
persistentVolumeClaim:
persistentVolumeClaim:
claimName: {{ $kubernetes.etcd.backup.persistence.existingClaim | default (printf "%s-etcd-backup" $fullName) }}
{{- end }}
{{- with $kubernetes.etcd.volumes }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
annotations:
{{- include "pkg.components.pod_annotations" (dict "annotations" $kubernetes.konnectivity.server.podAnnotations "ctx" $) | nindent 8 }}
spec:
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $kubernetes.konnectivity.server.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $kubernetes.konnectivity.server.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 8 }}
{{- end }}
{{- with (include "pkg.components.tolerations" (dict "tolerations" $kubernetes.konnectivity.server.tolerations "ctx" $)) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
annotations:
{{- include "pkg.components.pod_annotations" (dict "annotations" $kubernetes.scheduler.podAnnotations "ctx" $) | nindent 8 }}
spec:
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $kubernetes.scheduler.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $kubernetes.scheduler.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 8 }}
{{- end }}
{{- with (include "pkg.components.tolerations" (dict "tolerations" $kubernetes.scheduler.tolerations "ctx" $)) }}
Expand Down Expand Up @@ -112,7 +112,7 @@ spec:
envFrom:
{{- toYaml . | nindent 8 }}
{{- end }}
env:
env:
{{- if $kubernetes.scheduler.injectProxy }}
{{- include "pkg.common.env.w-proxy" $ | nindent 8 }}
{{- else }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ spec:
{{- end }}
image: {{ include "pkg.images.registry.convert" (dict "image" .image "tag_overwrite" $machine.version "ctx" $) }}
imagePullPolicy: {{ include "pkg.images.registry.pullpolicy" (dict "policy" .image.pullPolicy "ctx" $) }}
env:
env:
{{- if .injectProxy }}
{{- include "pkg.common.env.w-proxy" $ | nindent 10 }}
{{- else }}
{{- include "pkg.common.env" $ | nindent 10 }}
{{- end }}
{{- end }}
{{- with .envs }}
{{- include "pkg.utils.envs" (dict "envs" . "ctx" $) | nindent 10 }}
{{- end }}
Expand Down Expand Up @@ -114,12 +114,12 @@ spec:
- name: webhook
image: {{ include "pkg.images.registry.convert" (dict "image" .image "tag_overwrite" $machine.version "ctx" $) }}
imagePullPolicy: {{ include "pkg.images.registry.pullpolicy" (dict "policy" .image.pullPolicy "ctx" $) }}
env:
env:
{{- if .injectProxy }}
{{- include "pkg.common.env.w-proxy" $ | nindent 10 }}
{{- else }}
{{- include "pkg.common.env" $ | nindent 10 }}
{{- end }}
{{- end }}
{{- with .envs }}
{{- include "pkg.utils.envs" (dict "envs" . "ctx" $) | nindent 10 }}
{{- end }}
Expand Down Expand Up @@ -162,7 +162,7 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $machine.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $machine.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 8 }}
{{- end }}
{{- with (include "pkg.components.affinity" (dict "affinity" $machine.affinity "ctx" $)) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ spec:
{{- end }}
image: {{ include "pkg.images.registry.convert" (dict "image" .image "tag_overwrite" $osm.version "ctx" $) }}
imagePullPolicy: {{ include "pkg.images.registry.pullpolicy" (dict "policy" .image.pullPolicy "ctx" $) }}
env:
env:
{{- if .injectProxy }}
{{- include "pkg.common.env.w-proxy" $ | nindent 10 }}
{{- else }}
{{- include "pkg.common.env" $ | nindent 10 }}
{{- end }}
{{- end }}
{{- with .envs }}
{{- include "pkg.utils.envs" (dict "envs" . "ctx" $) | nindent 10 }}
{{- end }}
Expand Down Expand Up @@ -157,7 +157,7 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $osm.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $osm.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 8 }}
{{- end }}
{{- with (include "pkg.components.affinity" (dict "affinity" $osm.affinity "ctx" $)) }}
Expand Down
4 changes: 2 additions & 2 deletions charts/vcluster/templates/lifecycle/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
annotations:
{{- include "pkg.components.pod_annotations" (dict "annotations" $manifest.podAnnotations "ctx" $) | nindent 8 }}
spec:
{{- with (include "pkg.components.nodeselector" (dict "nodeselector" $manifest.nodeSelector "ctx" $)) }}
{{- with (include "pkg.components.nodeselector" (dict "nodeSelector" $manifest.nodeSelector "ctx" $)) }}
nodeSelector: {{- . | nindent 8 }}
{{- end }}
{{- with (include "pkg.components.tolerations" (dict "tolerations" $manifest.tolerations "ctx" $)) }}
Expand Down Expand Up @@ -87,7 +87,7 @@ spec:
{{- include "pkg.common.env.w-proxy" $ | nindent 8 }}
{{- else }}
{{- include "pkg.common.env" $ | nindent 8 }}
{{- end }}
{{- end }}
{{- include "pkg.utils.xdg-env" $ | nindent 8 }}
- name: KUBECONFIG
value: "/etc/kubernetes/admin.conf"
Expand Down

0 comments on commit 55dc456

Please sign in to comment.