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

BUG-591266: add deployment name and rename tier-based objects. #242

Merged
merged 16 commits into from
Apr 22, 2021

Conversation

misterdorito
Copy link
Contributor

@misterdorito misterdorito commented Jan 28, 2021

Adding the ability to set an 'deployment' name. This environment name will be prepended to the tier names replacing "pega". This will impact the naming of all of the corresponding tier-centric objects (deployments, statefulsets, services, pods, ingresses, etc.).

The particular motivation for adding this is that currently the PDC service is unable to differentiate stream nodes within a given PDC tenant as all of the pod names are pega-stream-0 and pega-stream-1.

To leverage this ability, set global.deployment.name to the desired prefix. The prefix must consist of an DNS friendly identifier as it will be incorporated into a number of k8s object (which have this restriction). An example of a suitable value would be: "app1-dev".

The default if not specified will remain "pega".

@misterdorito misterdorito requested review from dcasavant and a team as code owners January 28, 2021 14:33
Updated doc with info on how to leverage environment name.
```yaml
global:
environment:
name: app1-dev-
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this tied into the global.domain parameter that is used for the hostname for this environment? It seems like it would be less confusing if the environment name value were derived from that value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No.

I am not familiar with global.domain (only global.tier[].ingress.domain). Can you point me at a reference?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry - I meant global.dnsname. I believe this is used for configuration for the ingress.
That said, I also noticed that there is a global.ingress.domain param. Can all of these be consolidated? It seems like they all could potentially be set to the same value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find a reference to 'dnsname' grepping through the project.

I do see a couple of 'domain' args:

  • global.tier[].ingress.domain
  • global.tier[].service.domain
  • global.tier[].domain

Though I'm inclined to say that we should not derive this from the domain used for ingress. My thought is that these names would be internal identifiers that don't necessarily relate to their public domain names. My intention in bringing up DNS naming conventions was to indicate the constraints on the names given:

https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names

(Don't want folks thinking they can include spaces and such.)

Copy link
Contributor

Choose a reason for hiding this comment

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

global.dnsname is referenced in the sce. @zitikay do you have any thoughts about this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, @misterdorito you added the dnsname param (in the SCE). I'm just trying to avoid the confusion of having similar parameters with slightly different uses.

How would you differentiate the following to a user?
global.tier[].ingress.domain
global.dnsname
global.environment.name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

global.dnsname: This is only used in the SCE and is largely need to work around the limited utility of the SCE tooling. It is internal to the SCE and among the things that I'd like to refactor out of existence -- as will probably happen soon given my understand of work to come in the near future (as there is need for multiple ingresses for different types of deployments.

I'd rather we did not derive these 'deployment.name'-s (see other comments below regarding the change of nomenclature) from ingress/dns names as I'd expect that these will be relatively short names use to distinguish deployments (mostly so that PDC is capable of reporting on stream nodes in client-managed cloud scenarios). I'd expect this not to be widely used if PDC is not a concern. For SCE deployments, this will not be used. And as there are no guarantees that multiple ingresses in the same deployment will have commonality in their domains.

@misterdorito
Copy link
Contributor Author

Should there be a - at the end? Or is that automatically incorporated?

Right now, yes there should be a '-' (global.environment.name: app1-dev-) the way it is coded currently. Happy to do either. Do you have a preference for adding the dash programmatically?

@misterdorito
Copy link
Contributor Author

Should we just apply this to search as well for consistency? Any reason not to do it?

I haven't tried, but it shouldn't be a problem.

@misterdorito
Copy link
Contributor Author

misterdorito commented Jan 29, 2021

wordsmithing for the description...that is an ACE example! nice job! ;-)
-->Specify an environment name that the deployment uses as a prefix to help differentiate this deployment in your environment. The deployment adds this prefix to the various Pega tiers and the associated k8s objects in your deployment. Your environment name must be a DNS-friendly name so the deployment can successfully add it to k8s object names. For example:

So, based on your wordsmithing above, I think it would be appropriate to change global.environment.name to global.deployment.name (reading you words above we're using environment in 2 different ways where the first one is really describing a deployment). With that in mind:

Specify a deployment name that is used to differentiate this deployment in your environment. This name will be prepended to the various Pega tiers and the associated k8s objects in your deployment. Your deployment name should be constrained to lowercase alphanumeric and '-' characters.

Thoughts?

Copy link
Contributor

@kishorv10 kishorv10 left a comment

Choose a reason for hiding this comment

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

@misterdorito

  • Are you not planning to add this entry in values.yaml?
  • Should we also append the env name to pega-credentials-secret.yaml, pega-registry-secret.yaml, pega-environment-config.yaml object names? Though this is not need for original requirement of this bug, but doing this would make things consistent. It also opens feature to deploy more than one pega helm releases in a single namespace
  • Should we deal with the - bit programmatically. As I understand, if environment name not ended with - would lead some cluttered output, very minor thing to care for.

@misterdorito
Copy link
Contributor Author

Should we just apply this to search as well for consistency? Any reason not to do it?

@dcasavant Looking a little more closely...

We could change this, but there is a minor wrinkle.... We'll have to change some the internal logic regarding isExternalSearch because some of this logic is based on the correlation between the pega-search service and the pegasearch.externalURL being hardcoded to http://pega-search in the values yaml.

Should be doable

@shashikant-koder
Copy link
Contributor

Hi @misterdorito ,
Did we test RollingUpdates scenario , as rolling updates command use tier name. ?

@misterdorito
Copy link
Contributor Author

@kishorv10

@misterdorito

  • Are you not planning to add this entry in values.yaml?
  • Should we also append the env name to pega-credentials-secret.yaml, pega-registry-secret.yaml, pega-environment-config.yaml object names? Though this is not need for original requirement of this bug, but doing this would make things consistent. It also opens feature to deploy more than one pega helm releases in a single namespace
  • Should we deal with the - bit programmatically. As I understand, if environment name not ended with - would lead some cluttered output, very minor thing to care for.

I've added global.deployment.name to values.yaml, and values-large.yaml. Wasn't planning on adding it to values-minimal.yaml, but I have no objection to adding it.

pega-credentials-secret.yaml, pega-registry-secret.yaml, pega-environment-config.yaml: added.

The charts are adding the dashes at this point.

@misterdorito
Copy link
Contributor Author

Hi @misterdorito ,
Did we test RollingUpdates scenario , as rolling updates command use tier name. ?

I haven't yet, but will take a look tomorrow. I may have questions for you.

@misterdorito misterdorito changed the title BUG-591266: add environment name and rename tier-based objects. BUG-591266: add deployment name and rename tier-based objects. Feb 17, 2021
@misterdorito
Copy link
Contributor Author

@shashikant-koder

Hi @misterdorito ,
Did we test RollingUpdates scenario , as rolling updates command use tier name. ?

I haven't yet, but will take a look tomorrow. I may have questions for you.

I have made changes to this PR to address this concern. I have tested them manually (helm template ... ) and they look correct to me. Please take a look.

@misterdorito
Copy link
Contributor Author

@dcasavant Do we want to rename the hazelcast service and constellation services as well?

@pega-embate
Copy link
Contributor

@misterdorito Is the new deployment name correlated with the namespace at all? I ask this because it sounds like PDC is using the namespace as a first lookup point to identify pods associated with a given customer (when problems are detected). I'm just trying to avoid having too many different ways to configure the name of an infinity deployment (looking at this from a support standpoint)

@misterdorito
Copy link
Contributor Author

@misterdorito Is the new deployment name correlated with the namespace at all? I ask this because it sounds like PDC is using the namespace as a first lookup point to identify pods associated with a given customer (when problems are detected). I'm just trying to avoid having too many different ways to configure the name of an infinity deployment (looking at this from a support standpoint)

Is deployment name correlated to namespace? No.

My understanding of the PDC is that within a given PDC tenant, hostnames need to be unique. I don't think it has any understanding of k8s namespaces at this point. In the past unique system names would have caused the stream nodes to be an issue, but according to the PDC folks there is a range of platform releases where info included in the alert format doesn't include system name. The PDC/stream tier uniqueness problem is only a CMC issue.

More flavor... Renaming the stream tier could be achieved by renaming the tier name for stream, but the PDC folks posed objections because some clients insisted on using the same values.yaml for multiple deployments of the platform. I can only surmise that they're passing in db connection info via cmd line args to helm.

@misterdorito misterdorito added the integ-all Label that triggers automation testing against EKS, AKS, GKE label Apr 20, 2021
@pegaautomationuser
Copy link
Collaborator

Starting PR-242 validation on -> integ-all

1 similar comment
@pegaautomationuser
Copy link
Collaborator

Starting PR-242 validation on -> integ-all

@pegaautomationuser
Copy link
Collaborator

Starting PR-242 validation on -> integ-all

1 similar comment
@pegaautomationuser
Copy link
Collaborator

Starting PR-242 validation on -> integ-all

@misterdorito
Copy link
Contributor Author

I have performed an out-of-place upgrade with the changes in this branch and it has worked as expected. None of the changes in this PR should impact an in-place upgrade.

Copy link
Contributor

@taz-pega-work taz-pega-work left a comment

Choose a reason for hiding this comment

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

I found a few areas that could be tweaked to improve the guidance.

charts/pega/README.md Outdated Show resolved Hide resolved
charts/pega/charts/pegasearch/templates/_helpers.tpl Outdated Show resolved Hide resolved
charts/pega/charts/pegasearch/values.yaml Show resolved Hide resolved
charts/pega/charts/pegasearch/values.yaml Outdated Show resolved Hide resolved
charts/pega/templates/_helpers.tpl Outdated Show resolved Hide resolved
@pegaautomationuser
Copy link
Collaborator

Starting PR-242 validation on -> integ-all

1 similar comment
@pegaautomationuser
Copy link
Collaborator

Starting PR-242 validation on -> integ-all

@pegaautomationuser
Copy link
Collaborator

Starting PR-242 validation on -> integ-all

1 similar comment
@pegaautomationuser
Copy link
Collaborator

Starting PR-242 validation on -> integ-all

Copy link
Contributor

@taz-pega-work taz-pega-work left a comment

Choose a reason for hiding this comment

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

I think there's just two small tweaks required in the first change...everything else reads well.

@@ -161,7 +161,7 @@ The default value is "pega" if it is unset.

## Tiers of a Pega deployment

Pega supports deployment using a multi-tier architecture to separate processing and functions. Isolating processing in its own tier also allows for unique deployment configuration such as its own prconfig, resource allocations, or scaling characteristics. Use the `tier` section in the helm chart to specify which tiers you wish to deploy and their logical tasks.
Pega supports deployments that a multi-tier architecture model that separates application processing from k8s functions. Isolating processing in its own tier supports unique deployment configurations, including the Pega application prconfig, resource allocations, and scaling characteristics. Use the tier section in the helm chart to specify which tiers you wish to deploy the tier with nodes dedicated to the logical tasks of the tier.
Copy link
Contributor

Choose a reason for hiding this comment

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

almost:
Pega supports deployments using a multi-tier architecture model that separates application processing from k8s functions. Isolating processing in its own tier supports unique deployment configurations, including the Pega application prconfig, resource allocations, and scaling characteristics. Use the tier section in the helm chart to specify into which tiers you wish to deploy the tier with nodes dedicated to the logical tasks of the tier.

@pegaautomationuser
Copy link
Collaborator

Starting PR-242 validation on -> integ-all

1 similar comment
@pegaautomationuser
Copy link
Collaborator

Starting PR-242 validation on -> integ-all

@misterdorito misterdorito merged commit 4f02e8d into master Apr 22, 2021
@misterdorito misterdorito deleted the BUG-591266-env-name branch April 22, 2021 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integ-all Label that triggers automation testing against EKS, AKS, GKE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants