Skip to content

Commit

Permalink
Updated documentation of constellation and constellation messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Cattapan committed Jun 4, 2024
1 parent 9131501 commit 75ff1e3
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 19 deletions.
12 changes: 8 additions & 4 deletions charts/backingservices/charts/constellation-messaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ Complete information on the design of the service including architecture, scalab
| Configuration | Usage |
|-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `enabled` | Enable the Messaging Service deployment as a backing service. Set this parameter to `true` to deploy the service. |
| `name` | Specify the name of your messaging service. Your deployment creates resources prefixed with this string. |
| `imagePullSecretNames` | List pre-existing secrets to be used for pulling docker images. |
| `pegaMessagingPort` | Defines the port used by the Service. |
| `pegaMessagingTargetPort` | Defines the port used by the Pod and Container. |
| `name` | Deprecated, use `deployment.name`. Specify the name of your messaging service. Your deployment creates resources prefixed with this string. |
| `deployment.name` | Specify the name of your messaging service. Your deployment creates resources prefixed with this string. |
| `imagePullSecretNames` | Deprected, use `docker.imagePullSecretNames`. List pre-existing secrets to be used for pulling docker images. |
| `docker.imagePullSecretNames` | List pre-existing secrets to be used for pulling docker images. |
| `pegaMessagingPort` | Deprecated, use `service.port`. Defines the port used by the Service. |
| `service.port` | Defines the port used by the Service. |
| `pegaMessagingTargetPort` | Deprecated, use `service.targetPort`. Defines the port used by the Pod and Container. |
| `service.targetPort` | Defines the port used by the Pod and Container. |
| `ingress` | Allows optional configuration of a domain name, ingressClass, and annotations. An ingress will be provisioned if a domain name is supplied. Due to the diversity of network configurations, ingress vendors, and TLS requirements it may be necessary to define your ingress separately from this chart.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $depName := printf "%s" (include "deploymentName" (dict "root" .Values "defaultname" "constellation-messaging" )) }}
{{- $srvTargetPort := .Values.service.targetPort }}{{ if .Values.pegaMessagingTargetPort }}{{ $srvTargetPort = .Values.pegaMessagingTargetPort }}{{ end }}
{{- if .Values.enabled }}
kind: Deployment
apiVersion: apps/v1
Expand All @@ -22,14 +23,18 @@ spec:
{{- range .Values.docker.imagePullSecretNames }}
- name: {{ . }}
{{- end }}
{{ else if .Values.imagePullSecretNames }}
{{- range .Values.imagePullSecretNames }}
- name: {{ . }}
{{- end }}
{{ end }}
containers:
- name: {{ $depName }}
imagePullPolicy: {{ .Values.docker.imagePullPolicy }}
imagePullPolicy: {{ .Values.docker.messaging.imagePullPolicy }}
image: {{ .Values.docker.messaging.image }}
args:
- --max-semi-space-size=1024
- port={{ .Values.service.targetPort }}
- port={{ $srvTargetPort }}
- path={{ .Values.urlPath }}
livenessProbe:
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
Expand All @@ -39,7 +44,7 @@ spec:
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
httpGet:
path: {{ .Values.urlPath }}/ping
port: {{ .Values.service.targetPort }}
port: {{ $srvTargetPort }}
readinessProbe:
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
Expand All @@ -48,7 +53,7 @@ spec:
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
httpGet:
path: {{ .Values.urlPath }}/ping
port: {{ .Values.service.targetPort }}
port: {{ $srvTargetPort }}
ports:
- containerPort: {{ .Values.service.targetPort }}
- containerPort: {{ $srvTargetPort }}
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{- $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") }}
{{ template "backingservices.gke.backendConfig" dict "root" .Values "name" $depName "requestPath" $requestPath }}
{{ template "backingservices.gke.backendConfig" dict "root" .Values "name" $depName "requestPath" $requestPath "healthCheckPort" $srvPort }}
{{ end }}
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $depName := printf "%s" (include "deploymentName" (dict "root" .Values "defaultname" "constellation-messaging" )) }}
{{- $srvPort := .Values.service.port }}{{ if .Values.pegaMessagingPort }}{{ $srvPort = .Values.pegaMessagingPort }}{{ end }}
{{- if .Values.enabled }}
{{- if and (.Values.ingress) (eq .Values.ingress.enabled true) }}
apiVersion: networking.k8s.io/v1
Expand All @@ -23,7 +24,7 @@ spec:
service:
name: {{ $depName }}
port:
number: {{ .Values.service.port }}
number: {{ $srvPort }}
{{ if (.Values.ingress.tls) }}
{{- if (eq .Values.ingress.tls.enabled true) }}
{{- if .Values.ingress.tls.secretName }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{ $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
Expand All @@ -14,15 +16,15 @@ metadata:
annotations:
cloud.google.com/neg: '{"ingress": true}'
cloud.google.com/app-protocols: '{"https":"HTTPS","http":"HTTP"}'
cloud.google.com/backend-config: '{"ports": {"{{ .Values.service.port }}": "{{ $depName }}"}}'
cloud.google.com/backend-config: '{"ports": {"{{ $srvPort }}": "{{ $depName }}"}}'
{{- end }}
spec:
selector:
app: {{ $depName }}
ports:
- name: http
protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
port: {{ $srvPort }}
targetPort: {{ $srvTargetPort }}
type: {{ .Values.service.serviceType }}
{{ end }}
2 changes: 1 addition & 1 deletion charts/backingservices/charts/constellation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ replicas: 1

```
##### Liveness, readiness, and startup probes
##### Liveness and readiness probes
Constellation uses liveness, readiness, and startup probes to determine application health in your deployments. For an overview of these probes, see [Configure Liveness, Readiness and Startup Probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/). Configure a probe for *liveness* to determine if a Pod has entered a broken state; configure it for *readiness* to determine if the application is available to be exposed; configure it for *startup* to determine if a pod is ready to be checked for liveness. You can configure probes independently for each tier. If not explicitly configured, default probes are used during the deployment. Set the following parameters as part of a `livenessProbe`, `readinessProbe`, or `startupProbe` configuration.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

{{- if .Values.enabled }}
{{- if or (eq .Values.provider "gke") (eq .Values.cloudProvider "gke") }}
{{ template "backingservices.gke.backendConfig" dict "root" .Values "name" $depName "requestPath" $requestPath }}
{{ template "backingservices.gke.backendConfig" dict "root" .Values "name" $depName "requestPath" $requestPath "healthCheckPort" .Values.service.port }}
{{ end }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
healthCheck:
checkIntervalSec: 5
healthyThreshold: 1
port: 3000
port: {{ .healthCheckPort }}
requestPath: {{ .requestPath }}
timeoutSec: 5
type: HTTP
Expand Down
2 changes: 1 addition & 1 deletion charts/backingservices/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{- $depName -}}-registry-secret
{{- end }}

{{- define "deploymentName" }}{{ $deploymentNamePrefix := .defaultname }}{{ if (.root.deployment) }}{{ if (.root.deployment.name) }}{{ $deploymentNamePrefix = .root.deployment.name }}{{ end }}{{ end }}{{ $deploymentNamePrefix }}{{- 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:
Expand Down
3 changes: 2 additions & 1 deletion charts/backingservices/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ constellation:

constellation-messaging:
enabled: false
name: YOUR_MESSAGING_SERVICE_DEPLOYMENT_NAME
deployment:
name: YOUR_MESSAGING_SERVICE_DEPLOYMENT_NAME
image: YOUR_MESSAGING_SERVICE_IMAGE:TAG
replicas: 1

Expand Down

0 comments on commit 75ff1e3

Please sign in to comment.