This project uses the AWS JAVA SDK, OPENWHISK DEVTOOLS and OPENWHISK KUBE DEPLOY to deploy and run and OW instance on Amazon EC2 machines It utilizes the capabilities of Jenkinsfile to automate the OpenWhisk deployment. Currently its a single node and AWS EKS deployment but AWS self managed Kube, Azure single node ,Azure self managed Kube and Azure AKS deployment is coming soon.
Variable | Type | Description |
---|---|---|
aws_access_key |
string | The AWS access key |
aws_access_secret |
string | The AWS secret access key |
aws_instance_type |
input | AWS Instance Type.Default (T1 Micro) .This parameter is selected from the console at the time of Job execution |
aws_region |
input | AWS Region.Default Region (UE1).This parameter is selected from the console at the time of Job execution |
awsKeyName |
string | Variable name of the aws key stored in Jenkins |
role_arn |
string | AWS IAM Role having EKS permissions.Only for EKS deployments |
ActionType:
deployow : Choose this option if you want to deploy Openwhisk on any cloud based provider. This parameter would create an EC2 machine and deploys the necessary softwares/tools needed to run OW.Once the tools are install it would deploy OpenWhisk on the EC2 machine.This task does the following:
- Creates EC2 resources
- Installs OpenWhisk on the EC2 instance
teardownow : This parameter would delete/terminate the EC2 instance where the OpenWhisk was hosted.This task does the following:
- Terminates the EC2 instance based on the tag
- Deletes the security group based on the tag
DeploymentType:
awsSingleNode: Selecting this option will deploy OpenWhisk on a single EC2 instance.
awsEKS: Selecting this option will deploy OpenWhisk on Amazon EKS will default 3 worker nodes.The node configurations are configurable. You can select the size of the worker nodes from the Jenkins Console after the Job is started. At present the awsEKS deployment can only be done for us-east-1
region.
You can create Kube Dashboard and start monitory your clusters.
- An AWS user with EC2 permissions. You will need the access key and secret for this user.Check Managing AWS Keys for more details.
- Amazon EKS service role. Follow this to create EKS role
- Running Jenkins . Follow Installing Jenkins on Ubuntu to install Jenkins or use any running Jenkins environment
- A Key for for each region or target region. Check AWS Key Pair help doc on how to create a key pair
To create your Amazon EKS service role in the IAM console:
-
Open the IAM console at https://console.aws.amazon.com/iam/.
-
Choose Roles, then Create role.
-
Choose EKS from the list of services, then Allows Amazon EKS to manage your clusters on your behalf for your use case, then Next: Permissions.
-
Choose Next: Review.
-
For Role name, enter a unique name for your role, such as eksServiceRole, then choose Create role.
-
Add the private key credentials to the Jenkins global credentials
-
Install ssh-agent plugin
-
Install pipeline plugins
-
Create a pipeline job
-
Add this ow-cloud-deploy repo to the Pipeline SCM script with the Script path
Jenkinsfile
-
Build the job to import Jenkinsfile and populate the input parameters
-
From the Job choose build with parameter
-
Select
deployow
from the action drop-down -
Choose the
deploymentType
-
Navigate to console output and when prompted select the required region/instance type
-
Once the job is complete ,copy the APIHOST from the Jenkins console and use it to connect to the Open Cluster
-
From the Job choose build with parameter
-
Select
teardown
from the action drop-down -
Choose the
deploymentType
-
Note that this job will tear down the EC2 machine/machines or clusters where OpenWhisk was deployed
Click on the gif to see the demo: