Deploying Elastic Path Commerce
After the infrastructure is setup, you are ready to start deploying Elastic Path Commerce.
Prerequisites
Ensure that you complete the following tasks before proceeding to deploy an Elastic Path Commerce environment using CloudOps for Kubernetes:
- Complete the CloudOps for Kubernetes bootstrap process and post-bootstrap tasks
- Build the required Elastic Path Commerce artifacts
- Deploy the Apache ActiveMQ service
- Create and populate the Elastic Path Commerce database
For more information about these prerequisites, including any links to the required documentation, see the Deploy Commerce Overview section.
Deploying Elastic Path Commerce
Run the Jenkins job deploy-or-delete-commerce-stack
with the following parameters:
plan_mode
When selected, this runs Terraform in plan mode and prompts you to approve changes before you continue. This works in both the deploy and delete modes.
deleteStack
When selected, this deletes the stack instead of creating it.
epStackResourcingProfile
The resourcing profile of your ep-stack
.
restartApps
By default, when you update an Elastic Path Commerce deployment with the same image tag, deployments are not restarted. To restart the Elastic Path Commerce deployments, set this parameter to true
.
cloudOpsForKubernetesRepoURL
The Git repository URL of the cloudops-for-kubernetes
code.
cloudOpsForKubernetesBranch
The branch of cloudops-for-kubernetes
to use.
epEnvironment
The type of environment and configuration of your ep-stack
, such as CI, production or staging.
dockerImageTag
The tag of the ep-app Docker images to use.
includeMockService
Create, update, or delete the Wiremock (mock
) service. Wiremock is a tool used in Elastic Path Commerce development and test environments. For more information about the Wiremock service, see the Elastic Path Commerce Git repository, under <ep-commerce>/extensions/http-mock-server
.
kubernetesNickname
This job uses the value of kubernetesNickname
as the Kubernetes namespace where the Elastic Path Commerce stack is deployed, and in the domain name of the Elastic Path Commerce stack. This nickname must match the nickname used by the populated MySQL database and ActiveMQ services that you previously deployed and want the Elastic Path Commerce stack to use.
If you specify a nickname and namespace value where an Elastic Path Commerce stack is already deployed, then that stack will be updated.
includeIngresses
Creates or deletes Ingresses to allow connections from the network CIDR values in allowedCIDRs
.
allowedCIDRs
The network CIDR allowed to access the Commerce stack. Ignore this parameter if createIngresses
is false.
The network CIDR the Ingresses allow to access the cortex studio app service. Ignore this parameter if createIngresses
is false.
TF_VAR_enable_firewall_rules
You can attach the Commerce stack to the AWS Web Application Firewall for the Elastic Path Commerce and Account Management services. Deploy CloudOps for Kubernetes with the parameter TF_VAR_aws_enable_commerce_am_waf
set to true
in the Docker Compose configuration file, docker-compose.yml
.
If TF_VAR_enable_firewall_rules
is set, the web application firewall service is applied to the Commerce stack services. The firewall is also updated to allow the CIDRs in allowedCIDRs
access to the Commerce stack services.
includeHorizontalPodAutoscalers
Creates or deletes horizontal pod autoscalers. It automatically scales the number of pods in the deployment based on CPU usage. The default setting is false.
includeDeploymentInfoPage
Creates or deletes a page displaying the cluster details, database details and links to the deployed applications. The default setting is false
.
enableUITests
If set to true
, UI tests are enabled for the deployment. The default setting is false
.
epChangesetsEnabled
If it is set to true
, it enables changeset for deployment. The default setting is false
.
deployDstWebapp
Deploys or deletes the Data Sync tool webapp. The Data Sync Tool (DST) can only be deployed if epChangesetsEnabled is true
and the stack is Elastic Path Commerce 7.5 or later.
kubernetesTargetNickname
The Kubernetes namespace of the target database that the DST pushes changes to. Leave empty if deployDstWebapp
is set to false
.
dnsZoneName
The domainName
set in the docker-compose.yml file used during bootstrap. If the DNS settings for the domain are manually configured, the dnsZoneName
can be overridden.
clusterName
The name of the Kubernetes cluster to deploy the ep-stack into. The clusterName
is also the name of the A record and part of the full DNS name of the ep-stack.
includeAWSSES
If the cloud platform is AWS, when checked, the job deploys the Elastic Path Commerce stack with AWS Simple Email Service (SES) email settings. This job only can run if setup-AWS-SES
is run beforehand with the same kubernetesNickname
value.
smtpHost
If the cloud platform is Azure or includeAWSSES
is false and you want to use an external SMTP server, provide the address of the external SMTP server. For example, if you are using SendGrid as an SMTP service provider, the value would be smtp.sendgrid.net
.
smtpPort
If the cloud platform is Azure or includeAWSSES
is false and you want to use an external SMTP server, provide the port number of the external SMTP server. Do not set this value to 25
as Azure blocks outgoing connections on port 25
. For example, if you are using SendGrid as an SMTP service provider, you could enter a value of 587
.
smtpScheme
If the cloud platform is Azure or includeAWSSES
is false and you want to use an external SMTP server, provide the scheme of the connection to the external SMTP server.
Use one of the following schemes when connecting to the SMTP server:
smtp
: for a plaintext SMTP connectionsmtps
: for SMTP wrapped in SSL
smtpUser
If the cloud platform is Azure or includeAWSSES
is false and you want to use an external SMTP server, provide the username for the connection to the external SMTP server.
smtpPass
If the cloud platform is Azure or includeAWSSES
is false and you want to use an external SMTP server, provide the password for the connection to the external SMTP server.
enableJmx
This enables connecting to the app JMX ports. The default setting is false. For more information about connecting to JMX see the troubleshooting section.
enableJmxAuth
This enables JMX user and password authentication and generates a unique user and password combination that is added to the ConfigMap for the Elastic Path Commerce deployment. The default setting is false. For more information about connecting to JMX see the troubleshooting section.
enableDebug
This enables connecting to the application Java Virtual Machine (JVM) debug ports with the remote debugger of your IDE. The default setting is false
.
Deployment Options
Creating Ingresses
This option deploys Elastic Path Commerce with Ingresses that whitelist a CIDR in the parameter allowedCIDRs
. The default value 127.0.0.1/32 in allowedCIDRs
blocks all public access. The Elastic Path stack won’t allow incoming connections. You cannot access your applications through the DNS endpoints unless Ingresses are created and your CIDR is in the job parameter allowedCIDRs
.
warning
Attempting to create Ingresses with no value in allowedCIDRs
results in a failed deployment. We recommend testing that the annotation is working correctly.
Create Horizontal Pod Autoscalers
This option deploys an Elastic Path stack with Horizontal Pod Autoscalers. For more information, see Horizontal Pod Autoscalers.
Create a deployment information page
This option deploys a deployment information page. The deployment information page display Kubernetes cluster details, database details, and links to the deployed applications. For more information, see the Example Information Page image.
warning
The deployment information page is not secured beyond IP whitelisting. It is intended for use with test environments. Do not deploy alongside production environments.
Choosing to create the Deployment Information Page exposes the ActiveMQ admin console to the public internet according to the whitelist-source-range set during configuration, with no additional security.
The path to the information page from root DNS for your deployment is defined as ${kubernetesNickname}.commerce${clusterName}.${dnsZoneName}/
.
Deploy with UI tests enabled
This option deploys Elastic Path Commerce with UI Tests enabled.
Deploy with change sets enabled
This option deploys Elastic Path Commerce with change sets enabled.
Deploy the Data Sync Tool
This option deploys the Data Sync Tool (DST) as a command-line tool and as a Java application. The DST can only deploy as a Java application on Elastic Path version 7.5 or later. Deploying the DST requires values for the kubernetesTargetNickname
parameter.
For more information about the Data Sync Tool, see Elastic Path Production Tools.
Deploy with JMX enabled
This option allows connections to JMX for the Elastic Path Commerce applications with a Java profiler. For more information, see Connecting to the Applications JVMs.
Deploy with debug enabled
This option allows connections to the JVM in debug mode from your IDE. For more information, see Connecting to the Applications JVMs.
Deploy with different resourcing profiles
This option deploys an Elastic Path stack under a specific resourcing profile. The default resourcing profile in the CI pipeline is prod-small
. Details on the resource assigned for each application are under each resourcing profile defined in cloudops-for-kubernetes/terraform/ep-stack/deployments-and-services.tf
.
Deploy with different Ambassador gateway timeouts
By default, an Elastic Path stack is deployed with gateway timeouts. The timeouts are set to ten seconds for the Cortex service and three seconds for the other services.
To adjust the timeout values:
Edit the timeout values in the
cloudops-for-kubernetes/terraform/commerce-stack/commerce-mappings.yaml.tmpl
file.For more information on the different timeout values, see Timeouts.
Commit and push these changes to your Git repository.
Deploy or update an Elastic Path stack with the
cloudOpsForKubernetesBranch
parameter set to the Git branch with the gateway timeout changes that you want.
Validating Deployment
The deploy-or-delete-commerce-stack
job can take approximately 15-30 minutes to complete as it waits for the stack to become available.
Procedure
Open the Kubernetes dashboard and select the namespace you used when you ran the
deploy-or-delete-commerce-stack
Jenkins job.tip
If you require, use the directions to login to the dashboard: Accessing Kubernetes Dashboard.
note
During the stack startup, Deployments, Services, and Pods in the Kubernetes dashboard show an error that the readiness probes are failing. These error messages are normal during startup and go away as the services become available.
Validate that the following Deployments are present:
ep-activemq-deployment
ep-cm-deployment
ep-integration-deployment
ep-searchmaster-deployment
ep-searchslave-deployment
ep-cortex-deployment
ep-batch-deployment
ep-data-sync-deployment
(ifdeployDstWebapp
is true)
Validate that the following Services are present:
ep-activemq-service
ep-cm-service
ep-integration-service
ep-searchmaster-service
ep-searchslave-service
ep-cortex-service
ep-batch-service
ep-data-sync-service
(ifdeployDstWebapp
is true)
If
deployDstWebapp
is true, validate that a secret namedtarget-database-secrets
exists.Run the
run-cortex-system-tests
Jenkins job on the stack to validate that the Elastic Path stack is operational.For more information about the job, see the
run-cortex-system-tests
job section.
URL reference
The Elastic Path stack URL is created from the kubernetesNickname
, clusterName
, and dnsZoneName
parameters. This is used to create a fully qualified name for each service. For example, if clusterName
= jDoeCluster, dnsZoneName
= epcloud.mycompany.com and kubernetesNickname
= dev the fully qualified domain name is dev.commercejDoeCluster.epcloud.mycompany.com
.
The following table is a sample of the generated URL using the kubernetesNickname
= dev, clustername
= jDoeCluster and dnsZoneName
= epcloud.mycompany.com:
Service | Example URL |
---|---|
Info Page | dev.commercejDoeCluster.epcloud.mycompany.com |
Cortex | dev.commercejDoeCluster.epcloud.mycompany.com/cortex |
Commerce Manager | dev.commercejDoeCluster.epcloud.mycompany.com/cm/ |
Integration Server | dev.commercejDoeCluster.epcloud.mycompany.com/integration |