Skip to content

Commit

Permalink
Publishing Tibco developer hub 1.4.0 Charts. (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgantaya authored Jan 27, 2025
1 parent 6098a38 commit 972b895
Show file tree
Hide file tree
Showing 17 changed files with 296 additions and 72 deletions.
4 changes: 2 additions & 2 deletions charts/tibco-developer-hub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ 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: 1.3.18
version: 1.4.21

appVersion: "1.3.0"
appVersion: "1.4.0"

dependencies:
- name: common
Expand Down
6 changes: 0 additions & 6 deletions charts/tibco-developer-hub/charts/postgresql/Chart.lock

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ spec:
- name: copy-certs
image: {{ include "postgresql.volumePermissions.image" . }}
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
{{- if .Values.primary.resources }}
{{- if and ( .Values.primary.resources ) ( .Values.global.cp.enableResourceConstraints ) }}
resources: {{- toYaml .Values.primary.resources | nindent 12 }}
{{- end }}
# We don't require a privileged container in this case
Expand Down Expand Up @@ -427,7 +427,7 @@ spec:
{{- include "postgresql.readinessProbeCommand" . | nindent 16 }}
{{- end }}
{{- end }}
{{- if .Values.primary.resources }}
{{- if and ( .Values.primary.resources ) ( .Values.global.cp.enableResourceConstraints ) }}
resources: {{- toYaml .Values.primary.resources | nindent 12 }}
{{- end }}
{{- if .Values.primary.lifecycleHooks }}
Expand Down
16 changes: 15 additions & 1 deletion charts/tibco-developer-hub/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,25 @@ Return the proper image name
{{- .Values.global.cp.containerRegistry.url }}
{{- end -}}

{{/* set repository based on the registry url. We will have different repo for each one. */}}
{{- define "backstage.image.repository" -}}
{{- .Values.global.cp.containerRegistry.repository }}
{{- end -}}

{{- define "backstage.image.backend-registry" }}
{{- if and (.Values.backstage.image.registry) (.Values.backstage.image.repository) -}}
{{- .Values.backstage.image.registry }}
{{- else -}}
{{- .Values.global.cp.containerRegistry.url }}
{{- end -}}
{{- end -}}

{{- define "backstage.image.backend-repository" -}}
{{- if and (.Values.backstage.image.registry) (.Values.backstage.image.repository) -}}
{{- .Values.backstage.image.repository }}
{{- else -}}
{{- printf "%s/%s" .Values.global.cp.containerRegistry.repository .Values.backstage.image.name }}
{{- end -}}
{{- end -}}

{{- define "postgresql.image" -}}
{{ include "backstage.image.registry" .}}{{"/"}}{{ include "backstage.image.repository" .}}{{"/"}}{{ .Values.image.name }}:{{ .Values.image.tag }}
Expand Down
101 changes: 83 additions & 18 deletions charts/tibco-developer-hub/templates/backstage-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# in the license file that is distributed with this file.

{{- $installDir := .Values.backstage.installDir -}}
{{ $cpHostname := (.Values.global.cp).cpHostname | required ".Values.global.cp.cpHostname is required." }}
---
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
Expand Down Expand Up @@ -62,15 +63,19 @@ spec:
configMap:
name: backstage-app-config
{{- end }}
- name: logs
emptyDir: {}
- name: techdoc
emptyDir: {}
- name: db
emptyDir: {}
{{- if .Values.global.cp.cpCertificateSecret }}
- name: cp-certs
secret:
defaultMode: 420
secretName: {{ .Values.global.cp.cpCertificateSecret }}
{{- end }}
{{- if .Values.global.cp.logging.fluentbit.enabled }}
- name: podlogs
hostPath:
path: /var/log/pods
type: Directory
- name: dockercontainerlogs
hostPath:
path: /var/lib/docker/containers
type: DirectoryOrCreate
- name: config-volume
configMap:
name: tibco-developer-hub-fluentbit-config
Expand All @@ -92,12 +97,22 @@ spec:
command: ['sh', '-c',
'until pg_isready -U {{ .Values.postgresql.auth.username }} -h {{ include "backstage.postgresql.host" . }} -p 5432;
do echo waiting for database; sleep 2; done;']
{{- if .Values.global.cp.enableResourceConstraints }}
{{- if .Values.appInit.resources }}
resources:
{{- toYaml .Values.appInit.resources | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.appInit.securityContext }}
securityContext:
{{- toYaml .Values.appInit.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.backstage.initContainers }}
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: backstage-backend
image: {{ include "backstage.image.registry" .}}{{"/"}}{{ include "backstage.image.repository" .}}{{"/"}}{{ .Values.backstage.image.name }}:{{ .Values.backstage.image.tag }}
image: {{ include "backstage.image.backend-registry" .}}{{"/"}}{{ include "backstage.image.backend-repository" .}}:{{ .Values.backstage.image.tag }}
imagePullPolicy: {{ .Values.backstage.image.pullPolicy | quote -}}
{{- if .Values.backstage.containerSecurityContext }}
securityContext:
Expand Down Expand Up @@ -133,8 +148,9 @@ spec:
- "{{ $installDir }}/app-config-from-configmap.yaml"
{{- end }}
{{- end }}
{{- if .Values.backstage.resources }}
resources: {{- include "common.tplvalues.render" (dict "value" .Values.backstage.resources "context" $) | nindent 12 }}
{{- if .Values.global.cp.enableResourceConstraints }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- end }}
{{- if or .Values.backstage.extraEnvVarsSecrets .Values.backstage.appEnvSecrets }}
envFrom:
Expand Down Expand Up @@ -170,6 +186,8 @@ spec:
env:
- name: APP_CONFIG_backend_listen_port
value: {{ .Values.backstage.containerPorts.backend | quote }}
- name: CP_URL
value: {{ $cpHostname }}
{{- if .Values.postgresql.enabled }}
- name: POSTGRES_HOST
value: {{ include "backstage.postgresql.host" . }}
Expand Down Expand Up @@ -204,8 +222,16 @@ spec:
- name: backend
containerPort: {{ .Values.backstage.containerPorts.backend }}
protocol: TCP
{{- if (or .Values.backstage.extraAppConfig .Values.backstage.appConfig (and .Values.backstage.extraVolumeMounts .Values.backstage.extraVolumes)) }}
volumeMounts:
- mountPath: /app/node_modules/@backstage/plugin-techdocs-backend/static/docs
name: techdoc
- name: logs
mountPath: /tmp
{{- if .Values.global.cp.cpCertificateSecret }}
- name: cp-certs
mountPath: /etc/ssl/custom-certs
{{- end }}
{{- if (or .Values.backstage.extraAppConfig .Values.backstage.appConfig (and .Values.backstage.extraVolumeMounts .Values.backstage.extraVolumes)) }}
{{- range .Values.backstage.extraAppConfig }}
- name: {{ .configMapRef }}
mountPath: "{{ $installDir }}/{{ .filename }}"
Expand All @@ -219,15 +245,54 @@ spec:
{{- if .Values.backstage.extraVolumeMounts }}
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.extraVolumeMounts "context" $ ) | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.global.cp.logging.fluentbit.enabled }}
- name: fluentbit
image: {{ include "backstage.image.registry" .}}{{"/"}}{{ include "backstage.image.repository" .}}{{"/"}}{{ .Values.global.cp.logging.fluentbit.image.name }}:{{ .Values.global.cp.logging.fluentbit.image.tag }}
imagePullPolicy: {{ .Values.fluentbit.image.pullPolicy }}
{{- if .Values.fluentbit.securityContext }}
{{- if .Values.global.cp.logging.fluentbit.securityContext }}
securityContext:
{{- toYaml .Values.fluentbit.securityContext | nindent 12 }}
{{- toYaml .Values.global.cp.logging.fluentbit.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.global.cp.enableResourceConstraints }}
{{- with .Values.global.cp.logging.fluentbit.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
ports:
- containerPort: 2020
protocol: TCP
startupProbe:
httpGet:
scheme: HTTP
path: /api/v1/health
port: 2020
initialDelaySeconds: 0
periodSeconds: 1
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 50
livenessProbe:
httpGet:
scheme: HTTP
path: /api/v1/health
port: 2020
periodSeconds: 10
timeoutSeconds: 2
initialDelaySeconds: 0
successThreshold: 1
failureThreshold: 1
readinessProbe:
httpGet:
scheme: HTTP
path: /api/v1/health
port: 2020
periodSeconds: 10
timeoutSeconds: 2
initialDelaySeconds: 0
successThreshold: 1
failureThreshold: 1
env:
- name: POD_NAMESPACE
valueFrom:
Expand All @@ -248,10 +313,10 @@ spec:
fieldRef:
fieldPath: status.hostIP
volumeMounts:
- name: podlogs
- name: logs
mountPath: /var/log/pods
- name: dockercontainerlogs
mountPath: /var/lib/docker/containers
- name: db
mountPath: /var/log/db
- name: config-volume
mountPath: /fluent-bit/etc/
{{- end }}
Expand Down
7 changes: 5 additions & 2 deletions charts/tibco-developer-hub/templates/fluentbit-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ data:
Log_Level info
Daemon off
Parsers_File parsers.conf
HTTP_Server On
HTTP_Listen 0.0.0.0
HTTP_Port 2020
@INCLUDE input.conf
@INCLUDE filter.conf
Expand All @@ -26,9 +29,9 @@ data:
[INPUT]
Name tail
Tag dp.${POD_NAMESPACE}.${POD_NAME}.${POD_ID}.${CONTAINER_NAME}
Path /var/log/pods/${POD_NAMESPACE}_${POD_NAME}_${POD_ID}/${CONTAINER_NAME}/*.log
Path /var/log/pods/tibco-hub-*.log
multiline.parser docker, cri
DB /var/log/flb_kube.db
DB /var/log/db/flb_kube.db
Mem_Buf_Limit 5MB
Skip_Long_Lines On
Refresh_Interval 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ spec:
- X-Auth-Request-Access-Token
- X-Atmosphere-Token
trustForwardHeader: true
{{ if .Values.global.cp.authInsecureIngressController -}}
tls:
insecureSkipVerify: true
{{- end }}

---
apiVersion: traefik.io/v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ metadata:
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
nginx.ingress.kubernetes.io/upstream-vhost: {{ $cpHostname }}
nginx.ingress.kubernetes.io/rewrite-target: /.well-known/openid-configuration
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header x-cp-host {{ $cpHostname }};
nginx.ingress.kubernetes.io/proxy-buffer-size: 16k
{{- with .Values.global.cp.resources.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand All @@ -31,9 +27,9 @@ spec:
paths:
- backend:
service:
name: {{ include "common.names.fullname" . }}-wkc
name: {{ include "common.names.fullname" . }}
port:
number: 443
path: /tibco/hub/.well-known/openid-configuration
pathType: Exact
number: {{ .Values.service.ports.backend }}
path: /tibco/hub/.well-known/openid-configuration/
pathType: ImplementationSpecific
{{- end }}
Loading

0 comments on commit 972b895

Please sign in to comment.