Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ui integration #97

Merged
merged 63 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
3b8d63f
Added yaml for ui constellation
Dec 11, 2019
4b78e3e
Added pega.yaml that launches infinity and kubernetes together
anuds20 Jan 2, 2020
a63b1cc
Added the changes to accept DNode settings as Java arguments
anuds20 Jan 3, 2020
78d33ef
Added changes to establish communication between Infinity and Constel…
anuds20 Jan 10, 2020
9a099eb
Modified c11n ingress files to autodeploy the ingress path based rout…
anuds20 Jan 17, 2020
44e7c95
Resolved the constellation health check issue.
anuds20 Jan 20, 2020
8c90d1c
Added constellation deployment configuration to Infinity deployment c…
anuds20 Jan 22, 2020
d4fdb6a
Updated the comments in pega-environment-config and constellation val…
anuds20 Jan 22, 2020
1837cb9
Added yaml for ui constellation
Dec 11, 2019
9b2b22e
Added pega.yaml that launches infinity and kubernetes together
anuds20 Jan 2, 2020
c97bb49
Added the changes to accept DNode settings as Java arguments
anuds20 Jan 3, 2020
27ea74c
Added changes to establish communication between Infinity and Constel…
anuds20 Jan 10, 2020
20f9966
Modified c11n ingress files to autodeploy the ingress path based rout…
anuds20 Jan 17, 2020
f5bc6bd
Resolved the constellation health check issue.
anuds20 Jan 20, 2020
49b8810
Added constellation deployment configuration to Infinity deployment c…
anuds20 Jan 22, 2020
4659435
Updated the comments in pega-environment-config and constellation val…
anuds20 Jan 22, 2020
23ee19a
Added yaml for ui constellation
Dec 11, 2019
e7c3f35
Added pega.yaml that launches infinity and kubernetes together
anuds20 Jan 2, 2020
a2aaecd
Added the changes to accept DNode settings as Java arguments
anuds20 Jan 3, 2020
70f81c4
Added changes to establish communication between Infinity and Constel…
anuds20 Jan 10, 2020
c9b43cb
Modified c11n ingress files to autodeploy the ingress path based rout…
anuds20 Jan 17, 2020
7c5ff87
Resolved the constellation health check issue.
anuds20 Jan 20, 2020
79682d5
Added constellation deployment configuration to Infinity deployment c…
anuds20 Jan 22, 2020
8756f9a
Updated the comments in pega-environment-config and constellation val…
anuds20 Jan 22, 2020
f03ac4a
Merge branch 'master' of https://github.com/nikhilparmar86/pega-helm-…
Jan 24, 2020
69ef9c3
Changes based on PR review - 1
anuds20 Jan 28, 2020
2a34491
Temp
Feb 10, 2020
36c8a88
Merge branch 'ui_integration' of https://github.com/nikhilparmar86/pe…
Feb 10, 2020
2012f96
Added condition to create ingress for constellation
Feb 12, 2020
36120ec
EPIC:59563, US-345810 : Modified the constellation deployment to make…
anuds20 Feb 13, 2020
a4d3666
Reverted unwanted in addons values yaml.
anuds20 Feb 13, 2020
92e8602
Fixed Lint errors
Feb 14, 2020
28a2cba
Updated with master
Mar 9, 2020
5b74aed
Rebased with master
Mar 9, 2020
aeb07f4
Updated go tests to work with constellation service changes.
anuds20 Mar 11, 2020
c2d4096
Added constellation test.
anuds20 Mar 11, 2020
a16e392
Updated the package for constellation test.
anuds20 Mar 11, 2020
5e1790e
Removed redundant pegahelmcharts path
anuds20 Mar 16, 2020
297b636
Modified existing deployment config based on PR#97 comments.
anuds20 Mar 23, 2020
d92a67b
Merge remote-tracking branch 'upstream/master'
Mar 26, 2020
44b91dd
Merge branch 'master' into ui_integration
Mar 26, 2020
be5c5be
Upated based on PR comments
Mar 27, 2020
ae4ed65
Modified constellation tests.
anuds20 Apr 2, 2020
528e898
Merge branch 'ui_integration' of https://github.com/nikhilparmar86/pe…
anuds20 Apr 2, 2020
1f4bcfa
Updated constellation deployment charts based on the PR review comments.
anuds20 Apr 7, 2020
96394d2
Removed the infinity url parameter as constellation no longer require…
anuds20 Jun 5, 2020
37c411e
Added a placeholder for the image repo.
anuds20 Jun 8, 2020
a2ac157
Synced up the file with master.
anuds20 Jun 8, 2020
6fcbed6
Updated the constellation charts based on review comments.
anuds20 Jul 2, 2020
27319e2
Updated the constellation URI settings parameter and value.
anuds20 Jul 9, 2020
4441cb7
Update the constellation parameter in all values yaml files.
anuds20 Jul 9, 2020
9c67156
Modified the value of the constellation url and also modified the go …
anuds20 Jul 9, 2020
1c11427
Renamed the UI service to reflect the latest name COSMOS.
anuds20 Jul 9, 2020
5899d80
Fixed issues in templates.
anuds20 Jul 23, 2020
a500b0c
Reverted the cosmosUI change.
anuds20 Jul 23, 2020
0f22cd4
Reverted cosmosUI changes
Jul 23, 2020
a911a69
Updated the constellation service path based on PR comments.
anuds20 Jul 27, 2020
df44d88
Merge branch 'ui_integration' of https://github.com/nikhilparmar86/pe…
anuds20 Jul 27, 2020
79298c4
Modified the DSS settings as per PR review comments.
anuds20 Jul 30, 2020
023dbd3
Updated constellation tests.
anuds20 Jul 30, 2020
edbac0a
Minor changes based on feedback with Nigel.
dcasavant Aug 19, 2020
36c1d66
Fix yaml formatting
dcasavant Aug 19, 2020
da0b802
Incorporate code review feedback
dcasavant Aug 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions charts/pega/charts/constellation/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: v1
name: cosmosUI
version: 0.0.1
description: Pega Constellation UI service
appVersion: 8.5.0
34 changes: 34 additions & 0 deletions charts/pega/charts/constellation/templates/clln-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#Deploy only when the cosmosUI flag has been enabled in the values yaml.
{{ if and .Values.enabled (eq .Values.enabled true) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, we shouldn't check boolean value with eq operator.

kind: Deployment
apiVersion: apps/v1
metadata:
name: cosmosUI
labels:
app: cosmosUI
# component: cosmosUI
spec:
replicas: 1
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
selector:
matchLabels:
app: cosmosUI
# component: cosmosUI
template:
metadata:
labels:
app: cosmosUI
# component: cosmosUI
spec:
imagePullSecrets:
- name: {{ template "pegaRegistrySecret" }}
containers:
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
- name: cosmosUIUI
imagePullPolicy: {{ .Values.imagePullPolicy }}
image: {{ .Values.image }}
args:
- port=3000
- sync=true
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
- {{ .Values.logLevel }}
ports:
- containerPort: 3000
{{ end }}
19 changes: 19 additions & 0 deletions charts/pega/charts/constellation/templates/clln-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#Deploy only when the cosmosUI flag has been enabled in the values yaml.
{{ if and .Values.enabled (eq .Values.enabled true) }}
apiVersion: v1
kind: Service
metadata:
name: cosmosUI
labels:
app: cosmosUI
# component: cosmosUI
spec:
selector:
app: cosmosUI
# component: cosmosUI
ports:
- protocol: TCP
port: 3000
targetPort: 3000
type: NodePort
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
{{ end }}
7 changes: 7 additions & 0 deletions charts/pega/charts/constellation/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# Parameters for Constellation operation:
# Docker repos and tag for image
image: IMAGE_REPO_URL_HERE
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
# log level : error, warn, info, debug. use error for production
logLevel: info
enabled: false
4 changes: 4 additions & 0 deletions charts/pega/templates/_pega-deployment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ spec:
- name: REQUESTOR_PASSIVATION_TIMEOUT
value: "{{ .node.requestor.passivationTimeSec }}"
{{- end }}
{{ if and .root.Values.cosmosUI (eq .root.Values.cosmosUI.enabled true) }}
- name: COSMOS_SETTINGS
value: "{{ .node.cosmosUISettings }}"
{{- end }}
{{- if .custom }}
{{- if .custom.env }}
# Additional custom env vars
Expand Down
12 changes: 9 additions & 3 deletions charts/pega/templates/_pega-eks-ingress.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ spec:
# To access the below service, along with {{ .node.domain }}, alb http port also has to be provided in the URL.
- host: {{ template "domainName" dict "node" .node }}
http:
paths:
- backend:
serviceName: {{ .name }}
paths:
{{ if and .root.Values.cosmosUI (eq .root.Values.cosmosUI.enabled true) }}
- path: /prweb/cosmosUI
backend:
serviceName: cosmosUI
servicePort: 3000
{{ end }}
- backend:
serviceName: {{ .name }}
servicePort: {{ .node.service.port }}
---
{{- end }}
12 changes: 9 additions & 3 deletions charts/pega/templates/_pega-gke-ingress.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ spec:
# To access the below service, along with {{ .node.domain }}, http/https port also has to be provided in the URL.
- host: {{ template "domainName" dict "node" .node }}
http:
paths:
- backend:
serviceName: {{ .name }}
paths:
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
{{ if and .root.Values.cosmosUI (eq .root.Values.cosmosUI.enabled true) }}
- path: /prweb/cosmosUI
backend:
serviceName: cosmosUI
servicePort: 3000
{{ end }}
- backend:
serviceName: {{ .name }}
servicePort: {{ .node.service.port }}
---
{{- end }}
12 changes: 9 additions & 3 deletions charts/pega/templates/_pega-k8s-ingress.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ spec:
# To access the below service, along with {{ .node.domain }}, traefik http port also has to be provided in the URL.
- host: {{ template "domainName" dict "node" .node }}
http:
paths:
- backend:
serviceName: {{ .name }}
paths:
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
{{ if and .root.Values.cosmosUI (eq .root.Values.cosmosUI.enabled true) }}
- path: /prweb/cosmosUI
backend:
serviceName: cosmosUI
servicePort: 3000
{{ end }}
- backend:
serviceName: {{ .name }}
servicePort: {{ .node.service.port }}
---
{{- end }}
2 changes: 2 additions & 0 deletions charts/pega/templates/pega-environment-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ data:
CASSANDRA_NODES: "{{ include "cassandraNodes" . }}"
# Port to connect to cassandra with
CASSANDRA_PORT: "{{ .Values.dds.port }}"
# Pass cosmosUI URL as a Dynamic System Setting property of Pega Infinity.
COSMOS_SETTINGS: "Pega-UIEngine/CosmosServicesURI=/prweb/cosmosUI"
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
{{ end }}
10 changes: 9 additions & 1 deletion charts/pega/values-large.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ global:
# For GKE to use static IP for load balancer, use kubernetes.io/ingress.global-static-ip-name: <global-static-ip-name>
ssl_annotation:


replicas: 1
# Pass the cosmosUI url as a Dynamic System Setting to the infinity. Added only when Constellation is enabled.
cosmosUISettings: "Pega-UIEngine/CosmosServicesURI=/prweb/cosmosUI"
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
javaOpts: ""

pegaDiagnosticUser: ""
pegaDiagnosticPassword: ""

Expand Down Expand Up @@ -256,3 +258,9 @@ installer:
upgradeType: "in-place"
# Specify target rules schema for migration and upgrade
targetRulesSchema: ""

# Pega Constellation UI settings.
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
# Note : This node is for cosmosUI service whose purpose is to serve static content to applications.
# This is a feature currently under development and is to be used only with Pega versions 8.5 and above.
cosmosUI:
enabled: false
8 changes: 8 additions & 0 deletions charts/pega/values-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ global:
memRequest: "5Gi"
cpuLimit: 2
memLimit: "6Gi"
# Pass the cosmosUI url as a Dynamic System Setting to the infinity. Added only when Constellation is enabled.
cosmosUISettings: "Pega-UIEngine/CosmosServicesURI=/prweb/cosmosUI"
javaOpts: ""
initialHeap: "4096m"
maxHeap: "4096m"
Expand Down Expand Up @@ -113,3 +115,9 @@ pegasearch:
installer:
image: "YOUR_INSTALLER_IMAGE:TAG"
adminPassword: "ADMIN_PASSWORD"

# Pega Constellation UI settings.
# Note : This node is for cosmosUI service whose purpose is to serve static content to applications.
# This is a feature currently under development and is to be used only with Pega versions 8.5 and above.
cosmosUI:
enabled: false
9 changes: 8 additions & 1 deletion charts/pega/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ global:
# ssl_annotation:

replicas: 1
# Pass the cosmosUI url as a Dynamic System Setting to the infinity. Added only when Constellation is enabled.
cosmosUISettings: "Pega-UIEngine/CosmosServicesURI=/prweb/cosmosUI"
javaOpts: ""

pegaDiagnosticUser: ""
pegaDiagnosticPassword: ""

Expand Down Expand Up @@ -213,3 +214,9 @@ installer:
upgradeType: "in-place"
# Specify target rules schema for migration and upgrade
targetRulesSchema: ""

# Pega Constellation UI settings.
# Note : This node is for cosmosUI service whose purpose is to serve static content to applications.
# This is a feature currently under development and is to be used only with Pega versions 8.5 and above.
cosmosUI:
enabled: false
dcasavant marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions terratest/src/test/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions terratest/src/test/pega/deploy_with_constellation_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package pega

import (
"path/filepath"
"testing"

"github.com/gruntwork-io/terratest/modules/helm"
"github.com/stretchr/testify/require"
)

// set action execute to install
var cosmosUI_options = &helm.Options{
SetValues: map[string]string{
"global.provider": "k8s",
"global.actions.execute": "deploy",
"cosmosUI.enabled": "true",
},
}

// TestPegaStandardTierDeployment - Test case to verify the standard pega tier deployment.
// Standard tier deployment includes web deployment, batch deployment, stream statefulset, search service, hpa, rolling update, web services, ingresses and config maps
func TestPegaStandardTierDeploymentWithConstellation(t *testing.T) {
t.Parallel()
// Path to the helm chart we will test
helmChartPath, err := filepath.Abs(PegaHelmChartPath)
require.NoError(t, err)

VerifyPegaStandardTierDeployment(t, helmChartPath, cosmosUI_options, []string{"wait-for-pegasearch", "wait-for-cassandra"})
}
51 changes: 51 additions & 0 deletions terratest/src/test/pega/deployment_utility.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ func VerifyPegaStandardTierDeployment(t *testing.T, helmChartPath string, option
// Verify search service
VerifySearchService(t, helmChartPath, options)

if options.SetValues["cosmosUI.enabled"] == "true" {
// Verify cosmosUI service
VerifyConstellationService(t, helmChartPath, options)
}

// Verfiy Pega deployed services
SplitAndVerifyPegaServices(t, helmChartPath, options)

Expand Down Expand Up @@ -123,6 +128,17 @@ func VerifyDeployment(t *testing.T, pod *k8score.PodSpec, expectedSpec pegaDeplo
require.Equal(t, pod.Containers[0].Env[envIndex].Name, "REQUESTOR_PASSIVATION_TIMEOUT")
require.Equal(t, expectedSpec.passivationTimeout, pod.Containers[0].Env[envIndex].Value)
}
if options.SetValues["cosmosUI.enabled"] == "true" && expectedSpec.name == "pega-web" {
envIndex++
require.Equal(t, pod.Containers[0].Env[envIndex].Name, "COSMOS_SETTINGS")
require.Equal(t, "Pega-UIEngine/CosmosServicesURI=/prweb/cosmosUI", pod.Containers[0].Env[envIndex].Value)
}

if options.SetValues["cosmosUI.enabled"] == "true" && expectedSpec.name != "pega-web" {
envIndex++
require.Equal(t, pod.Containers[0].Env[envIndex].Name, "COSMOS_SETTINGS")
require.Equal(t, "", pod.Containers[0].Env[envIndex].Value)
}
envIndex++
require.Equal(t, pod.Containers[0].Env[envIndex].Name, "JAVA_OPTS")
require.Equal(t, pod.Containers[0].Env[envIndex].Value, "")
Expand Down Expand Up @@ -277,6 +293,14 @@ func VerifyPegaIngress(t *testing.T, ingressObj *k8sv1beta1.Ingress, expectedIng
VerifyGKEIngress(t, ingressObj, expectedIngress)
} else if provider == "aks" {
VerifyAKSIngress(t, ingressObj, expectedIngress)
} else if provider != "eks" && options.SetValues["cosmosUI.enabled"] == "false" {
VerifyK8SIngress(t, ingressObj, expectedIngress)
} else if provider != "aks" && options.SetValues["cosmosUI.enabled"] == "false" {
VerifyAKSIngress(t, ingressObj, expectedIngress)
} else if provider != "gke" && options.SetValues["cosmosUI.enabled"] == "false" {
VerifyGKEIngress(t, ingressObj, expectedIngress)
} else if options.SetValues["cosmosUI.enabled"] == "true" {
VerifyK8SIngressWithConstellationEnabled(t, ingressObj, expectedIngress)
} else {
VerifyK8SIngress(t, ingressObj, expectedIngress)
}
Expand Down Expand Up @@ -321,6 +345,21 @@ func VerifyK8SIngress(t *testing.T, ingressObj *k8sv1beta1.Ingress, expectedIngr
require.Equal(t, expectedIngress.Port, ingressObj.Spec.Rules[0].HTTP.Paths[0].Backend.ServicePort)
}

// VerifyPegaIngressWithConstellationEnabled - Performs Pega Ingress assertions with the values as provided in default values.yaml when the cosmosUI service is enabled.
func VerifyK8SIngressWithConstellationEnabled(t *testing.T, ingressObj *k8sv1beta1.Ingress, expectedIngress pegaIngress) {
if ingressObj.Spec.Rules[0].HTTP.Paths[0].Backend.ServiceName == "cosmosUI" {
require.Equal(t, "traefik", ingressObj.Annotations["kubernetes.io/ingress.class"])
require.Equal(t, "/prweb/cosmosUI", ingressObj.Spec.Rules[0].HTTP.Paths[0].Path)
require.Equal(t, "cosmosUI", ingressObj.Spec.Rules[0].HTTP.Paths[0].Backend.ServiceName)
require.Equal(t, intstr.FromInt(3000), ingressObj.Spec.Rules[0].HTTP.Paths[0].Backend.ServicePort)
require.Equal(t, expectedIngress.Name, ingressObj.Spec.Rules[0].HTTP.Paths[1].Backend.ServiceName)
require.Equal(t, expectedIngress.Port, ingressObj.Spec.Rules[0].HTTP.Paths[1].Backend.ServicePort)
} else {
require.Equal(t, expectedIngress.Name, ingressObj.Spec.Rules[0].HTTP.Paths[0].Backend.ServiceName)
require.Equal(t, expectedIngress.Port, ingressObj.Spec.Rules[0].HTTP.Paths[0].Backend.ServicePort)
}
}

// VerifySearchService - Verifies search service deployment used by search pod with the values as provided in default values.yaml
func VerifySearchService(t *testing.T, helmChartPath string, options *helm.Options) {

Expand All @@ -334,6 +373,18 @@ func VerifySearchService(t *testing.T, helmChartPath string, options *helm.Optio
require.Equal(t, searchServiceObj.Spec.Ports[0].TargetPort, intstr.FromInt(9200))
}

// VerifyConstellationService - Verifies cosmosUI service deployment used by cosmosUI pod with the values as provided in default values.yaml
func VerifyConstellationService(t *testing.T, helmChartPath string, options *helm.Options) {

cosmosUIService := helm.RenderTemplate(t, options, helmChartPath, []string{"charts/cosmosUI/templates/clln-service.yaml"})
var cosmosUIServiceObj k8score.Service
helm.UnmarshalK8SYaml(t, cosmosUIService, &cosmosUIServiceObj)
require.Equal(t, cosmosUIServiceObj.Spec.Selector["app"], "cosmosUI")
// require.Equal(t, cosmosUIServiceObj.Spec.Ports[0].Protocol, "TCP")
require.Equal(t, cosmosUIServiceObj.Spec.Ports[0].Port, int32(3000))
require.Equal(t, cosmosUIServiceObj.Spec.Ports[0].TargetPort, intstr.FromInt(3000))
}

// VerifyEnvironmentConfig - Verifies the environment configuration used by the pods with the values as provided in default values.yaml
func VerifyEnvironmentConfig(t *testing.T, helmChartPath string, options *helm.Options) {

Expand Down