Skip to content

Commit

Permalink
Merge branch 'master' into feature/clustering-service-name
Browse files Browse the repository at this point in the history
  • Loading branch information
alemax22 authored Nov 26, 2024
2 parents 74d3270 + 39f5b55 commit 3b92ee0
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 27 deletions.
2 changes: 1 addition & 1 deletion charts/addons/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: addons
version: "3.24.10"
version: "3.25.0"
2 changes: 1 addition & 1 deletion charts/backingservices/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ description: Helm Chart to provision the latest Search and Reporting Service (SR
# The chart version: Pega provides this as a useful way to track changes you make to this chart.
# As a best practice, you should increment the version number 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: "3.24.10"
version: "3.25.0"
64 changes: 42 additions & 22 deletions charts/backingservices/charts/srs/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion charts/pega/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v1
name: pega
version: "3.24.10"
version: "3.25.0"
description: Pega installation on kubernetes
keywords:
- pega
Expand Down
2 changes: 1 addition & 1 deletion charts/pega/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ global:

## JDBC Configuration

Use the `jdbc` section of the values file to specify how to connect to the Pega database. Pega must be installed to this database before deploying on Kubernetes.
Use the `jdbc` section of the values file to specify how to connect to the Pega database. Pega must be installed to this database before deploying on Kubernetes. For more information about supported databases and jdbc driver versions, see the [Platform Support Guide](https://docs.pega.com/bundle/platform/page/platform/deployment/platform-support-guide/platform-support-guide.html)

### URL and Driver Class
These required connection details will point Pega to the correct database and provide the type of driver used to connect. Examples of the correct format to use are provided below.
Expand Down
6 changes: 6 additions & 0 deletions charts/pega/templates/_pega-deployment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ spec:
# Additional custom ports
{{ toYaml .custom.ports | indent 8 }}
{{- end }}
{{- end }}
{{- if .custom }}
{{- if .custom.containerLifecycleHooks }}
lifecycle:
{{ toYaml .custom.containerLifecycleHooks | indent 10 }}
{{- end }}
{{- end }}
# Specify any of the container environment variables here
env:
Expand Down
2 changes: 1 addition & 1 deletion docs/Deploying-Pega-on-EKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ To configure the parameters in the backingservices.yaml file, download the file
| global.imageCredentials.registry: username: password: | Include the URL of your Docker registry along with the registry “username” and “password” credentials. | <ul><li>url: “\<URL of your registry>” </li><li>username: "\<Registry account username\>"</li><li> password: "\<Registry account password\>"</li></ul> |
| global.k8sProvider: | Specify the value of your Kubernetes provider. | k8sProvider: "eks" |
| srs.deploymentName: | Specify unique name for the deployment based on org app and/or SRS applicable environment name. | deploymentName: "acme-demo-dev-srs" |
| srs.srsRuntime.srsImage: | Specify the Pega-provided SRS Docker image that you downloaded and pushed to your Docker registry. To run SRS with AWS OpenSearch Elasticsearch 7.10, use the dedicated `platform-services/search-n-reporting-service-aws` Docker image. | srs.srsRuntime.srsImage: "\<Registry host name:Port>my-pega-srs:\<srs-version>". For `<srs-version>` tag details, see [SRS Version compatibility matrix](../charts/backingservices/charts/srs/README.md#srs-version-compatibility-matrix). |
| srs.srsRuntime.srsImage: | Specify the Pega-provided SRS Docker image that you downloaded and pushed to your Docker registry. To run SRS with Elasticsearch, use the general `platform-services/search-n-reporting-service` Docker image. To run SRS with AWS-managed OpenSearch service, use the dedicated `platform-services/search-n-reporting-service-os` Docker image. | srs.srsRuntime.srsImage: "\<Registry host name:Port>my-pega-srs:\<srs-version>". For `<srs-version>` tag details, see [SRS Version compatibility matrix](../charts/backingservices/charts/srs/README.md#srs-version-compatibility-matrix). |
| srs.srsRuntime.imagePullSecretNames: | Specify any pre-existing image pull secrets required to pull images from your organization's registry. (Optional) | imagePullSecretNames: [secret1, secret2] |
| srs.srsStorage.provisionInternalESCluster: | Enabled by default to provision an Elasticsearch cluster. | <ul><li>Set srs.srsStorage.provisionInternalESCluster:`true` and run `$ make es-prerequisite NAMESPACE=<NAMESPACE_USED_FOR_DEPLOYMENT> ELASTICSEARCH_VERSION=<ELASTICSEARCH_VERSION>
`</li><li>Set srs.srsStorage.provisionInternalESCluster:`false` if you want to use an existing, externally provisioned ElasticSearch cluster. </li></ul> |
Expand Down
23 changes: 23 additions & 0 deletions terratest/src/test/pega/data/values_custom_lifecycle_hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
global:
tier:
- name: "web"
nodeType: "WebUser"
requestor:
passivationTimeSec: 900
replicas: 1
deploymentStrategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
livenessProbe:
port: 8081
# Values for test - web
custom:
containerLifecycleHooks:
preStop:
exec:
command:
- sleep
- '15'
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package pega

import (
"github.com/gruntwork-io/terratest/modules/helm"
"github.com/stretchr/testify/require"
appsv1 "k8s.io/api/apps/v1"
"path/filepath"
"strings"
"testing"
)

func TestPegaDeploymentWithLifecycleHooks(t *testing.T) {
var supportedVendors = []string{"k8s"}
var supportedOperations = []string{"deploy", "install-deploy", "upgrade-deploy"}
var deploymentNames = []string{"pega", "myapp-dev"}

helmChartPath, err := filepath.Abs(PegaHelmChartPath)
require.NoError(t, err)

for _, vendor := range supportedVendors {
for _, operation := range supportedOperations {
for _, depName := range deploymentNames {
var options = &helm.Options{
ValuesFiles: []string{"data/values_custom_lifecycle_hooks.yaml"},
SetValues: map[string]string{
"global.deployment.name": depName,
"global.provider": vendor,
"global.actions.execute": operation,
"installer.upgrade.upgradeType": "zero-downtime",
},
}
deploymentYaml := RenderTemplate(t, options, helmChartPath, []string{"templates/pega-tier-deployment.yaml"})
yamlSplit := strings.Split(deploymentYaml, "---")
assertWeb(t, yamlSplit[1], options)
assertLifecycleHook(t, yamlSplit[1], options)
}
}
}
}

func assertLifecycleHook(t *testing.T, tierYaml string, options *helm.Options) {
var deploymentObj appsv1.Deployment
UnmarshalK8SYaml(t, tierYaml, &deploymentObj)
pod := deploymentObj.Spec.Template.Spec
require.Equal(t, 1, len(pod.Containers))
require.Equal(t, "pega-web-tomcat", pod.Containers[0].Name)
require.Equal(t, "pegasystems/pega", pod.Containers[0].Image)
require.Equal(t, []string{"sleep", "15"}, pod.Containers[0].Lifecycle.PreStop.Exec.Command)
}

0 comments on commit 3b92ee0

Please sign in to comment.