Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Merge pull request #732 from flaviodsr/chart_deps
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviodsr committed Jan 26, 2022
2 parents ae5d107 + a7f267b commit 8d2d02b
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 31 deletions.
1 change: 1 addition & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# https://github.com/helm/chart-testing
chart-dirs:
- packaging/helm/trento-server/charts
- packaging/helm
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
Expand Down
6 changes: 3 additions & 3 deletions packaging/helm/trento-server/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!BuildTag: trento/trento-server:0.3.3
#!BuildTag: trento/trento-server:0.3.3-build%RELEASE%
#!BuildTag: trento/trento-server:0.3.4
#!BuildTag: trento/trento-server:0.3.4-build%RELEASE%
apiVersion: v2
name: trento-server
description: The trento server chart contains all the components necessary to run a Trento server.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates
version: 0.3.3
version: 0.3.4

dependencies:
- name: trento-web
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.3.4
version: 0.3.5
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ spec:
- name: TRENTO_LOG_LEVEL
value: "{{ .Values.global.logLevel }}"
- name: TRENTO_API_HOST
value: "{{ .Release.Name }}-{{ .Values.dependencies.trentoWeb.name }}"
value: "{{ .Release.Name }}-{{ .Values.global.trentoWeb.name }}"
- name: TRENTO_API_PORT
value: "{{ .Values.dependencies.trentoWeb.port }}"
value: "{{ .Values.global.trentoWeb.servicePort }}"
- name: TRENTO_INTERVAL
value: "{{ .Values.checkIntervalMins }}"
args:
Expand Down
12 changes: 3 additions & 9 deletions packaging/helm/trento-server/charts/trento-runner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

global:
logLevel: info
trentoWeb:
name: web
servicePort: 8080

privateKey: ""
checkIntervalMins: 5
Expand Down Expand Up @@ -81,12 +84,3 @@ nodeSelector: {}
tolerations: []

affinity: {}

# service dependencies to be consumed by the runner deployment
dependencies:
trentoWeb:
name: trento-web
port: 8080
trentoCollector:
name: trento-web-collector
port: 8081
2 changes: 1 addition & 1 deletion packaging/helm/trento-server/charts/trento-web/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.3.6
version: 0.3.7
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,14 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Return Trento Web service port
*/}}
{{- define "trentoWeb.port" -}}
{{- if .Values.global.trentoWeb.servicePort }}
{{- .Values.global.trentoWeb.servicePort -}}
{{- else -}}
{{- .Values.webService.port -}}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "trento-runner.fullname" . }}-certs
name: {{ include "trento-web.fullname" . }}-certs
data:
cert: |-
{{ .Values.mTLS.cert | b64enc }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ spec:
- name: TRENTO_LOG_LEVEL
value: "{{ .Values.global.logLevel }}"
- name: TRENTO_DB_HOST
value: "{{ .Release.Name }}-{{ .Values.dependencies.postgresql.name }}"
value: "{{ .Release.Name }}-{{ .Values.global.postgresql.name }}"
- name: TRENTO_DB_PORT
value: "{{ .Values.dependencies.postgresql.port }}"
value: "{{ .Values.global.postgresql.servicePort }}"
- name: TRENTO_PORT
value: "{{ .Values.webService.port }}"
- name: TRENTO_COLLECTOR_PORT
Expand Down Expand Up @@ -94,7 +94,7 @@ spec:
volumes:
- name: certs
secret:
secretName: {{ include "trento-runner.fullname" . }}-certs
secretName: {{ include "trento-web.fullname" . }}-certs
items:
- key: cert
path: cert.pem
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "trento-web.fullname" . -}}
{{- $svcPort := .Values.webService.port -}}
{{- $svcPort := include "trentoWeb.port" . -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
spec:
type: {{ .Values.webService.type }}
ports:
- port: {{ .Values.webService.port }}
- port: {{ template "trentoWeb.port" . }}
targetPort: http
protocol: TCP
name: http
Expand Down
11 changes: 5 additions & 6 deletions packaging/helm/trento-server/charts/trento-web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

global:
logLevel: info
trentoWeb:
servicePort: ""
postgresql:
name: postgresql
servicePort: 5432

mTLS:
enabled: false
Expand Down Expand Up @@ -98,9 +103,3 @@ nodeSelector: {}
tolerations: []

affinity: {}

# service dependencies to be consumed by the web deployment
dependencies:
postgresql:
name: postgresql
port: 5432
9 changes: 6 additions & 3 deletions packaging/helm/trento-server/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
### Global Values ###
global:
logLevel: info
trentoWeb:
name: web
servicePort: 8080
postgresql:
name: postgresql
servicePort: 5432

### Sub Charts Specific Values ###
trento-web:
Expand All @@ -10,9 +16,6 @@ trento-web:
trento-runner:
nameOverride: runner
enabled: true
dependencies:
trentoWeb:
name: web

postgresql:
enabled: true
Expand Down

0 comments on commit 8d2d02b

Please sign in to comment.