This repository helps to build a self-managed Kubenetes cluster on AWS infrastructure using Terraform with Jenkins pipeline. Then, Ansible is used to configure Kubernetes and install Helm, Istio, and run microservices on the master node. How to use this repository is coming very soon.
A social network with unidirectional follow relationships, developed using microservices with loose coupling that communicate over Thrift RPCs. Application Structure
Ref: https://github.com/delimitrou/DeathStarBench
To Install Terraform plugin,
Go to Manage Jenkins > Manage Plugins >Available > search Terraform > Choose to install Terraform plugin.
To configure AWS credentials in Jenkins:
-
Install Pipeline: AWS Steps navigate to Manage Jenkins > Manage Plugins under the Available tab of the Jenkins dashboard. Choose to install the Pipeline: AWS Steps plugin without a restart.
-
Add Aws credentials: You can add credentials by navigating to Manage Jenkins > Manage Credentials > Jenkins (global) > Global Credentials > Add Credentials. Choose kind as AWS credentials and enter "terraform-credentials" as the ID. Enter the access key ID and access key secret, then select OK. Note! if you can not see the AWS credentials after adding the plugin. please go to Manage Jenkins > Configure Credential Providers > change Providers to all available and change types to all availlable.
To add Terraform Pipeline, Go to new item > Enter an item name > choose Pipline > Click OK. Then, To add Jenkinsfile: Go to Advanced Project Options > In Pipline Section > Select "Pipline script from SCM" . > Select "Git" in SCM section > Insert Repository URL (https://github.com/Omidznlp/AWS-Self-Maneged-Kubernetes.git) in Repositoriis Section
In Section Branches to build, Insert (*/master) > In Script Path, Insert (terraform/Jenkinsfile) > Click Save.
I used agent with "master" label to build Terraform Pipile, In Jenkinsfile into repositoy you can find it.
agent {
node {
label "master"
}
` }
I gave my Jenkins server the label "master," and then I ran Terraform on it. Go to Manage Jenkins > Click "Manage nodes and clouds" > Select setting (left side of the list of nodes) > Under the label section, add "master" > Save it.
Note! Simply, you can change the label on the Jenkinsfile or choose your node from your node lists from which you would like to execute terraform and then add the "master" label to it.
Build with parameters: choose an action "apply or destroy"?
Before "TF Apply" or TF Destroy" stage, you must approve it manually in the Approval and Removal Stage by clicking on it and selecting "Proceed.".