Skip to main content

Kubernetes Components

This guide covers the installation of foundational infrastructure components that provide storage provisioning and external access to your AI/Run CodeMie deployment.

Overview

This step installs two critical infrastructure components:

  • Nginx Ingress Controller - Routes external HTTP/HTTPS traffic to services within the cluster
  • AWS gp3 - Enables dynamic provisioning of persistent volumes for stateful workloads
When to Skip

If your EKS cluster already has an ingress controller and storage class configured, you can skip the relevant sections and proceed to Data Layer.

Nginx Ingress Controller Installation

The Nginx Ingress Controller manages external access to services in your cluster, providing load balancing, SSL termination, and name-based virtual hosting.

Step 1: Create Ingress Namespace

Create a dedicated namespace for the ingress controller:

kubectl create namespace ingress-nginx
Namespace Verification

Check if the namespace already exists before creating: kubectl get namespace ingress-nginx

Step 2: Install Nginx Ingress Helm Chart

Deploy the Nginx Ingress Controller using Helm:

helm upgrade --install ingress-nginx ingress-nginx/. \
-n ingress-nginx \
--values ingress-nginx/values-aws.yaml \
--wait \
--timeout 900s \
--dependency-update
warning

Do not interrupt the process.

Step 3: Verify Ingress Controller Deployment

Check that the ingress controller is running:

# Check pod status
kubectl get pods -n ingress-nginx

# Verify service and load balancer IP
kubectl get service ingress-nginx-controller -n ingress-nginx

Expected output:

  • Pods should be in Running state
  • Service should have an EXTERNAL-IP assigned load balancer IP

Step 4: Configure DNS Record

Create a DNS record pointing to the ingress controller's load balancer:

# Retrieve ingress controller hostname/IP
INGRESS_HOST=$(kubectl get service ingress-nginx-controller -n ingress-nginx -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')

echo "Ingress Host: ${INGRESS_HOST}"

DNS Configuration Options:

If using Route 53:

# Get your hosted zone ID
HOSTED_ZONE_ID=$(aws route53 list-hosted-zones-by-name \
--dns-name example.com \
--query 'HostedZones[0].Id' \
--output text | cut -d'/' -f3)

# Create CNAME record
aws route53 change-resource-record-sets \
--hosted-zone-id ${HOSTED_ZONE_ID} \
--change-batch '{
"Changes": [{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "codemie.example.com",
"Type": "CNAME",
"TTL": 300,
"ResourceRecords": [{"Value": "'${INGRESS_HOST}'"}]
}
}]
}'

Parameters to Adjust:

  • example.com - Replace with your domain name
  • codemie.example.com - Replace with your desired hostname
DNS Configuration

These values should match what you configured during infrastructure deployment. Check your deployment_outputs.env file for the correct domain name.

Verification

Confirm the DNS record was created:

# List DNS records in Route 53
aws route53 list-resource-record-sets \
--hosted-zone-id ${HOSTED_ZONE_ID} \
--query "ResourceRecordSets[?Name=='codemie.example.com.']"

# Test DNS resolution
nslookup codemie.example.com

Storage Class Installation

The AWS gp3 enables Kubernetes to dynamically provision Amazon EBS gp3 volumes for stateful workloads like databases.

Step 1: Check Existing Storage Classes

Before installing, verify if a suitable storage class already exists:

kubectl get storageclass
Skip if Already Exists

If your cluster already has appropriate storage classes (typically `gp2` or `gp3`), you can skip this installation.

Step 2: Install Custom Storage Class

If no suitable storage class exists, install the AWS storage class:

kubectl apply -f storage-class/storageclass-aws-gp3.yaml

Step 3: Verify Storage Class

Check that the storage class was created:

kubectl get storageclass

# View storage class details
kubectl describe storageclass <storage-class-name>

Post-Installation Validation

After completing this step, verify the following:

# Ingress controller is running
kubectl get pods -n ingress-nginx | grep Running

# Load balancer has IP assigned
kubectl get svc -n ingress-nginx ingress-nginx-controller

# Storage class is available
kubectl get storageclass

All checks should return successful results before proceeding.

Next Steps

Once storage and ingress are configured, proceed to Data Layer installation to deploy Elasticsearch, Kibana, and PostgreSQL components.