This guide provides steps to set up your Kubernetes project, including installing Certbot, obtaining SSL certificates, creating Kubernetes secrets, and configuring your deployment.
- Domain names for your control machine and load balancer.
- Kubernetes and kubectl installed and configured.
Ensure your domains' DDNS are pointing correctly:
Control Machine: Point DDNS to your control machine. (A)
To obtain SSL certificates for your domains, first install Certbot:
sudo yum install certbotRun Certbot to obtain SSL certificates for your domains:
sudo certbot certonlySwitch to the root user and navigate to the Let's Encrypt live directory:
sudo su
cd /etc/letsencrypt/liveFind your domain folder, then copy the certificates to your project directory:
cd [your folder]
cp fullchain.pem /home/ec2-user/Kubernetes-Project/kubeproject/certs/
cp privkey.pem /home/ec2-user/Kubernetes-Project/kubeproject/certs/Change to your project certificates directory and create a Kubernetes secret:
cd /home/ec2-user/Kubernetes-Project/kubeproject/certs
sudo kubectl create secret generic danielp-secret --from-file=privkey.pem --from-file=fullchain.pemChange the ownership of the copied certificate files to the ec2-user:
sudo chown ec2-user:ec2-user fullchain.pem privkey.pemConfigMap: Update your ConfigMap to include your domains.
Deployment: Update your deployment configuration to reference the created secret.
Ensure your domains' DDNS are pointing correctly:
Delete the previous name registries (A)
Load Balancer: Point DDNS to your AWS load balancer. (CNAME)
kubectl delete --all all -n defaultkubectl logs
kubectl describe