Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Auitabs
directionhorizontal
Auitabspage
titleKubernetes


The pipeline configurations can be changed by the modification of the configurations in the values.yaml file corresponding to the pipeline. The sample modifications for each product provide a good indication as to how these configurations could be modified upon deployment. Once a configuration change has been made, run the helm upgrade command to apply the changes.

bash

<RELEASE_NAME> should be replaced with the release name provided when the pipeline is installed initially.

Configuration changes could occur which will affect the Jenkins deployment, some of which include:

  • Changes to the private Docker repository

  • Changes to the artifact source repository

  • Changes to the chart source repository

In these cases the Jenkins pod would be restarted for these configurations to be reflected.

Use the following Advance configurations to Customize and Secure the Pipeline tool.

Change domain name

To customize the domain name override the host values as shown in the example below.

yml

example.com refers to the domain name

Using Ingress with Secure Sockets Layer(SSL) / Transport Layer Security (TLS)

The WSO2 Kubernetes Pipeline resource uses the NGINX Ingress Controller maintained by Kubernetes.Therefore, it is possible to use SSL/TLS security layers by adding a certificate to be used with the ingress controller.

This could be done using the following methods:

  • Default SSL certificate
  • Add individual certificates


Default SSL certificate

Refer to NGINX Ingress Controller user guide on how to configure a default SSL certificate.


Add individual certificates

To add individual certificates to each ingress endpoint follow the steps shown below

  1. Create Kubernetes secret objects for each endpoint containing the certificate and the private key.
    Refer NGINX Ingress Controller user guide.
  2. Add the following content to your values.yaml with the secret and hostname.


    yml

    Replace example.com, my-tls-cert with your domain name and secret name respectively.

Access private GitHub repositories

The use of private repositories are recommended when using WSO2 Kubernetes Pipeline.. While it is possible to use the basic credentials to authorize the pipeline to use these private repositories, we recommend the use of Github personal access tokens since it provides more control over the level of access.

  1. Create a personal access token as mentioned here.
  2. Add the username and personal access token to the values.yaml as shown below.

    yml

Change credentials for Jenkins administrator

Jenkins starts as an administrative user by default. The  The password for this account could be changed by overriding the relevent values in the values as shown below.yaml

yml

In addition, we need to configure Spinnaker to authenticate with Jenkins since it would be used to run tests.

This is done by overriding the additional scripts section to change the default credentials indicated by `JENKINS_USERNAME` and `JENKINS_PASSWORD`.

yml



Auitabspage
titleAWS


This document assumes that you have completed the Quick Start Guide.

Add a new environment to your pipeline

The following example shows how to add a sandbox environment to the existing pipeline. 

  1. Create a fork of the sample aws-cicd-deployment repository. 

  2. Create a clone of the forked artifact source repository. You can use the below command in command line.

    Pipeline CloudFormation template repository will be cloned into your current working directory.

  3. Create a new file named cf-sandbox.yaml inside the wso2is/is folder.

  4. Copy the content in sample.yaml file in “sampleCFN” folder to cf-sandbox.yaml file.

  5. Commit and push the changes to master branch in your repository.

  6. SSH into Jenkins instance and edit the Jenkins environment file. Change the URL of env.GIT_REPO_CF to your repository URL.

  7. Create a fork of the sample aws-pipeline repository.

  8. Create a clone of the forked artifact source repository. You can use the below command in command line.

    Pipeline artifact repository will be cloned into your current working directory.

  9. Add the below variable definitions to Jenkins file in “jenkinsfile/aws” folder.

  10. Add the below code snippet after the BUILD_IMAGE stage into the Jenkins file in “jenkinsfile/aws” folder.


  11. Add below code snippet to run tests on sandbox environment.


  12. Commit and push the changes to master branch in your repository.

  13. Login to Jenkins Console.

  14. Click on wso2is-5.8.0 job.

  15. Click on Configure.

  16. Change the Repository URL to your aws-pipeline repository URL under Pipeline section.

  17. Click Apply and Save.

Remove an environment in your pipeline 

The following example shows how to remove the development environment from the existing pipeline. 

  1. Create a fork of the sample aws-pipeline repository. 

  2.   Create a clone of the forked artifact source repository. You can use the below command in command line.

    Pipeline artifact repository will be cloned into your current working directory.

  3. Remove the code snippet corresponding to the deployment and test run of development environment in Jenkinsfile in jenkinsfile/aws folder.


  4. Commit and push the changes to master branch in your repository.

  5. Login to Jenkins Console.

  6. Click on wso2is-5.8.0 job.

  7. Click on Configure.

  8. Change the Repository URL to your aws-pipeline repository URL under Pipeline section.

Roll back Environments

You can always roll back the environments to a previous revision using the roll back pipeline Job in Jenkins. 

  1. Login to Jenkins
  2. Click on wso2is-5.8.0-rollback Job.
  3. Click build with parameters.
  4. Select the desired revision to roll back.
  5. Select the desired environment to perform roll back.
  6. Click Build.

Pipeline will roll back the selected environment into the selected revision.

Modify Pipeline Parameters

In this instance you are able to change pipeline credentials and other parameters. Steps to follow are listed below:

Update Credentials

These steps can be used to update Github Credentials and WSO2 credentials

  1. Login to Jenkins console.
  2. Go to Credentials
  3. Select the credential you need to update.
  4. Click Update on the left menu.
  5. Enter new credentials
  6. Click Save.

Update other parameters

The following steps would make AWS CloudFormation to update the Jenkins stack with new parameters.

  1. Log into AWS Console
  2. Go to AWS CloudFormation page
  3. Select Jenkins stack and click Update
  4. Choose Use current template and click Next
  5. Change the required parameter values
  6. Click Next 
  7. Click Update


Use Custom Domain Domain Names

Custom domain names can be configured for accessing domains. customizations can be done to your own existing domain or a newly created domain. 

To configure custom domain you need route the traffic from load balancer to your domain. In order to route traffic to your domain, it is necessary to configure Route53 on AWS.

Refer documentation on  Associating Your Custom Domain Name with Your Load Balancer Name