Setup Kubernetes (k3s)
Verify k3s installation, create namespace, and configure Kubernetes for ORISO Platform deployment
Setup Kubernetes (k3s)
Verify k3s is running correctly and prepare Kubernetes namespace for ORISO Platform.
Check that k3s service is active and Kubernetes cluster is operational.
# Check k3s status
sudo systemctl status k3s
# Check nodes
kubectl get nodes
# Check all pods
kubectl get pods --all-namespaces
# Check storage class
kubectl get storageclassExpected output should show:
- k3s service:
active (running) - Node status:
Ready - Storage class:
local-path (default)with provisionerrancher.io/local-path
Create the caritas namespace for ORISO Platform resources.
# Create caritas namespace
kubectl create namespace caritas
# Verify
kubectl get namespaces
# Set default namespace (optional)
kubectl config set-context --current --namespace=caritasThe caritas namespace should appear in the namespaces list.
Setting the default namespace is optional but convenient, as it allows you to omit -n caritas from subsequent kubectl commands.
Create a ClusterIssuer for automatic TLS certificate management with Let's Encrypt.
# Create ClusterIssuer
cat <<EOF | kubectl apply -f -
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: your-email@example.com # CHANGE THIS!
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- http01:
ingress:
class: nginx
EOF
# Verify ClusterIssuer
kubectl get clusterissuerThe ClusterIssuer should show Ready status: kubectl get clusterissuer letsencrypt-prod should show READY=True.
Replace your-email@example.com with your actual email address. This email is used by Let's Encrypt for certificate expiration notifications.
Create Kubernetes secrets for database credentials and other sensitive information.
# MariaDB secrets
kubectl create secret generic mariadb-secrets -n caritas \
--from-literal=MYSQL_ROOT_PASSWORD=your-secure-password \
--from-literal=MYSQL_DATABASE=caritas \
--from-literal=MYSQL_USER=caritas_user \
--from-literal=MYSQL_PASSWORD=your-secure-password
# Redis secrets
kubectl create secret generic redis-secret -n caritas \
--from-literal=password=your-secure-password
# RabbitMQ secrets
kubectl create secret generic rabbitmq-secrets -n caritas \
--from-literal=RABBITMQ_DEFAULT_USER=admin \
--from-literal=RABBITMQ_DEFAULT_PASS=your-secure-password
# Verify secrets
kubectl get secrets -n caritasAll secrets should be listed: mariadb-secrets, redis-secret, rabbitmq-secrets.
Use strong, unique passwords for production. Store these passwords securely (password manager, encrypted file, etc.).
Configure k3s for production use with custom settings.
This step is optional but recommended for production deployments.
# Edit k3s service
sudo systemctl edit k3sAdd resource limits and configuration:
[Service]
Environment="K3S_KUBECONFIG_MODE=644"
Environment="K3S_NODE_NAME=oriso-platform"Apply changes:
# Restart k3s
sudo systemctl daemon-reload
sudo systemctl restart k3s
# Verify
sudo systemctl status k3sk3s should restart successfully and show active (running) status.
Verification
After completing all steps, verify Kubernetes is ready:
# Check node is ready
kubectl get nodes
# Check namespace exists
kubectl get namespaces | grep caritas
# Check storage class
kubectl get storageclassTroubleshooting
k3s Not Running
Check k3s logs:
sudo journalctl -u k3s -fVerify swap is disabled (required for k3s):
free -hCannot Access Cluster
Check kubeconfig:
cat ~/.kube/configVerify file permissions:
ls -la ~/.kube/config
# Should be readable by your userStorage Class Missing
If local-path storage class is missing:
# Check if local-path-provisioner is running
kubectl get pods -n local-path-storageVerification
After completing all steps, verify everything is configured:
# Check node is ready
kubectl get nodes
# Check namespace exists
kubectl get namespaces | grep caritas
# Check ClusterIssuer
kubectl get clusterissuer letsencrypt-prod
# Check secrets
kubectl get secrets -n caritas
# Check Ingress Controller
kubectl get pods -n ingress-nginx
# Check cert-manager
kubectl get pods -n cert-managerNext Steps
- Setup Databases - Initialize database schemas
- Deploy Infrastructure - Deploy all services via Helm