Skip to content

Commit

Permalink
Merge pull request #49 from sunnyyip/common-tolerations-n-serviceaccount
Browse files Browse the repository at this point in the history
support common tolerations and control service account creation
  • Loading branch information
pxp928 authored May 17, 2024
2 parents 7a0fd89 + 9fac4ec commit e49ac68
Show file tree
Hide file tree
Showing 31 changed files with 598 additions and 22 deletions.
10 changes: 9 additions & 1 deletion charts/guac/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ This section contains parameters for configuring the different GUAC components.
| `guac.guacImage.digest` | Sha256 Image Digest. It is strongly recommended to use this for verification. | `""` |
| `guac.guacImage.pullPolicy` | ImagePullPolicy for kubernetes | `IfNotPresent` |
| `guac.guacImage.workingDir` | Working Directory for GUAC | `/guac` |
| `guac.common.env` | Environment variables common apply for all guac services | `""` |
| `guac.common.env` | common environment variables apply to all guac services | `""` |
| `guac.common.tolerations` | common tolerations apply to all guac services | `""` |
| `guac.ociCollector.enabled` | String Whether to deploy OCI Collector | `true` |
| `guac.ociCollector.name` | String Name of the OCI Collector component. | `oci-collector` |
| `guac.ociCollector.annotations.reloader.stakater.com/auto` | Boolean for deploying [stakater/Reloader] (https://github.com/stakater/Reloader) | `""` |
Expand All @@ -111,6 +112,7 @@ This section contains parameters for configuring the different GUAC components.
| `guac.ociCollector.env` | Environment variables for OCI Collector. | `[]` |
| `guac.ociCollector.nodeSelector` | - sets the node selector for where to run the deployment | `{}` |
| `guac.ociCollector.tolerations` | | `[]` |
| `guac.ociCollector.serviceAccount.create` | - whether to create OCI Collector service account | `true` |
| `guac.ociCollector.serviceAccount.annotations` | - OCI Collector service account annotations | `{}` |
| `guac.ociCollector.resources` | - [map] resource requests or limits of the ociCollector deployment | `{}` |
| `guac.depsDevCollector.enabled` | String Whether to deploy Deps.Dev Collector | `true` |
Expand All @@ -121,6 +123,7 @@ This section contains parameters for configuring the different GUAC components.
| `guac.depsDevCollector.env` | Environment variables for Deps.Dev Collector. | `[]` |
| `guac.depsDevCollector.nodeSelector` | - sets the node selector for where to run the deployment | `{}` |
| `guac.depsDevCollector.tolerations` | | `[]` |
| `guac.depsDevCollector.serviceAccount.create` | - whether to create depsDevCollector service account | `true` |
| `guac.depsDevCollector.serviceAccount.annotations` | | `{}` |
| `guac.depsDevCollector.resources` | - [map] resource requests or limits of the depsDevCollector deployment | `{}` |
| `guac.osvCertifier.enabled` | String Whether to deploy OSV Certifier | `true` |
Expand All @@ -131,6 +134,7 @@ This section contains parameters for configuring the different GUAC components.
| `guac.osvCertifier.env` | Environment variables for OSV Certifier Collector. | `[]` |
| `guac.osvCertifier.nodeSelector` | - sets the node selector for where to run the deployment | `{}` |
| `guac.osvCertifier.tolerations` | | `[]` |
| `guac.osvCertifier.serviceAccount.create` | - whether to create osvCertifier service account | `true` |
| `guac.osvCertifier.serviceAccount.annotations` | - OSV Certifier service account annotations | `{}` |
| `guac.osvCertifier.resources` | - [map] resource requests or limits of the OSV Certifier deployment | `{}` |
| `guac.ingestor.enabled` | String Whether to deploy Ingestor | `true` |
Expand All @@ -140,6 +144,7 @@ This section contains parameters for configuring the different GUAC components.
| `guac.ingestor.image.command` | Command for the ingestor image. It is not recommended to override this. | `["sh","-c","/opt/guac/guacingest"]` |
| `guac.ingestor.env` | Environment variables for ingestor. | `[]` |
| `guac.ingestor.nodeSelector` | - sets the node selector for where to run the deployment | `{}` |
| `guac.ingestor.serviceAccount.create` | - whether to create ingestor service account | `true` |
| `guac.ingestor.serviceAccount.annotations` | - Ingestor service account annotations | `{}` |
| `guac.ingestor.tolerations` | | `[]` |
| `guac.ingestor.resources` | - [map] resource requests or limits of the ingestor deployment | `{}` |
Expand All @@ -155,6 +160,7 @@ This section contains parameters for configuring the different GUAC components.
| `guac.collectSub.svcPorts[0].targetPort` | Port the CollectSub container listens on | `2782` |
| `guac.collectSub.nodeSelector` | - sets the node selector for where to run the deployment | `{}` |
| `guac.collectSub.tolerations` | | `[]` |
| `guac.collectSub.serviceAccount.create` | - whether to create collectSub service account | `true` |
| `guac.collectSub.serviceAccount.annotations` | - CollectSub service account annotations | `{}` |
| `guac.collectSub.resources` | - [map] resource requests or limits of the collectSub deployment | `{}` |
| `guac.graphqlServer.enabled` | String Whether to deploy GraphQL Server | `true` |
Expand All @@ -171,6 +177,7 @@ This section contains parameters for configuring the different GUAC components.
| `guac.graphqlServer.backend` | which backend to use - keyvalue (default) | arango | ent. | `keyvalue` |
| `guac.graphqlServer.debug` | Enable debug mode for graphql server; also enable the UI | `true` |
| `guac.graphqlServer.nodeSelector` | - sets the node selector for where to run the deployment | `{}` |
| `guac.graphqlServer.serviceAccount.create` | - whether to create graphqlServer service account | `true` |
| `guac.graphqlServer.serviceAccount.annotations` | - graphql server service account annotations | `{}` |
| `guac.graphqlServer.service.createNodePortService` | - Whether to deploy a NodePort type service | `false` |
| `guac.graphqlServer.additionalVolumeMounts` | | `[]` |
Expand All @@ -187,6 +194,7 @@ This section contains parameters for configuring the different GUAC components.
| `guac.restApi.svcPorts[0].protocol` | Protocol used at the the restApi | `TCP` |
| `guac.restApi.svcPorts[0].port` | Port the restApi service listens on | `8081` |
| `guac.restApi.svcPorts[0].targetPort` | Port the restApi container listens on | `8081` |
| `guac.restApi.serviceAccount.create` | - whether to create restApi service account | `true` |
| `guac.restApi.serviceAccount.annotations` | - graphql server service account annotations | `{}` |
| `guac.restApi.nodeSelector` | - sets the node selector for where to run the deployment | `{}` |
| `guac.restApi.tolerations` | | `[]` |
Expand Down
42 changes: 41 additions & 1 deletion charts/guac/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
"properties": {
"env": {
"type": "string",
"description": "Environment variables common apply for all guac services",
"description": "common environment variables apply to all guac services",
"default": "\"\""
},
"tolerations": {
"type": "string",
"description": "common tolerations apply to all guac services",
"default": "\"\""
}
}
Expand Down Expand Up @@ -108,6 +113,11 @@
"serviceAccount": {
"type": "object",
"properties": {
"create": {
"type": "boolean",
"description": "- whether to create OCI Collector service account",
"default": true
},
"annotations": {
"type": "object",
"description": "- OCI Collector service account annotations",
Expand Down Expand Up @@ -177,6 +187,11 @@
"serviceAccount": {
"type": "object",
"properties": {
"create": {
"type": "boolean",
"description": "- whether to create depsDevCollector service account",
"default": true
},
"annotations": {
"type": "object",
"description": "",
Expand Down Expand Up @@ -246,6 +261,11 @@
"serviceAccount": {
"type": "object",
"properties": {
"create": {
"type": "boolean",
"description": "- whether to create osvCertifier service account",
"default": true
},
"annotations": {
"type": "object",
"description": "- OSV Certifier service account annotations",
Expand Down Expand Up @@ -309,6 +329,11 @@
"serviceAccount": {
"type": "object",
"properties": {
"create": {
"type": "boolean",
"description": "- whether to create ingestor service account",
"default": true
},
"annotations": {
"type": "object",
"description": "- Ingestor service account annotations",
Expand Down Expand Up @@ -418,6 +443,11 @@
"serviceAccount": {
"type": "object",
"properties": {
"create": {
"type": "boolean",
"description": "- whether to create collectSub service account",
"default": true
},
"annotations": {
"type": "object",
"description": "- CollectSub service account annotations",
Expand Down Expand Up @@ -525,6 +555,11 @@
"serviceAccount": {
"type": "object",
"properties": {
"create": {
"type": "boolean",
"description": "- whether to create graphqlServer service account",
"default": true
},
"annotations": {
"type": "object",
"description": "- graphql server service account annotations",
Expand Down Expand Up @@ -645,6 +680,11 @@
"serviceAccount": {
"type": "object",
"properties": {
"create": {
"type": "boolean",
"description": "- whether to create restApi service account",
"default": true
},
"annotations": {
"type": "object",
"description": "- graphql server service account annotations",
Expand Down
8 changes: 7 additions & 1 deletion charts/guac/templates/collectsub-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,15 @@ spec:
nodeSelector:
{{ toYaml .Values.guac.collectSub.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.guac.collectSub.tolerations }}

{{- if or .Values.guac.common.tolerations .Values.guac.collectSub.tolerations }}
tolerations:
{{- if .Values.guac.common.tolerations }}
{{ toYaml .Values.guac.common.tolerations | indent 8 }}
{{- end }}
{{- if .Values.guac.collectSub.tolerations }}
{{ toYaml .Values.guac.collectSub.tolerations | indent 8 }}
{{- end }}
{{- end }}

{{- end }}
2 changes: 2 additions & 0 deletions charts/guac/templates/collectsub-sa.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright Kusari, Inc. and contributors
# Licensed under the MIT license. See LICENSE file in the project root for details.
{{ if .Values.guac.collectSub.enabled }}
{{ if .Values.guac.collectSub.serviceAccount.create }}
---
apiVersion: v1
kind: ServiceAccount
Expand All @@ -15,3 +16,4 @@ metadata:
app.kubernetes.io/name: {{ .Values.guac.collectSub.name }}
app.kubernetes.io/component: {{ .Values.guac.collectSub.name }}
{{- end }}
{{- end }}
9 changes: 8 additions & 1 deletion charts/guac/templates/depsdev-collector-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,16 @@ spec:
nodeSelector:
{{ toYaml .Values.guac.depsDevCollector.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.guac.depsDevCollector.tolerations }}

{{- if or .Values.guac.common.tolerations .Values.guac.depsDevCollector.tolerations }}
tolerations:
{{- if .Values.guac.common.tolerations }}
{{ toYaml .Values.guac.common.tolerations | indent 8 }}
{{- end }}
{{- if .Values.guac.depsDevCollector.tolerations }}
{{ toYaml .Values.guac.depsDevCollector.tolerations | indent 8 }}
{{- end }}
{{- end }}


{{- end }}
Loading

0 comments on commit e49ac68

Please sign in to comment.