From 44f030930c2ea782028fcd13a531a966b499b143 Mon Sep 17 00:00:00 2001 From: Alioune SY Date: Fri, 26 Aug 2022 14:45:28 +0200 Subject: [PATCH] feat(dependency-track): Allowing user to configure global and per-tier labels Signed-off-by: Alioune SY --- charts/dependency-track/Chart.yaml | 2 +- charts/dependency-track/README.md | 8 +++--- .../dependency-track/templates/_helpers.tpl | 26 ++++++++++++++++--- charts/dependency-track/values.yaml | 5 ++++ 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/charts/dependency-track/Chart.yaml b/charts/dependency-track/Chart.yaml index 056b3ee..93aeb5e 100644 --- a/charts/dependency-track/Chart.yaml +++ b/charts/dependency-track/Chart.yaml @@ -4,7 +4,7 @@ description: | Dependency-Track is an intelligent Software Supply Chain Component Analysis platform that allows organizations to identify and reduce risk from the use of third-party and open source components. Dependency-Track takes a unique and highly beneficial approach by leveraging the capabilities of Software Bill-of-Materials (SBOM). This approach provides capabilities that traditional Software Composition Analysis (SCA) solutions cannot achieve. name: dependency-track home: https://dependencytrack.org/ -version: 1.5.4 +version: 1.5.5 icon: https://raw.githubusercontent.com/DependencyTrack/branding/master/dt-logo-black-text.svg keywords: - security diff --git a/charts/dependency-track/README.md b/charts/dependency-track/README.md index 336ca89..5dd57f7 100644 --- a/charts/dependency-track/README.md +++ b/charts/dependency-track/README.md @@ -1,6 +1,6 @@ # dependency-track -![Version: 1.5.2](https://img.shields.io/badge/Version-1.5.2-informational?style=flat-square) ![AppVersion: 4.6.2](https://img.shields.io/badge/AppVersion-4.6.2-informational?style=flat-square) +![Version: 1.5.5](https://img.shields.io/badge/Version-1.5.5-informational?style=flat-square) ![AppVersion: 4.6.2](https://img.shields.io/badge/AppVersion-4.6.2-informational?style=flat-square) Dependency-Track is an intelligent Software Supply Chain Component Analysis platform that allows organizations to identify and reduce risk from the use of third-party and open source components. Dependency-Track takes a unique and highly beneficial approach by leveraging the capabilities of Software Bill-of-Materials (SBOM). This approach provides capabilities that traditional Software Composition Analysis (SCA) solutions cannot achieve. @@ -29,10 +29,10 @@ Dependency-Track is an intelligent Software Supply Chain Component Analysis plat | Key | Type | Default | Description | |-----|------|---------|-------------| -| apiserver | object | `{"affinity":{},"emptyDir":{"sizeLimit":"8Gi"},"enabled":true,annotations":{},"env":[],"fullnameOverride":"","image":{"pullPolicy":"IfNotPresent","repository":"dependencytrack/apiserver","tag":"4.6.2"},"initContainers":[],"livenessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":60,"path":"/api/version","periodSeconds":10,"successThreshold":1,"timeoutSeconds":2},"nameOverride":"","nodeSelector":{},"persistentVolume":{"accessModes":["ReadWriteOnce"],"annotations":{},"enabled":true,"size":"8Gi","storageClass":""},"podSecurityContext":{"fsGroup":1000},"readinessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":60,"path":"/","periodSeconds":10,"successThreshold":1,"timeoutSeconds":2},"replicaCount":1,"resources":{"limits":{"cpu":4,"memory":"16Gi"},"requests":{"cpu":2,"memory":"4608Mi"}},"securityContext":{"readOnlyRootFilesystem":true,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000},"service":{"annotations":{},"port":80,"type":"ClusterIP"},"serviceAccount":{"annotations":{},"create":true,"name":"apiserver-serviceaccount"},"tolerations":[]}` | config of the apiserver | -| frontend | object | `{"affinity":{},"emptyDir":{"sizeLimit":"8Gi"},"enabled":true,annotations":{},"env":[{"name":"API_BASE_URL","value":""}],"fullnameOverride":"","image":{"pullPolicy":"IfNotPresent","repository":"dependencytrack/frontend","tag":"4.6.1"},"initContainers":[],"livenessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":60,"path":"/","periodSeconds":10,"successThreshold":1,"timeoutSeconds":2},"nameOverride":"","nodeSelector":{},"readinessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":60,"path":"/","periodSeconds":10,"successThreshold":1,"timeoutSeconds":2},"replicaCount":2,"resources":{"limits":{"cpu":1,"memory":"512Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"securityContext":{"allowPrivilegeEscalation":false,"runAsUser":101},"service":{"annotations":{},"port":80,"type":"ClusterIP"},"serviceAccount":{"annotations":{},"create":true,"name":"frontend-serviceaccount"},"tolerations":[]}` | config of the frontend | +| apiserver | object | `{"affinity":{},"emptyDir":{"sizeLimit":"8Gi"},"enabled":true,annotations":{},"labels": {"app.kubernetes.io/component": "backend"},"env":[],"fullnameOverride":"","image":{"pullPolicy":"IfNotPresent","repository":"dependencytrack/apiserver","tag":"4.6.2"},"initContainers":[],"livenessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":60,"path":"/api/version","periodSeconds":10,"successThreshold":1,"timeoutSeconds":2},"nameOverride":"","nodeSelector":{},"persistentVolume":{"accessModes":["ReadWriteOnce"],"annotations":{},"enabled":true,"size":"8Gi","storageClass":""},"podSecurityContext":{"fsGroup":1000},"readinessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":60,"path":"/","periodSeconds":10,"successThreshold":1,"timeoutSeconds":2},"replicaCount":1,"resources":{"limits":{"cpu":4,"memory":"16Gi"},"requests":{"cpu":2,"memory":"4608Mi"}},"securityContext":{"readOnlyRootFilesystem":true,"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000},"service":{"annotations":{},"port":80,"type":"ClusterIP"},"serviceAccount":{"annotations":{},"create":true,"name":"apiserver-serviceaccount"},"tolerations":[]}` | config of the apiserver | +| frontend | object | `{"affinity":{},"emptyDir":{"sizeLimit":"8Gi"},"enabled":true,annotations":{},"labels": {"app.kubernetes.io/component": "frontend"},"env":[{"name":"API_BASE_URL","value":""}],"fullnameOverride":"","image":{"pullPolicy":"IfNotPresent","repository":"dependencytrack/frontend","tag":"4.6.1"},"initContainers":[],"livenessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":60,"path":"/","periodSeconds":10,"successThreshold":1,"timeoutSeconds":2},"nameOverride":"","nodeSelector":{},"readinessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":60,"path":"/","periodSeconds":10,"successThreshold":1,"timeoutSeconds":2},"replicaCount":2,"resources":{"limits":{"cpu":1,"memory":"512Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"securityContext":{"allowPrivilegeEscalation":false,"runAsUser":101},"service":{"annotations":{},"port":80,"type":"ClusterIP"},"serviceAccount":{"annotations":{},"create":true,"name":"frontend-serviceaccount"},"tolerations":[]}` | config of the frontend | | frontend.env | list | `[{"name":"API_BASE_URL","value":""}]` | See https://docs.dependencytrack.org/getting-started/configuration/ for frontend ENV variables. | -| global | object | `{"imageRegistry":"docker.io"}` | global configuration | +| global | object | `{"imageRegistry":"docker.io", "labels": {}}` | global configuration | | ingress | object | `{"annotations":{},"enabled":false,"host":"chart-example.local","tls":{"enabled":false,"secretName":""}}` | configuration of ingress | | postgresql | object | `{"enabled":true,"postgresqlDatabase":"deptrack","postgresqlPassword":"deptrack","postgresqlUsername":"deptrack"}` | configuration of postgres | diff --git a/charts/dependency-track/templates/_helpers.tpl b/charts/dependency-track/templates/_helpers.tpl index e349ca7..d37a1ba 100644 --- a/charts/dependency-track/templates/_helpers.tpl +++ b/charts/dependency-track/templates/_helpers.tpl @@ -8,22 +8,40 @@ {{- include "common.images.image" ( dict "imageRoot" .Values.frontend.image "global" .Values.global ) -}} {{- end -}} +{{- define "frontend.labels.user" -}} +{{ if .Values.frontend.labels }} +{{- .Values.frontend.labels | toYaml | indent 0 }} +{{- end }} +{{- if .Values.global.labels }} +{{- .Values.global.labels | toYaml | nindent 0 }} +{{- end }} +{{- end -}} + {{- define "frontend.labels.standard" -}} {{ include "common.labels.standard" . }} -app.kubernetes.io/component: frontend +{{ include "frontend.labels.user" . }} {{- end -}} {{- define "frontend.labels.matchLabels" -}} {{ include "common.labels.matchLabels" . }} -app.kubernetes.io/component: frontend +{{ include "frontend.labels.user" . }} +{{- end -}} + +{{- define "backend.labels.user" -}} +{{ if .Values.apiserver.labels }} +{{- .Values.apiserver.labels | toYaml | indent 0 }} +{{- end }} +{{- if .Values.global.labels }} +{{- .Values.global.labels | toYaml | nindent 0 }} +{{- end }} {{- end -}} {{- define "backend.labels.standard" -}} {{ include "common.labels.standard" . }} -app.kubernetes.io/component: backend +{{ include "backend.labels.user" . }} {{- end -}} {{- define "backend.labels.matchLabels" -}} {{ include "common.labels.matchLabels" . }} -app.kubernetes.io/component: backend +{{ include "backend.labels.user" . }} {{- end -}} diff --git a/charts/dependency-track/values.yaml b/charts/dependency-track/values.yaml index 775ea77..0660222 100644 --- a/charts/dependency-track/values.yaml +++ b/charts/dependency-track/values.yaml @@ -8,12 +8,15 @@ global: imageRegistry: docker.io # imagePullSecrets: # - name: "myRegistryKeySecretName" + labels: {} # -- config of the frontend frontend: enabled: true annotations: {} replicaCount: 2 + labels: + app.kubernetes.io/component: frontend image: repository: dependencytrack/frontend tag: 4.6.1 @@ -93,6 +96,8 @@ apiserver: annotations: {} # Max: 1 - DT is not designed for HA replicaCount: 1 + labels: + app.kubernetes.io/component: backend image: repository: dependencytrack/apiserver tag: 4.6.2