Kubernetes Integration Guide
Step-by-step instructions to deploy, configure, and manage Kubernetes clusters on CloudNexus infrastructure with production-ready best practices.
Introduction
CloudNexus provides fully managed Kubernetes (CNK) clusters with enterprise-grade networking, automated control plane updates, and integrated observability. This guide covers everything from initial CLI setup to deploying production workloads with auto-scaling and ingress routing.
kubectl workflows. All commands below use native Kubernetes APIs with CloudNexus-specific annotations where applicable.
Prerequisites
- CloudNexus account with Cluster Admin role
- API Key generated from
Console → Settings → API Keys - kubectl v1.27+ installed locally
- Base64 encoding utility (built into most OS)
- Domain with DNS access (for ingress)
| Component | Minimum Version | Recommended |
|---|---|---|
| kubectl | v1.25 | v1.28+ |
| Container Runtime | containerd 1.6 | containerd 1.7+ |
| CNI Plugin | Calico v3.24 | Calico v3.26 |
| OS Image | Ubuntu 22.04 LTS | Ubuntu 24.04 LTS |
Install & Configure CLI
If you haven't installed the CloudNexus CLI (cnx) yet, follow the official installation guide for your platform:
curl -fsSL https://cli.cloudnexus.io/install.sh | bash
cnx login --api-key YOUR_API_KEY --region us-east-1
Verify installation and authentication:
cnx auth verify
cnx cluster list
Connect to Cluster
Once your cluster is provisioned, export the kubeconfig to interact with it via kubectl:
cnx cluster kubeconfig my-prod-cluster > ~/.kube/cn-config
cat ~/.kube/cn-config >> ~/.kube/config
kubectl cluster-info --context cnx-us-east-1
Deploy First Workload
Create a namespace and deploy a sample application using a Deployment and Service:
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-app
namespace: production
spec:
replicas: 3
selector:
matchLabels:
app: web-app
template:
metadata:
labels:
app: web-app
spec:
containers:
- name: api
image: cnx-registry.io/apps/web-api:v2.1.0
ports:
- containerPort: 8080
resources:
requests:
cpu: "250m"
memory: "256Mi"
limits:
cpu: "500m"
memory: "512Mi"
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15
periodSeconds: 10
Apply the configuration:
kubectl apply -f deploy.yaml
kubectl get deployments -n production
kubectl rollout status deployment/web-app -n production
Ingress & SSL Configuration
CloudNexus provides an integrated NGINX Ingress Controller with automatic Let's Encrypt certificate provisioning. Configure your ingress resource:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web-app-ingress
namespace: production
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName: cnx-nginx
tls:
- hosts:
- app.example.com
secretName: web-app-tls
rules:
- host: app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web-app-svc
port:
number: 80
After applying, verify certificate status:
kubectl get certificate -n production
kubectl describe ingress web-app-ingress -n production
Autoscaling & Monitoring
Enable Horizontal Pod Autoscaler (HPA) based on CPU/memory metrics or custom CloudNexus metrics:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web-app-hpa
namespace: production
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: web-app
minReplicas: 2
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
CloudNexus automatically provisions the Metrics Server and integrates with Prometheus/Grafana. Access dashboards via Console → Observability → Kubernetes.
cnx monitor pods for real-time streaming logs and resource utilization directly in your terminal.
Best Practices
- Namespace Isolation: Use dedicated namespaces per environment/team with ResourceQuotas and LimitRanges.
- Security Contexts: Run containers as non-root with read-only root filesystems.
- Secrets Management: Use CloudNexus Vault integration instead of plain Kubernetes Secrets.
- Network Policies: Implement default-deny policies and explicitly allow required traffic flows.
- Image Scanning: Enable automated vulnerability scanning in CNX Registry before deployment.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-ingress
namespace: production
spec:
podSelector: {}
policyTypes:
- Ingress
Troubleshooting
Common Issues
| Error | Cause | Resolution |
|---|---|---|
Connection refused | Ingress controller pending | Check kubectl get pods -n ingress-nginx for crashing controllers |
ImagePullBackOff | Invalid registry credentials | Verify imagePullSecrets and registry endpoint accessibility |
CrashLoopBackOff | Application crash or probe failure | Run kubectl logs and adjust liveness/readiness thresholds |
Insufficient cpu/memory | Node capacity exceeded | Scale node group or adjust HPA limits |
For advanced diagnostics, enable verbose logging:
kubectl get events --sort-by=.metadata.creationTimestamp -n production
cnx cluster diagnose my-prod-cluster --output json
Next Steps
You now have a fully operational Kubernetes cluster on CloudNexus. Explore advanced topics:
- GitOps with Flux CD
- Cluster Backup & Disaster Recovery
- Multi-Cluster Federation
- Kubernetes API Reference
priority: k8s-integration.