This guide provides detailed instructions for installing the mTLS Certificate Operator in your Kubernetes cluster.
Before installing the operator, ensure your environment meets the following requirements:
- Kubernetes cluster (v1.19+)
- kubectl (v1.19+)
- cert-manager (v1.5+)
- NGINX Ingress Controller
The operator requires minimal resources:
- CPU: 250m (request), 500m (limit)
- Memory: 128Mi (request), 256Mi (limit)
First, install cert-manager in your cluster:
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.5.0/cert-manager.yaml
# Wait for cert-manager to be ready
kubectl wait --for=condition=Ready pods -l app=cert-manager -n cert-managerDeploy the root CA and cluster issuer:
kubectl apply -f config/dependencies/cert-manager/root-ca.yaml
# Wait for the root CA to be ready
kubectl wait --for=condition=Ready certificate root-ca-cert -n defaultDeploy the necessary RBAC resources:
kubectl apply -f config/rbac/service_account.yaml
kubectl apply -f config/rbac/role.yaml
kubectl apply -f config/rbac/role_binding.yamlDeploy the operator:
kubectl apply -f config/samples/operator.yamlVerify the operator is running:
kubectl get pods -l app=tenant-operatorThe operator supports the following configuration options through environment variables:
LOG_LEVEL: Logging level (default: INFO)WATCH_NAMESPACE: Namespace to watch (default: all namespaces)CERT_VALIDITY_DAYS: Certificate validity period in days (default: 365)
If you're using a private registry:
-
Create a secret with your registry credentials:
kubectl create secret docker-registry regcred \ --docker-server=<your-registry-server> \ --docker-username=<your-username> \ --docker-password=<your-password> \ --docker-email=<your-email>
-
Reference it in your operator deployment:
imagePullSecrets: - name: regcred
-
Check operator status:
kubectl get pods -l app=tenant-operator
-
Check operator logs:
kubectl logs -l app=tenant-operator
-
Create a test tenant:
kubectl apply -f config/samples/mtls_v1_tenant.yaml
-
Verify tenant creation:
kubectl get tenants
To deploy the test server for verifying mTLS functionality:
kubectl apply -f config/samples/test-server/To upgrade the operator to a new version:
kubectl set image deployment/tenant-operator operator=marouandock/invoisight:operator3-newTo remove the operator and its resources:
# Remove tenants
kubectl delete tenants --all
# Remove operator
kubectl delete -f config/samples/operator.yaml
# Remove RBAC
kubectl delete -f config/rbac/-
Operator pod not starting:
- Check pod logs:
kubectl logs -l app=tenant-operator - Verify RBAC:
kubectl auth can-i - Check registry credentials
- Check pod logs:
-
Certificate not being issued:
- Check cert-manager logs
- Verify root CA status
- Check tenant status
If you encounter any issues:
- Check the operator logs
- Review the troubleshooting guide in the usage documentation
- Submit an issue on GitHub with relevant logs and details