All docs This doc
Skip to end of metadata
Go to start of metadata


Setting up a basic pipeline for WSO2 Enterprise Integrator on Kubernetes is quick and simple.

You can set up a simple CI/CD pipeline for WSO2 Enterprise Integrator in two steps.

  1. Create a Docker image for WSO2 Enterprise Integrator.

  2. Deploy the CI/CD pipeline.

Before you begin to develop your pipeline, set up the following prerequisites in a running Kubernetes cluster.

Prerequisites

Create WSO2 Enterprise Integrator Docker Image

First, let's create a Docker image for WSO2 Enterprise Integrator on a private Docker registry.

This pipeline utilizes Docker Hub as its private registry.
  1. Pull the latest image from WSO2 and push it to the private registry following are the steps

    1. If you have a WSO2 subscription, log into the WSO2 Docker registry using your subscription credentials.

      The WSO2 Enterprise Integrator  Docker image automatically fetches product updates on a weekly basis and  If you do not have a WSO2 subscription account, you can sign up for a free trial here.
      $ docker login docker.wso2.com
    2. Pull the Docker image for WSO2 Enterprise Integrator

      $ docker pull docker.wso2.com/wso2ei:6.5.0
    3. After the image pull is complete, tag the image as follows:

      $ docker tag docker.wso2.com/wso2ei:6.5.0 <DOCKER_ORGANIZATION>/wso2is
      <DOCKER_ORGANIZATION> refers to the name of your private docker repository in Docker Hub.
      If you do not have a WSO2 subscription use the docker hub image wso2/wso2ei:6.5.0 instead.
      $ docker pull wso2/wso2ei:6.5.0
      $ docker tag wso2/wso2ei:6.5.0 <DOCKER_ORGANIZATION>/wso2ei
    4. Log into your organization on Docker Hub and push the Enterprise Integrator image

      $ docker login
    5. Push the Docker image to a repository in your organization on Docker Hub.

      $ docker push <DOCKER_ORGANIZATION>/wso2ei

Deploy the CI/CD pipeline

  1. Download the following values.yaml file and replace the placeholders with their respective values.

    • <REGISTRY_USERNAME> - Docker organization name.

    • <REGISTRY_PASSWORD> - Docker password.

    • <REGISTRY_EMAIL> - Email address of Docker organization.

    • <EMAIL> - Email address notifications should be sent to in case of failure.

    • <GITHUB_USERNAME> - GitHub username.

    • <GITHUB_PASSWORD> - GitHub password.

  2. Add the WSO2 helm repository.

    $ helm repo add wso2 https://helm.wso2.com
    
    $ helm repo update
  3. Install the pipeline Helm chart by pointing to the updated values-ei-pattern-1.yaml file.

    $ helm install --name <RELEASE_NAME> wso2/kubernetes-pipeline -f values-ei-pattern-1.yaml --namespace <NAMESPACE>
    The installation will take up to 10 minutes.
  4. Obtain the external IP (`EXTERNAL-IP`) of the Ingress resources by listing down the Kubernetes Ingresses.

    $ kubectl get ing -n <NAMESPACE>
    NAME   HOSTS     ADDRESS   PORTSAGE
    <RELEASE_NAME>-grafana  grafana<EXTERNAL_IP>8020m
    <RELEASE_NAME>-kibanakibana <EXTERNAL_IP>8020m
    <RELEASE_NAME>-spinnaker-deck spinnaker<EXTERNAL_IP>80, 44320m
    <RELEASE_NAME>-spinnaker-gategate.spinnaker<EXTERNAL_IP>80, 44320m
    jenkins-ingress jenkins<EXTERNAL_IP>80, 44320m
  5. Add the above hosts as an entry in /etc/hosts as follows:

    <EXTERNAL_IP>  grafana kibana spinnaker Jenkins

  6. Navigate to the following URLs on any web browser

What’s next:

