Skip to content

Instantly share code, notes, and snippets.

@jmrobles
Last active May 17, 2020 18:22
Show Gist options
  • Save jmrobles/89d3cb04970bf29c1cf6c16577e9865f to your computer and use it in GitHub Desktop.
Save jmrobles/89d3cb04970bf29c1cf6c16577e9865f to your computer and use it in GitHub Desktop.
Let's Encrypt
apiVersion: apps/v1
kind: Deployment
metadata:
name: kuard
namespace: app
spec:
selector:
matchLabels:
app: kuard
replicas: 1
template:
metadata:
labels:
app: kuard
spec:
containers:
- image: gcr.io/kuar-demo/kuard-amd64:1
imagePullPolicy: Always
name: kuard
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: kuard
namespace: app
spec:
ports:
- port: 80
targetPort: 8080
protocol: TCP
selector:
app: kuard
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kuard
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/issuer: "letsencrypt-staging"
spec:
tls:
- hosts:
- yourdomain.com
secretName: quickstart-example-tls
rules:
- host: yourdomain.com
http:
paths:
- path: /
backend:
serviceName: kuard
servicePort: 80
apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
name: letsencrypt-prod
namespace: app
spec:
acme:
# The ACME server URL
server: https://acme-v02.api.letsencrypt.org/directory
# Email address used for ACME registration
email: your@email.com
# Name of a secret used to store the ACME account private key
privateKeySecretRef:
name: letsencrypt-prod
# Enable the HTTP-01 challenge provider
solvers:
- http01:
ingress:
class: nginx
apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
name: letsencrypt-staging
namespace: app
spec:
acme:
# The ACME server URL
server: https://acme-staging-v02.api.letsencrypt.org/directory
# Email address used for ACME registration
email: your@email.com
# Name of a secret used to store the ACME account private key
privateKeySecretRef:
name: letsencrypt-staging
# Enable the HTTP-01 challenge provider
solvers:
- http01:
ingress:
class: nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment