A brief copy of the GKE static IP tutorial is below.
First, deploy the sample web application manifest which contains the Deployment and a NodePort Service (required by Ingress):
kubectl apply -f https://raw.githubusercontent.com/ahmetb/gke-letsencrypt/master/yaml/sample-app.yaml
Create a static IP called to (will be used in the Ingress):
gcloud compute addresses create helloweb-ip --global
Update your domain name records (at your domain registrar or DNS provider) with this IP address.
gcloud compute addresses describe helloweb-ip --global --format 'value(address)'
Save sample-ingress-tls manifest, which will request
a certificate for a domain name from the letsencrypt-prod
issuer:
curl -O https://raw.githubusercontent.com/ahmetb/gke-letsencrypt/master/yaml/sample-ingress-tls.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: helloweb
annotations:
kubernetes.io/ingress.global-static-ip-name: helloweb-ip
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
certmanager.k8s.io/acme-http01-edit-in-place: "true"
labels:
app: hello
spec:
backend:
serviceName: helloweb-backend
servicePort: 8080
tls:
- secretName: www-dogs-com-tls
hosts:
- www.dogs.com
Modify a few things before deploying this manifest:
- Replace
www.dogs.com
with your domain name - Replace
dogs-com-tls
(will be used to create the TLS Secret) with a name that is suitable - Replace
helloweb
with the Ingress name that your website is running on
Then apply this manifest:
kubectl apply -f sample-ingress-tls.yaml
Next: Get a certificate for your domain name →