From 615671e660c9cb88feebe6c8ac2f736a8d9d045c Mon Sep 17 00:00:00 2001 From: SangJun Yun Date: Thu, 31 May 2018 19:50:31 +0900 Subject: [PATCH] Add nodeSelector, tolerations, affinity configuration to helm chart (#5059) --- contrib/helm/harbor/README.md | 22 ++++++++++++++++++- .../templates/adminserver/adminserver-ss.yaml | 12 ++++++++++ .../harbor/templates/clair/clair-dpl.yaml | 12 ++++++++++ .../templates/jobservice/jobservice-dpl.yaml | 12 ++++++++++ .../helm/harbor/templates/mysql/mysql-ss.yaml | 12 ++++++++++ .../templates/notary/notary-server.yaml | 12 ++++++++++ .../templates/registry/registry-ss.yaml | 12 ++++++++++ contrib/helm/harbor/templates/ui/ui-dpl.yaml | 12 ++++++++++ contrib/helm/harbor/values.yaml | 22 ++++++++++++++++++- 9 files changed, 126 insertions(+), 2 deletions(-) diff --git a/contrib/helm/harbor/README.md b/contrib/helm/harbor/README.md index 1e0d9c92a..cf0cdc6e0 100644 --- a/contrib/helm/harbor/README.md +++ b/contrib/helm/harbor/README.md @@ -141,6 +141,9 @@ The following tables lists the configurable parameters of the Harbor chart and t | `adminserver.ldap.verifyCert` | LDAP Verify HTTPS Certificate | `True` | | `adminserver.resources` | [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) to allocate for container | undefined | | `adminserver.volumes` | used to create PVCs if persistence is enabled (see instructions in values.yaml) | see values.yaml | +| `adminserver.nodeSelector` | Node labels for pod assignment | `{}` | +| `adminserver.tolerations` | Tolerations for pod assignment | `[]` | +| `adminserver.affinity` | Node/Pod affinities | `{}` | | **Jobservice** | | `jobservice.image.repository` | Repository for jobservice image | `vmware/harbor-jobservice` | | `jobservice.image.tag` | Tag for jobservice image | `v1.4.0` | @@ -148,6 +151,9 @@ The following tables lists the configurable parameters of the Harbor chart and t | `jobservice.key` | jobservice key | `not-a-secure-key` | | `jobservice.secret` | jobservice secret | `not-a-secure-secret` | | `jobservice.resources` | [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) to allocate for container | undefined | +| `jobservice.nodeSelector` | Node labels for pod assignment | `{}` | +| `jobservice.tolerations` | Tolerations for pod assignment | `[]` | +| `jobservice.affinity` | Node/Pod affinities | `{}` | | **UI** | | `ui.image.repository` | Repository for ui image | `vmware/harbor-ui` | | `ui.image.tag` | Tag for ui image | `v1.4.0` | @@ -156,6 +162,9 @@ The following tables lists the configurable parameters of the Harbor chart and t | `ui.secret` | ui secret | `not-a-secure-secret` | | `ui.privateKeyPem` | ui private key | see values.yaml | | `ui.resources` | [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) to allocate for container | undefined | +| `ui.nodeSelector` | Node labels for pod assignment | `{}` | +| `ui.tolerations` | Tolerations for pod assignment | `[]` | +| `ui.affinity` | Node/Pod affinities | `{}` | | **MySQL** | | `mysql.image.repository` | Repository for mysql image | `vmware/harbor-mysql` | | `mysql.image.tag` | Tag for mysql image | `v1.4.0` | @@ -167,6 +176,9 @@ The following tables lists the configurable parameters of the Harbor chart and t | `mysql.database` | MySQL Database | `registry` | | `mysql.resources` | [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) to allocate for container | undefined | | `mysql.volumes` | used to create PVCs if persistence is enabled (see instructions in values.yaml) | see values.yaml | +| `mysql.nodeSelector` | Node labels for pod assignment | `{}` | +| `mysql.tolerations` | Tolerations for pod assignment | `[]` | +| `mysql.affinity` | Node/Pod affinities | `{}` | | **Registry** | | `registry.image.repository` | Repository for registry image | `vmware/registry-photon` | | `registry.image.tag` | Tag for registry image | `v2.6.2-v1.4.0` | @@ -175,11 +187,17 @@ The following tables lists the configurable parameters of the Harbor chart and t | `registry.httpSecret` | registry secret | `not-a-secure-secret` | | `registry.resources` | [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) to allocate for container | undefined | | `registry.volumes` | used to create PVCs if persistence is enabled (see instructions in values.yaml) | see values.yaml | +| `registry.nodeSelector` | Node labels for pod assignment | `{}` | +| `registry.tolerations` | Tolerations for pod assignment | `[]` | +| `registry.affinity` | Node/Pod affinities | `{}` | | **Clair** | | `clair.enabled` | Enable Clair? | `true` | | `clair.image.repository` | Repository for clair image | `vmware/clair-photon` | | `clair.image.tag` | Tag for clair image | `v2.0.1-v1.4.0` | `clair.resources` | [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) to allocate for container | undefined +| `clair.nodeSelector` | Node labels for pod assignment | `{}` | +| `clair.tolerations` | Tolerations for pod assignment | `[]` | +| `clair.affinity` | Node/Pod affinities | `{}` | | `postgresql` | Overrides for postgresql chart [values.yaml](https://github.com/kubernetes/charts/blob/f2938a46e3ae8e2512ede1142465004094c3c333/stable/postgresql/values.yaml) | see values.yaml | **Notary** | | `notary.enabled` | Enable Notary? | `true` | @@ -190,7 +208,9 @@ The following tables lists the configurable parameters of the Harbor chart and t | `notary.db.image.repository` | Repository for notary database image | `vmware/mariadb-photon` | | `notary.db.image.tag` | Tag for notary database image | `v1.4.0` | `notary.db.password` | The password of users for notary database | Specify your own password | - +| `notary.nodeSelector` | Node labels for pod assignment | `{}` | +| `notary.tolerations` | Tolerations for pod assignment | `[]` | +| `notary.affinity` | Node/Pod affinities | `{}` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example: diff --git a/contrib/helm/harbor/templates/adminserver/adminserver-ss.yaml b/contrib/helm/harbor/templates/adminserver/adminserver-ss.yaml index 6815b20d9..cfe4d89b6 100644 --- a/contrib/helm/harbor/templates/adminserver/adminserver-ss.yaml +++ b/contrib/helm/harbor/templates/adminserver/adminserver-ss.yaml @@ -56,6 +56,18 @@ spec: items: - key: secretKey path: key + {{- with .Values.adminserver.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.adminserver.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.adminserver.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} {{- if .Values.persistence.enabled }} volumeClaimTemplates: - metadata: diff --git a/contrib/helm/harbor/templates/clair/clair-dpl.yaml b/contrib/helm/harbor/templates/clair/clair-dpl.yaml index ac6ac014b..02a79d5e6 100644 --- a/contrib/helm/harbor/templates/clair/clair-dpl.yaml +++ b/contrib/helm/harbor/templates/clair/clair-dpl.yaml @@ -38,4 +38,16 @@ spec: items: - key: config.yaml path: config.yaml + {{- with .Values.clair.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.clair.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.clair.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} {{ end }} diff --git a/contrib/helm/harbor/templates/jobservice/jobservice-dpl.yaml b/contrib/helm/harbor/templates/jobservice/jobservice-dpl.yaml index 44929fd43..e7755250b 100644 --- a/contrib/helm/harbor/templates/jobservice/jobservice-dpl.yaml +++ b/contrib/helm/harbor/templates/jobservice/jobservice-dpl.yaml @@ -45,3 +45,15 @@ spec: name: "{{ template "harbor.fullname" . }}-jobservice" - name: job-logs emptyDir: {} + {{- with .Values.jobservice.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.jobservice.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.jobservice.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} diff --git a/contrib/helm/harbor/templates/mysql/mysql-ss.yaml b/contrib/helm/harbor/templates/mysql/mysql-ss.yaml index 138ead2ee..6a06b92b8 100644 --- a/contrib/helm/harbor/templates/mysql/mysql-ss.yaml +++ b/contrib/helm/harbor/templates/mysql/mysql-ss.yaml @@ -38,6 +38,18 @@ spec: - name: "mysql-data" emptyDir: {} {{- end -}} + {{- with .Values.mysql.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.mysql.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.mysql.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} {{- if .Values.persistence.enabled }} volumeClaimTemplates: - metadata: diff --git a/contrib/helm/harbor/templates/notary/notary-server.yaml b/contrib/helm/harbor/templates/notary/notary-server.yaml index a1e078634..04227c72e 100644 --- a/contrib/helm/harbor/templates/notary/notary-server.yaml +++ b/contrib/helm/harbor/templates/notary/notary-server.yaml @@ -40,4 +40,16 @@ spec: - name: root-certificate secret: secretName: "{{ template "harbor.fullname" . }}-registry" + {{- with .Values.notary.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.notary.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.notary.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} {{ end }} diff --git a/contrib/helm/harbor/templates/registry/registry-ss.yaml b/contrib/helm/harbor/templates/registry/registry-ss.yaml index c3624ccf9..4cfd7fefc 100644 --- a/contrib/helm/harbor/templates/registry/registry-ss.yaml +++ b/contrib/helm/harbor/templates/registry/registry-ss.yaml @@ -52,6 +52,18 @@ spec: - name: registry-config configMap: name: "{{ template "harbor.fullname" . }}-registry" + {{- with .Values.registry.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.registry.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.registry.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} {{- if and (not .Values.registry.objectStorage) .Values.persistence.enabled }} volumeClaimTemplates: - metadata: diff --git a/contrib/helm/harbor/templates/ui/ui-dpl.yaml b/contrib/helm/harbor/templates/ui/ui-dpl.yaml index 8e5a533ac..437412926 100644 --- a/contrib/helm/harbor/templates/ui/ui-dpl.yaml +++ b/contrib/helm/harbor/templates/ui/ui-dpl.yaml @@ -74,3 +74,15 @@ spec: emptyDir: {} - name: psc emptyDir: {} + {{- with .Values.ui.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.ui.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.ui.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} diff --git a/contrib/helm/harbor/values.yaml b/contrib/helm/harbor/values.yaml index 73e0f249a..6bc6c3a80 100644 --- a/contrib/helm/harbor/values.yaml +++ b/contrib/helm/harbor/values.yaml @@ -89,6 +89,9 @@ adminserver: # requests: # memory: 256Mi # cpu: 100m + nodeSelector: {} + tolerations: [] + affinity: {} ## jobservice # @@ -103,6 +106,9 @@ jobservice: # requests: # memory: 256Mi # cpu: 100m + nodeSelector: {} + tolerations: [] + affinity: {} ## UI # @@ -168,6 +174,9 @@ ui: # requests: # memory: 256Mi # cpu: 100m + nodeSelector: {} + tolerations: [] + affinity: {} ## MySQL Settings. Currently Harbor does not support an external ## MySQL server, only their own image. Until this is fixed, do not @@ -193,6 +202,9 @@ mysql: # requests: # memory: 256Mi # cpu: 100m + nodeSelector: {} + tolerations: [] + affinity: {} registry: image: @@ -260,8 +272,10 @@ registry: #redis: # addr: "redis-host:6379" # db: 2 + nodeSelector: {} + tolerations: [] + affinity: {} - clair: enabled: true image: @@ -291,6 +305,9 @@ clair: # requests: # memory: 256Mi # cpu: 100m + nodeSelector: {} + tolerations: [] + affinity: {} ## Settings for postgresql dependency. ## see https://github.com/kubernetes/charts/tree/master/stable/postgresql @@ -349,3 +366,6 @@ notary: # requests: # memory: 256Mi # cpu: 100m + nodeSelector: {} + tolerations: [] + affinity: {}