Testing CloudOps for Kubernetes
CloudOps for Kubernetes includes several Jenkins pipelines that run through a complete CloudOps for Kubernetes and Elastic Path Commerce workflow. You can use these jobs as the basis for a CloudOps for Kubernetes CI pipeline.
Scheduled CloudOps Pipelines
CloudOps for Kubernetes includes several CloudOps for Kubernetes workflow pipelines. These pipelines are used internally to validate released and upcoming version of CloudOps for Kubernetes are working.
These pipelines run on a schedule. Each supported CloudOps version is tested every night.
Scheduled Commerce Pipelines
CloudOps for Kubernetes includes several Commerce workflow pipelines. These pipelines are used internally to validate compatibility with the Commerce versions CloudOps for Kubernetes supports.
These pipelines run on a schedule. At least one pipeline runs each night.
On-demand Cloudops Pipeline
CloudOps for Kubernetes includes a CloudOps for Kuberentes workflow pipeline that is not scheduled. This pipeline can be configured and run to test different combinations of CloudOps, Commerce and EP Docker branches. For more information about the parameters, see CloudOps Pipeline Parameters.
On-demand Commerce Pipeline
The on-demand Commerce CI pipeline is important to all projects and is included by default. It does not need to be specifically enabled like other pipelines in this section.
For more information about the on-demand Commerce CI pipeline, see the Commerce CI Pipeline section.
Enabling the CloudOps CI Pipelines
By default, the CloudOps CI pipelines are excluded from Jenkins. Most project do not need the CloudOps CI pipelines.
To enable the CloudOps CI pipelines:
Download the Docker Compose configuration file for your cluster.
tip
If you followed the recommended process for bootstrapping your cluster, the file name is
docker-compose.override.yml
.Add the following settings to your Docker Compose configuration file.
# required to enable CloudOps Jenkins pipelines TF_VAR_include_c4k_pipelines: "true" # required to enable communication with the Jenkins servers created nightly by the CloudOps pipelines TF_VAR_jenkins_trust_all_certificates: "true" # required to build unreleased Elastic Path Commerce versions TF_VAR_ep_cortex_maven_repo_url: "https://repository.elasticpath.com/nexus/content/repositories/cortex-staging/" TF_VAR_ep_commerce_engine_maven_repo_url: "https://repository.elasticpath.com/nexus/content/repositories/commerce-engine-staging/" TF_VAR_ep_accelerators_maven_repo_url: "https://repository.elasticpath.com/nexus/content/repositories/accelerators-staging/"
Follow the process for updating your CloudOps for Kubernetes cluster.
CloudOps Pipeline Parameters
The following parameters are available in CloudOps for Kubernetes workflow pipelines:
All Clouds
centralhubCIDR
IP CIDR blocks allowed to access the Jenkins and Nexus servers in the CloudOps for Kubernetes cluster created by the pipeline. For CloudOps for Kubernetes release versions greater than 2.2.
jenkinsIngressCIDR
IP CIDR blocks allowed to access the Jenkins server in the CloudOps for Kubernetes cluster created by the pipeline. For CloudOps for Kubernetes release versions up to 2.2.
nexusIngressCIDR
IP CIDR blocks allowed to access the Nexus server in the CloudOps for Kubernetes cluster created by the pipeline. For CloudOps for Kubernetes release versions up to 2.2.
kubernetesNickname
The Kubernetes namespace where to deploy the CloudOps for Kubernetes bootstrap Pods.
cleanupResourceGroup
If cleanupResourceGroup
is set, the job cleans up the resources it creates.
forceCleanupResources
If forceCleanupResources
is set, the job will run the bootstrap Pod in force-clean
mode before beginning the pipeline. This will empty resources in the AWS account or Azure resource group from previous runs.
runCortexSystemTests
If runCortexSystemTests
is set, the job will run Cortex system tests against the deployed Commerce stack.
kubernetesClusterName
The name of the Kubernetes cluster to create.
domainName
The domain name for the created Kubernetes cluster. Use a subdomain of the domain name in zoneForNSRecord
.
zoneForNSRecord
The name of the DNS Zone where name server records are created to point to the DNS Zone created by the bootstrap process.
gitReposPrivateKey
A private SSH key authorized to clone from repositories specified by cloudOpsForKubernetesRepoURL
, epCommerceRepoURL
and dockerRepoURL
. The private SSH key must not be password protected.
cloudOpsForKubernetesBranch
The branch of CloudOps for Kubernetes to test.
cloudOpsForKubernetesRepoURL
The Git repository from which to pull CloudOps for Kubernetes code.
epCommerceBranch
The branch of Elastic Path Commerce to test.
epCommerceRepoURL
The Git repository from which to pull Elastic Path Commerce code.
dockerBranch
The branch of Elastic Path docker to test.
dockerRepoURL
The Git repository from which to pull Elastic Path docker code.
gitSSHHostKey
For parameter details, see the CloudOps for Kubernetes docker-compose.setup file.
epRepositoryUser
For parameter details, see the CloudOps for Kubernetes docker-compose.setup file.
epRepositoryPassword
For parameter details, see the CloudOps for Kubernetes docker-compose.setup file.
epCortexMavenRepoUrl
For parameter details, see the CloudOps for Kubernetes docker-compose.setup file.
epCommerceEngineMavenRepoUrl
For parameter details, see the CloudOps for Kubernetes docker-compose.setup file.
epAcceleratorsMavenRepoUrl
For parameter details, see the CloudOps for Kubernetes docker-compose.setup file.
oracleJdkDownloadUrl
For parameter details, see the CloudOps for Kubernetes docker-compose.setup file.
jdkFolderName
For parameter details, see the CloudOps for Kubernetes docker-compose.setup file.
tomcatVersion
For parameter details, see the CloudOps for Kubernetes docker-compose.setup file.
Azure only
resourceGroup
The Azure Resource Group where the Kubernetes cluster is created.
location
The Azure location where the Kubernetes cluster is created.
aksNodeVMSize
The VM type to use for the Kubernetes cluster nodes.
resourceGroupForParentZone
The Azure Resource Group of zoneForNSRecord
.
aksNodeCount
The minimum number of nodes in the created Kubernetes cluster.
azureSubscriptionId
The Azure subscription ID to use when creating Azure resources.
azureServicePrincipalTenantId
The tenant ID of the Azure Service Principal to use when creating Azure resources.
azureServicePrincipalAppId
The app ID of the Azure Service Principal to use when creating Azure resources.
azureServicePrincipalPassword
The password of the Azure Service Principal to use when creating Azure resources.
AWS only
region
The AWS region where the Kubernetes cluster is created.
eksInstanceType
The EC2 instance type to use for the Kubernetes cluster nodes.
eksNodeCount
The minimum number of nodes per Node Group in the created Kubernetes cluster.
awsAccessKeyId
The AWS access key ID to use when creating AWS resources.
awsSecretAccessKey
The AWS secret access key to use when creating AWS resources.
Tracing Kubernetes Layer Issues
The CloudOps CI pipeline creates four artifacts at the end of each run, regardless of whether the run was successful or not:
ci-cluster-all-resources.yaml
ci-cluster-all-resource-descriptions.txt
test-cluster-all-resources.yaml
test-cluster-all-resource-descriptions.txt
Files starting with ci-cluster
are related to the Kubernetes cluster that runs the CI job.
Files starting with test-cluster
are related to the Kubernetes cluster that creates the CI job.
There are two types of file, based on the end of the name:
all-resources.yaml
: Captures the output of runningkubectl get all --all-namespaces -o yaml
. This exports the YAML of each object in the Kubernetes cluster. It provides a way to see if the running configuration of an object differs from the existing codeall-resource-descriptions.txt
: Captures the output of runningkubectl describe all --all-namespaces
against the Kubernetes cluster. By exporting the description of each object, you can see the event history and status of each object