Make sure you have done all the steps in the Getting Started section and set the following environment variables which are required for installing Gitmoxi on EKS.
AWS_REGION
AWS_ACCOUNT
AWS_PROFILE
GITHUB_TOKEN
You can either create a new cluster or use an existing one to deploy Gitmoxi.
Create a new EKS cluster if you don’t have or don’t want to use an existing EKS cluster. To use existing EKS cluster skip to next section
The EKS cluster creation Terraform will use your AWS credentials to create the following resources. Ensure that your signed-in user has permissions to create:
Resource Type | Details |
---|---|
EKS Cluster | • eks:CreateCluster, eks:DescribeCluster, eks:UpdateClusterConfig • eks:DeleteCluster, eks:ListClusters • eks:TagResource, eks:UntagResource • eks:CreateAccessEntry, eks:AssociateAccessPolicy • iam:CreateServiceLinkedRole, iam:PassRole |
EKS Node Group | • eks:CreateNodegroup, eks:DescribeNodegroup, eks:DeleteNodegroup • eks:UpdateNodegroupConfig • ec2:DescribeSubnets, ec2:DescribeSecurityGroups • iam:CreateRole, iam:AttachRolePolicy, iam:PassRole • autoscaling:CreateAutoScalingGroup, autoscaling:DescribeAutoScalingGroups |
VPC Resources | • ec2:DescribeVpcs • ec2:DescribeSubnets |
Helm Release (AWS LB Controller) | • eks:DescribeCluster, eks:ListClusters • sts:AssumeRole (to authenticate with EKS) |
Pod Identity Association | • eks:CreatePodIdentityAssociation, eks:DeletePodIdentityAssociation • eks:DescribePodIdentityAssociation • iam:CreateRole, iam:CreatePolicy • iam:AttachRolePolicy • iam:DeleteRole, iam:DeletePolicy, iam:DetachRolePolicy |
Go to the gitmoxi-trial
directory, which is obtained by unzipping the trial download file you received in email. Under the eks
directory you will find create_cluster
terraform code to create the EKS cluster.
cd gitmoxi-trial
export GITMOXI_DEPLOY_DIR=$PWD
cd eks/cluster_create
terraform init
terraform apply --auto-approve
Note If you run into an error towards tailend of terraform apply, then re-run the
terraform apply
after a few seconds, there is a race condition withcore-dns
add-on and theALB
controller.
Set the context to the new cluster.
export EKS_CLUSTER_ARN=$(terraform output -raw cluster_arn)
aws eks update-kubeconfig --region us-west-2 --name gitmoxi-eks
Check the cluster is ready
kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
aws-load-balancer-controller-xxx 1/1 Running 2 (6h1m ago) 6h4m
aws-load-balancer-controller-xxx 1/1 Running 2 (6h1m ago) 6h4m
...
...
Start by setting couple of environment variables for the EKS cluster arn and cluster name where you want to deploy Gitmoxi.
export EKS_CLUSTER_ARN=
export TF_VAR_cluster_name=
Next create the Gitmoxi pod IAM role and association using the terraform provided in the download package. Go to the directory gitmoxi-trial
, which is obtained by unzipping the downloaded package.
cd gitmoxi-trial
export GITMOXI_DEPLOY_DIR=$PWD
cd eks/existing_cluster
terraform init
terraform apply --auto-approve
First we will create the gitmoxi
namespace and ingress object.
cd $GITMOXI_DEPLOY_DIR/eks/install_gitmoxi
kubectl apply -f gitmoxi-svc_namespace.yaml
kubectl apply -f gitmoxi-svc_ingress.yaml
Store the Gitmoxi endpoint URL as that is needed for installing other components.
export GITMOXI_ENDPOINT_URL="http://$(kubectl get ingress gitmoxi-backend-http-8080 -n gitmoxi -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')"
echo $GITMOXI_ENDPOINT_URL
http://k8s-gitmoxi-xxxxxxxx-xxxxxxx.us-west-2.elb.amazonaws.com
Note, you should see the GITMOXI_ENDPOINT_URL otherwise ingress creation has failed and Gitmoxi service won’t be accessible.
Set some of the key environment variables needed to install Gitmoxi.
rm .env
echo "AWS_REGION=$AWS_REGION" >> .env
echo "AWS_ACCOUNT=$AWS_ACCOUNT" >> .env
echo "GITHUB_TOKEN=$GITHUB_TOKEN" >> .env
echo "GITMOXI_FRONTEND_URL=$GITMOXI_ENDPOINT_URL" >> .env
echo "REACT_APP_BASE_URL=$GITMOXI_ENDPOINT_URL" >> .env
cat .env
Install rest of the components using kustomize
- Gitmoxi deployment, service, service_account, and role-based access control.
cd $GITMOXI_DEPLOY_DIR/eks
kubectl apply -k install_gitmoxi/
Check that the Gitmoxi pod is running.
kubectl get pods -n gitmoxi
NAME READY STATUS RESTARTS AGE
gitmoxi-76d5784f48-xxxrc 6/6 Running 0 9m7s
Wait for the gitmoxi
pod to be in Running
state. Sometimes the ingress takes a few minutes to get the pods registered and health check passed. Give it like 5-6 mins and you should see the Gitmoxi UI page at the $GITMOXI_ENDPOINT_URL
endpoint.
echo $GITMOXI_ENDPOINT_URL
http://k8s-gitmoxi-xxxxx-xxxxx.us-west-2.elb.amazonaws.com
Next, we will add a GitHub repository to Gitmoxi to test the GitOps workflow.
Experience the power of Gitmoxi — your go-to solution for simple, flexible, and transparent deployment management