Prerequisites

  1. Create and upload an SSL certificate to AWS, which is required to initiate the SSL handshake for HTTPS. Please see AWS Load Balancing documentation for further details
  2. Create a key pair for the desired region, which is required to SSH to instances. (Skip this step if you want to use an existing key pair) See Amazon EC2 Key Pairs document for further details.

  3. A first-time AWS user should have a user policy created to set permissions when creating a  pipeline. Create a user policy follow the below steps 

    1. Go to IAM service console in AWS. 

    2. Click on Policies and then click on Create policy.

    3. When page load switch to JSON tab. 

    4. Copy-paste the below json code a

    5. Click on the review policy button

    JSON CODE BLOCK
    "Version": "2012-10-17",    "Statement": [
    {
        "Effect": "Allow",
        "Action": "iam:CreateServiceLinkedRole",
        "Resource": "*",
        "Condition": {
            "StringLike": {
                "iam:AWSServiceName": [
                    "rds.amazonaws.com",
                    "rds.application-autoscaling.amazonaws.com"
                ]
            }
        }
    },
    {
        "Effect": "Allow",
        "Action": "iam:CreateServiceLinkedRole",
        "Resource": "*",
        "Condition": {
            "StringEquals": {
                "iam:AWSServiceName": [
                    "autoscaling.amazonaws.com",
                    "ec2scheduled.amazonaws.com",
                    "elasticloadbalancing.amazonaws.com",
                    "spot.amazonaws.com",
                    "spotfleet.amazonaws.com",
                    "transitgateway.amazonaws.com"
                ]
            }
        }
    },
    {
        "Effect": "Allow",
        "Action": [
            "ec2:AuthorizeSecurityGroupIngress",
            "ec2:DescribeAddresses",
            "ec2:DescribeInstances",
            "rds:*",
            "elasticfilesystem:CreateFileSystem",
            "ec2:CreateKeyPair",
            "ec2:DescribeInstanceAttribute",
            "logs:DescribeLogStreams",
            "s3:Get*",
            "sns:ListTopics",
            "s3:CreateBucket",
            "autoscaling:*",
            "s3:List*",
            "ec2:DescribePlacementGroups",
            "ec2:DescribeInternetGateways",
            "sns:Publish",
            "ec2:DescribeNetworkInterfaces",
            "ec2:DescribeAvailabilityZones",
            "ec2:CreateSecurityGroup",
            "logs:GetLogEvents",
            "ec2:DescribeAccountAttributes",
            "ec2:DescribeKeyPairs",
            "ec2:DescribeRouteTables",
            "ec2:ImportKeyPair",
            "iam:ListRoles",
            "cloudformation:*",
            "ec2:DescribeClassicLinkInstances",
            "elasticloadbalancing:*",
            "sns:ListSubscriptions",
            "ec2:DescribeSecurityGroups",
            "ec2:DescribeVpcClassicLink",
            "cloudformation:DescribeStacks",
            "ec2:DescribeImages",
            "s3:PutObject",
            "ec2:DescribeVpcs",
            "ec2:*",
            "ec2:DescribeSubnets"
        ],
        "Resource": "*"
    },
    {
        "Effect": "Allow",
        "Action": [
            "elasticfilesystem:ModifyMountTargetSecurityGroups",
            "elasticfilesystem:DescribeMountTargets",
            "elasticfilesystem:Restore",
            "elasticfilesystem:CreateTags",
            "elasticfilesystem:DeleteTags",
            "elasticfilesystem:DescribeTags",
            "elasticfilesystem:CreateMountTarget",
            "elasticfilesystem:Backup",
            "elasticfilesystem:DeleteMountTarget",
            "elasticfilesystem:DescribeFileSystems",
            "elasticfilesystem:DeleteFileSystem",
            "elasticfilesystem:DescribeMountTargetSecurityGroups",
            "elasticfilesystem:UpdateFileSystem"
        ],
        "Resource": "arn:aws:elasticfilesystem:*:*:file-system/*"
    }
    
    
    
    

Installation:

Creating a new stack for the preferred region

  1. Select the preferred region for deployment from the tiles shown in AWS CloudFormation page  

  2. Once the region is selected, you will get navigated to the AWS CloudFormation "Create stack" page. 

  3. Click the “Next” button. 

Specify the new stack details

  1. Give an appropriate name for the stack 

  2. Fill in the required values under the ‘Parameter’ Heading

    • Cluster Configuration: Mandatory to fill all the fields here.

    • Database Configuration: Enter the database username and password. This will be used to create the login for RDS instance

    • WSO2 Subscription Credentials: You may skip this if you do not have a valid WSO2 subscription or if you do not require wum updates.

    • Github Configuration: If you want to configure a GitHub webhook to your own artifact repository you need to add these values. 

    • SSL Certificate Name: Add the SSL Certificate name created in the prerequisites section[1].

    • Key Pair Name: Add the key pair created in the prerequisites section[2].

    • Jenkins console login Password: Enter a password to login to the Jenkins console

    • Email:  Better to include email to  receive notifications on pipeline

    • Other Parameters: This section is filled with default values.


    If you have specified values for Github Configuration then put the URL of specified repository for GitRepoArtifacts.

  3. Once you have filled in the required fields, click “Next” and proceed with ‘Configure stack options’ options. Once you have completed, click the “Next” button, review your stack information thoroughly and Edit if needed, and click “Create stack”

It might take a few minutes (~10 minutes) to create the stack.

Once the status of the stack changes to CREATE_COMPLETE, click the "Output" tab to get the JenkinsConsoleURL.

Log into the JenkinsConsoleURL (use 'admin' as username and password)

After you have logged in, click on the configured job.  Click “Run” on the pop-up window to start the pipeline for configured products and its current version.

View Pipeline Progress

  1. You can view the pipeline progress under the Pipeline tab in the view.  Each step will be displayed with relevant logs.  Approve and select “OK” on the “Approve Staging” stage pop-up to deploy the product into the staging environment.

  2. Once the deployment to staging is completed approve and select “OK” on the “Approve Production” stage pop-up to deploy the product into the production environment.

  3. When the deployment to environments are complete, you will be able to see three stacks, namely ‘dev-stack’, ‘staging-stack’ and ‘prod-stack’ on your AWS Cloudformation console.

  4. Click on the "Outputs" tab of each stack to get the Management Console URL of each environment.


What’s next:

  • No labels