-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GKE support for Constellation and Constellation Messaging (#770)
* Added support of GKE to constellation chart * Test * Trial * Updated Tests on Constellation with new changes * Added TLS support for GKE ingress * Prepared files for clln msg service * Partially implemented messaging constellation for GKE * Renamed files * Added Test for ingress presence in constellation * Refactored common helpers in root template folder * Refactored keys of constellation and constellation messaging in a way that they are more similar to the one used in the pega chart * Added new changes * Refactored cosntellation and constellation messaging deault values * Added unit test for backend config of constellation * Added unit test for backend config of constellation messaging * Updated documentation of constellation * Documented liveness and readiness probe of constellation * Updated documentation of constellation and constellation messaging * Updated documentation of constellation and constellation messaging service * Added Unit Test on ingress enablement for constellation and constellation messaging service * Update values.yaml by adding new line at the end of the file * Update values.yaml by adding new line at the end of the file * Update values.yaml by adding new line at the end of the file * Update values.yaml by adding new line at the end of the file * Update values.yaml of constellation messaging * Removed trailing spaces * Duplicated templates to subcharts in such a way to pass helm lint tests * Created supplemental.tpl aldo into template folder of backing services * Fix merge * Created secret for constellation messaging, added enabled in ingress of constellation messaging, changed default name of constellation messagin secret and changed urlPath input arg of constellation messaging --------- Co-authored-by: Alessandro Cattapan <[email protected]>
- Loading branch information
Showing
26 changed files
with
929 additions
and
155 deletions.
There are no files selected for viewing
87 changes: 80 additions & 7 deletions
87
charts/backingservices/charts/constellation-messaging/README.md
Large diffs are not rendered by default.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
charts/backingservices/charts/constellation-messaging/templates/_helpers.tpl
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
...s/backingservices/charts/constellation-messaging/templates/_messaging-registry-secret.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{- define "messagingRegistryCredentialsSecretTemplate" }} | ||
kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ include "backingservicesRegistrySecret" (dict "root" .Values "defaultname" "constellation-messaging" ) }} | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
"helm.sh/hook": pre-install, pre-upgrade | ||
"helm.sh/hook-weight": "0" | ||
"helm.sh/hook-delete-policy": before-hook-creation | ||
data: | ||
.dockerconfigjson: {{ template "imagePullSecret" . }} | ||
type: kubernetes.io/dockerconfigjson | ||
{{- end }} |
66 changes: 66 additions & 0 deletions
66
charts/backingservices/charts/constellation-messaging/templates/_supplemental.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{- /* | ||
imagePullSecret | ||
backingservicesRegistrySecret | ||
deploymentName | ||
tlssecretsnippet | ||
backingservices.gke.backendConfig | ||
podAffinity | ||
are copied from backingservices/templates/_supplemental.tpl because helm lint requires | ||
charts to render standalone. See: https://github.com/helm/helm/issues/11260 for more details. | ||
*/}} | ||
|
||
{{- define "imagePullSecret" }} | ||
{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.docker.registry.url (printf "%s:%s" .Values.docker.registry.username .Values.docker.registry.password | b64enc) | b64enc }} | ||
{{- end }} | ||
|
||
{{- define "backingservicesRegistrySecret" }} | ||
{{- $depName := printf "%s" (include "deploymentName" (dict "root" .root "defaultname" .defaultname )) -}} | ||
{{- $depName -}}-registry-secret | ||
{{- end }} | ||
|
||
{{- define "deploymentName" }}{{ $deploymentNamePrefix := .defaultname }}{{ if (.root.deployment) }}{{ if (.root.deployment.name) }}{{ $deploymentNamePrefix = .root.deployment.name }}{{ end }}{{ end }}{{ if (.root.name) }}{{ $deploymentNamePrefix = .root.name }}{{ end }}{{ $deploymentNamePrefix }}{{- end }} | ||
|
||
{{- define "tlssecretsnippet" -}} | ||
tls: | ||
- hosts: | ||
- {{ include "domainName" (dict "node" .node) }} | ||
secretName: {{ .node.ingress.tls.secretName }} | ||
{{- end -}} | ||
|
||
{{- define "domainName" }} | ||
{{- if .node.ingress -}} | ||
{{- if .node.ingress.domain -}} | ||
{{ .node.ingress.domain }} | ||
{{- end -}} | ||
{{- else if .node.service.domain -}} | ||
{{ .node.service.domain }} | ||
{{- end -}} | ||
{{- end }} | ||
|
||
|
||
{{- define "backingservices.gke.backendConfig" -}} | ||
apiVersion: cloud.google.com/v1 | ||
kind: BackendConfig | ||
metadata: | ||
name: {{ .name }} | ||
spec: | ||
timeoutSec: 40 | ||
connectionDraining: | ||
drainingTimeoutSec: 60 | ||
healthCheck: | ||
checkIntervalSec: 5 | ||
healthyThreshold: 1 | ||
port: {{ .healthCheckPort }} | ||
requestPath: {{ .requestPath }} | ||
timeoutSec: 5 | ||
type: HTTP | ||
unhealthyThreshold: 2 | ||
--- | ||
{{ end }} | ||
|
||
{{- define "podAffinity" }} | ||
{{- if .affinity }} | ||
affinity: | ||
{{- toYaml .affinity | nindent 2 }} | ||
{{- end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ackingservices/charts/constellation-messaging/templates/messaging-gke-backend-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- $depName := printf "%s" (include "deploymentName" (dict "root" .Values "defaultname" "constellation-messaging" )) }} | ||
{{- $requestPath := printf "%s/ping" .Values.urlPath }} | ||
{{- $srvPort := .Values.service.port }}{{ if .Values.pegaMessagingPort }}{{ $srvPort = .Values.pegaMessagingPort }}{{ end }} | ||
|
||
{{- if .Values.enabled }} | ||
{{- if (eq .Values.provider "gke") }} | ||
{{- if .Values.ingress.enabled }} | ||
{{ template "backingservices.gke.backendConfig" dict "root" .Values "name" $depName "requestPath" $requestPath "healthCheckPort" $srvPort }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...s/backingservices/charts/constellation-messaging/templates/messaging-registry-secret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{- if .Values.enabled }} | ||
{{- include "messagingRegistryCredentialsSecretTemplate" . }} | ||
{{ end }} |
28 changes: 21 additions & 7 deletions
28
charts/backingservices/charts/constellation-messaging/templates/messaging-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
{{ $depName := printf "%s" (include "deploymentName" (dict "root" .Values "defaultname" "constellation-messaging" )) }} | ||
{{- $srvTargetPort := .Values.service.targetPort }}{{ if .Values.pegaMessagingTargetPort }}{{ $srvTargetPort = .Values.pegaMessagingTargetPort }}{{ end }} | ||
{{- $srvPort := .Values.service.port }}{{ if .Values.pegaMessagingPort }}{{ $srvPort = .Values.pegaMessagingPort }}{{ end }} | ||
{{- if .Values.enabled }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Values.name }} | ||
name: {{ $depName }} | ||
labels: | ||
app: {{ .Values.name }} | ||
app: {{ $depName }} | ||
{{- if and (.Values.service) (.Values.service.annotations) }} | ||
annotations: | ||
# Custom annotations | ||
{{ toYaml .Values.service.annotation | indent 4 }} | ||
{{- else if (eq .Values.provider "gke") }} | ||
annotations: | ||
cloud.google.com/neg: '{"ingress": true}' | ||
cloud.google.com/app-protocols: '{"https":"HTTPS","http":"HTTP"}' | ||
cloud.google.com/backend-config: '{"ports": {"{{ $srvPort }}": "{{ $depName }}"}}' | ||
{{- end }} | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: {{ .Values.name }} | ||
app: {{ $depName }} | ||
ports: | ||
- protocol: TCP | ||
port: {{ .Values.pegaMessagingPort }} | ||
targetPort: {{ .Values.pegaMessagingTargetPort }} | ||
- name: http | ||
protocol: TCP | ||
port: {{ $srvPort }} | ||
targetPort: {{ $srvTargetPort }} | ||
type: {{ .Values.service.serviceType }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.