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
  • Storage Class - Enables dynamic provisioning of persistent volumes for stateful workloads
When to Skip

If your Kubernetes 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, selecting the values file for your cloud provider (aws, azure, or gcp):

helm upgrade --install ingress-nginx ingress-nginx/. \
-n ingress-nginx \
--values ingress-nginx/values-<cloud>.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. The exact steps depend on your cloud provider's DNS service.

INGRESS_HOST=$(kubectl get service ingress-nginx-controller -n ingress-nginx -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
echo "Ingress Host: ${INGRESS_HOST}"

Using Route 53:

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

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

Parameters to adjust: replace airun.example.com and codemie.airun.example.com with your domain values from deployment_outputs.env.

Verification:

aws route53 list-resource-record-sets \
--hosted-zone-id ${HOSTED_ZONE_ID} \
--query "ResourceRecordSets[?Name=='codemie.airun.example.com.']"

nslookup codemie.airun.example.com

Storage Class Installation​

The Storage Class enables Kubernetes to dynamically provision block storage (Amazon EBS, Azure Disk, or GCP Persistent Disk, depending on your cloud provider) 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, you can skip this installation. Clusters commonly ship with a default storage class such as gp2/gp3 (AWS), managed-premium (Azure), or standard-rwo (GCP).

Step 2: Install Custom Storage Class​

If no suitable storage class exists, install the storage class manifest for your cloud provider (aws, azure, or gcp):

kubectl apply -f storage-class/storageclass-<cloud>.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 and Kibana components.