This tutorial will teach you how to use Stitch capability of Digital.ai Deploy, when deploying to a Kubernetes cluster. For more information about Stitch, please see Introduction to Stitch.
Install Digital.ai Deploy 9.8 or later. Please refer to the installation guide.
Note: For the purpose of this tutorial it is advised not to run Deploy in a container, since it will be harder to deploy to the same host if Docker Desktop Kubernetes is used.
- Download XL CLI version 9.8
- Check that your K8s context points to your Kubernetes cluster (
- Configure Deploy with Infrastructure CIs to point to your Kubernetes cluster
- Create Kubernetes cluster configuration CI -
Infractructure - New - k8s - Master
- Name it
TLS private key,
API server URL,
CA certificate. You can obtain these from your
.kube\configvalues (‘client-certificate-data’, ’ client-key-data’, ‘server’, and ‘certificate-authority-data’ respectively)
- Once created, find this CI in the Explorer, and use CI’s context menu to create a namespace CI. Name it
- Please verify if the connecton to your Kubernetes cluster works by running a connection check on
- Configure the Deploy with the Environment CI to point to the ‘default’ namespace of your Kubernetes infractruecture CI
- Create Kubernetes environment CI -
Environments - New - Environment
- Name it
Containersfiled find your
Configure a sample ‘PetClinic’ application as CI in Deploy.
- Download ‘PetClinic’ folder from the Stitch tutorial GitHub repository to your local machine.
- Run XL CLI command
xl apply -f xebialabs.yamlin the ‘PetClinic’ directory. It will use ‘DevOps as Code’ to create the Petclinic kubernetes application for you, under the
- This is a Kubernetes-packaged application that contains YAML manifest with ‘Deployment’ and ‘Service’.
Add a source of Stitch tutorial sample customizations to Deploy:
- In Deploy UI navigate to ‘Stitch’ section. Find ‘Sources’ tab and use ‘Add Git source’.
- Give it a name
Repository Urlproperty use ”https://github.com/xebialabs/stitch-tutorial”
- Leave other fields default
- Click ‘Test’ to verify the connection, and ‘Save’
- Use a ‘Refresh’ button to mionitor for when a synchronization of customizations from the GutHub repository into the Deploy finishes.
- In case of issues use ‘View log’ button for troubleshooting.
- Check available Stitch customizations
In Deploy UI navigate to ‘Stitch’ section. Find ‘Rules’ tab and click on ‘k8s-tutorial’ namespace. It should give you a list of customization rules now available in Deploy.
- Build a deployment plan for the ‘Petlinic’ app
- Goto ‘Explorer’ section to find the application under
- Start a Deployment and map this application to your Kubernetes environment
- Click ‘Preview’ to investigate the deployment plan created, including applied Stitch customization to application’s YAML
Navigate to ‘Stitch Preview’ tab for details on the effect of each customization
- ‘Invocation 1’ would be a ‘kind:Deployment’ manifest.
- Look at the difference between ‘Original’ and ‘Modified’ content for the manifest under the ‘Stitch invocation output’.
- It shows the effect of all customization applied to this manifest.
- Click on ‘Show processing steps’ and click on a particular customization step under ‘Processor Execution’ to observe the effect of change by each step.