From 5136a515f038884472cf0b1a2b93b9345593a3dd Mon Sep 17 00:00:00 2001 From: ian hundere <138915+ianhundere@users.noreply.github.com> Date: Tue, 25 Jun 2024 14:02:07 -0400 Subject: [PATCH] adds tolerations, nodeSelector, and affinity to updatetree. (#760) Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com> --- charts/updatetree/Chart.yaml | 2 +- charts/updatetree/README.md | 4 +- charts/updatetree/templates/job.yaml | 12 + charts/updatetree/values.schema.json | 344 +++++---------------------- charts/updatetree/values.yaml | 4 + 5 files changed, 82 insertions(+), 284 deletions(-) diff --git a/charts/updatetree/Chart.yaml b/charts/updatetree/Chart.yaml index 4ad26077..8e4e9172 100644 --- a/charts/updatetree/Chart.yaml +++ b/charts/updatetree/Chart.yaml @@ -4,7 +4,7 @@ description: Update the status of an existing Trillian tree type: application -version: 0.0.9 +version: 0.0.10 appVersion: 0.6.17 diff --git a/charts/updatetree/README.md b/charts/updatetree/README.md index 9a8bfaf0..ce8471fc 100644 --- a/charts/updatetree/README.md +++ b/charts/updatetree/README.md @@ -16,12 +16,14 @@ Update the status of an existing Trillian tree | Key | Type | Default | Description | |-----|------|---------|-------------| +| affinity | object | `{}` | | | annotations | object | `{}` | | | args.treeID | string | `""` | | | args.treeState | string | `""` | valid tree states are ACTIVE, FROZEN and DRAINING | | enabled | bool | `false` | | | namespace.create | bool | `false` | | | namespace.name | string | `"trillian-system"` | | +| nodeSelector | object | `{}` | | | securityContext.runAsNonRoot | bool | `true` | | | securityContext.runAsUser | int | `65533` | | | serviceAccount.annotations | object | `{}` | | @@ -29,9 +31,9 @@ Update the status of an existing Trillian tree | serviceAccount.name | string | `"trillian-logserver"` | | | spec.image | string | `"ghcr.io/sigstore/scaffolding/updatetree:v0.6.17@sha256:9fe03dde7324490cc7a84c75dfa3f1de267fc71c1a473fc67491c690e22c32ab"` | | | spec.replicaCount | int | `1` | | +| tolerations | list | `[]` | | | trillian.adminServer | string | `""` | | | trillian.logServer.name | string | `"trillian-logserver"` | | | trillian.logServer.portRPC | int | `8091` | | | trillian.namespace | string | `"trillian-system"` | | | ttlSecondsAfterFinished | int | `3600` | | - diff --git a/charts/updatetree/templates/job.yaml b/charts/updatetree/templates/job.yaml index 17ddd47f..49af3c9e 100644 --- a/charts/updatetree/templates/job.yaml +++ b/charts/updatetree/templates/job.yaml @@ -32,4 +32,16 @@ spec: securityContext: {{ toYaml .Values.securityContext | indent 8 }} {{- end }} + {{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 8 }} + {{- end }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- end }} {{- end }} diff --git a/charts/updatetree/values.schema.json b/charts/updatetree/values.schema.json index 9379e16a..761d0ed0 100644 --- a/charts/updatetree/values.schema.json +++ b/charts/updatetree/values.schema.json @@ -1,328 +1,108 @@ { - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "http://example.com/example.json", - "type": "object", - "default": {}, - "title": "Root Schema", - "required": [ - "enabled", - "namespace", - "serviceAccount", - "spec", - "securityContext", - "args", - "annotations", - "trillian" - ], + "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { - "enabled": { - "type": "boolean", - "default": false, - "title": "The enabled Schema", - "examples": [ - false - ] + "affinity": { + "properties": {}, + "type": "object" }, - "namespace": { - "type": "object", - "default": {}, - "title": "The namespace Schema", - "required": [ - "name", - "create" - ], - "properties": { - "name": { - "type": "string", - "default": "", - "title": "The name Schema", - "examples": [ - "trillian-system" - ] - }, - "create": { - "type": "boolean", - "default": false, - "title": "The create Schema", - "examples": [ - false - ] - } - }, - "examples": [ - { - "name": "trillian-system", - "create": false - } - ] + "annotations": { + "properties": {}, + "type": "object" }, - "serviceAccount": { - "type": "object", - "default": {}, - "title": "The serviceAccount Schema", - "required": [ - "name", - "annotations", - "create" - ], + "args": { "properties": { - "name": { - "type": "string", - "default": "", - "title": "The name Schema", - "examples": [ - "trillian-logserver" - ] - }, - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [ - {} - ] + "treeID": { + "type": "string" }, - "create": { - "type": "boolean", - "default": false, - "title": "The create Schema", - "examples": [ - false - ] + "treeState": { + "type": "string" } }, - "examples": [ - { - "name": "trillian-logserver", - "annotations": {}, - "create": false - } - ] + "type": "object" }, - "spec": { - "type": "object", - "default": {}, - "title": "The spec Schema", - "required": [ - "replicaCount", - "image" - ], + "enabled": { + "type": "boolean" + }, + "namespace": { "properties": { - "replicaCount": { - "type": "integer", - "default": 0, - "title": "The replicaCount Schema", - "examples": [ - 1 - ] + "create": { + "type": "boolean" }, - "image": { - "type": "string", - "default": "", - "title": "The image Schema", - "examples": [ - "ghcr.io/sigstore/scaffolding/updatetree:v0.6.7@sha256:357cf3545cd459634fe6a461a7690bc5f425c353e48c80da551cfec6887d627d" - ] + "name": { + "type": "string" } }, - "examples": [ - { - "replicaCount": 1, - "image": "ghcr.io/sigstore/scaffolding/updatetree:v0.6.7@sha256:357cf3545cd459634fe6a461a7690bc5f425c353e48c80da551cfec6887d627d" - } - ] + "type": "object" }, - "ttlSecondsAfterFinished": { - "type": "integer", - "default": 0, - "title": "The ttlSecondsAfterFinished Schema", - "examples": [ - 3600 - ] + "nodeSelector": { + "properties": {}, + "type": "object" }, "securityContext": { - "type": "object", - "default": {}, - "title": "The securityContext Schema", - "required": [ - "runAsNonRoot", - "runAsUser" - ], "properties": { "runAsNonRoot": { - "type": "boolean", - "default": false, - "title": "The runAsNonRoot Schema", - "examples": [ - true - ] + "type": "boolean" }, "runAsUser": { - "type": "integer", - "default": 0, - "title": "The runAsUser Schema", - "examples": [ - 65533 - ] + "type": "integer" } }, - "examples": [ - { - "runAsNonRoot": true, - "runAsUser": 65533 - } - ] + "type": "object" }, - "args": { - "type": "object", - "default": {}, - "title": "The args Schema", - "required": [ - "treeID", - "treeState" - ], + "serviceAccount": { "properties": { - "treeID": { - "type": "string", - "default": "", - "title": "The treeID Schema", - "examples": [ - "" - ] + "annotations": { + "properties": {}, + "type": "object" }, - "treeState": { - "type": "string", - "default": "", - "title": "The treeState Schema", - "examples": [ - "" - ] + "create": { + "type": "boolean" + }, + "name": { + "type": "string" } }, - "examples": [ - { - "treeID": "", - "treeState": "" + "type": "object" + }, + "spec": { + "properties": { + "image": { + "type": "string" + }, + "replicaCount": { + "type": "integer" } - ] + }, + "type": "object" }, - "annotations": { - "type": "object", - "default": {}, - "title": "The annotations Schema", - "required": [], - "properties": {}, - "examples": [ - {} - ] + "tolerations": { + "type": "array" }, "trillian": { - "type": "object", - "default": {}, - "title": "The trillian Schema", - "required": [ - "namespace", - "adminServer", - "logServer" - ], "properties": { - "namespace": { - "type": "string", - "default": "", - "title": "The namespace Schema", - "examples": [ - "trillian-system" - ] - }, "adminServer": { - "type": "string", - "default": "", - "title": "The adminServer Schema", - "examples": [ - "" - ] + "type": "string" }, "logServer": { - "type": "object", - "default": {}, - "title": "The logServer Schema", - "required": [ - "name", - "portRPC" - ], "properties": { "name": { - "type": "string", - "default": "", - "title": "The name Schema", - "examples": [ - "trillian-logserver" - ] + "type": "string" }, "portRPC": { - "type": "integer", - "default": 0, - "title": "The portRPC Schema", - "examples": [ - 8091 - ] + "type": "integer" } }, - "examples": [ - { - "name": "trillian-logserver", - "portRPC": 8091 - } - ] + "type": "object" + }, + "namespace": { + "type": "string" } }, - "examples": [ - { - "namespace": "trillian-system", - "adminServer": "", - "logServer": { - "name": "trillian-logserver", - "portRPC": 8091 - } - } - ] + "type": "object" + }, + "ttlSecondsAfterFinished": { + "type": "integer" } }, - "examples": [ - { - "enabled": false, - "namespace": { - "name": "trillian-system", - "create": false - }, - "serviceAccount": { - "name": "trillian-logserver", - "annotations": {}, - "create": false - }, - "spec": { - "replicaCount": 1, - "image": "ghcr.io/sigstore/scaffolding/updatetree:v0.6.7@sha256:357cf3545cd459634fe6a461a7690bc5f425c353e48c80da551cfec6887d627d" - }, - "securityContext": { - "runAsNonRoot": true, - "runAsUser": 65533 - }, - "args": { - "treeID": "", - "treeState": "" - }, - "annotations": {}, - "trillian": { - "namespace": "trillian-system", - "adminServer": "", - "logServer": { - "name": "trillian-logserver", - "portRPC": 8091 - } - } - } - ] + "type": "object" } diff --git a/charts/updatetree/values.yaml b/charts/updatetree/values.yaml index d1628b11..2c612dbd 100644 --- a/charts/updatetree/values.yaml +++ b/charts/updatetree/values.yaml @@ -26,3 +26,7 @@ trillian: logServer: name: trillian-logserver portRPC: 8091 + +tolerations: [] +nodeSelector: {} +affinity: {}