Add letsencrypt
This commit is contained in:
parent
822cd4a3ef
commit
350f17fd36
|
@ -0,0 +1 @@
|
|||
https://stackoverflow.com/questions/67430592/how-to-setup-letsencrypt-with-kubernetes-microk8s-using-default-ingress
|
|
@ -0,0 +1,24 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: ingress-routes
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
#change to your domain
|
||||
- k8s.technical.kiwi
|
||||
secretName: tls-secret
|
||||
rules:
|
||||
#change yourdomain.com to your domain
|
||||
- host: k8s.technical.kiwi
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: webserver-svc
|
||||
port:
|
||||
number: 80
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: cert-manager.io/v1
|
||||
kind: ClusterIssuer
|
||||
metadata:
|
||||
name: letsencrypt-prod
|
||||
spec:
|
||||
acme:
|
||||
server: https://acme-v02.api.letsencrypt.org/directory
|
||||
#change to your email
|
||||
email: admin@technical.kiwi
|
||||
privateKeySecretRef:
|
||||
name: letsencrypt-prod
|
||||
solvers:
|
||||
- http01:
|
||||
ingress:
|
||||
class: public
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: cert-manager.io/v1
|
||||
kind: ClusterIssuer
|
||||
metadata:
|
||||
name: letsencrypt-staging
|
||||
spec:
|
||||
acme:
|
||||
#change to your email
|
||||
email: admin@technical.kiwi
|
||||
server: https://acme-staging-v02.api.letsencrypt.org/directory
|
||||
privateKeySecretRef:
|
||||
name: letsencrypt-staging
|
||||
solvers:
|
||||
- http01:
|
||||
ingress:
|
||||
class: public
|
|
@ -0,0 +1,29 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: webserver-depl
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: webserver-app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: webserver-app
|
||||
spec:
|
||||
containers:
|
||||
- name: webserver-app
|
||||
image: nginx:1.8
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: webserver-svc
|
||||
spec:
|
||||
selector:
|
||||
app: webserver-app
|
||||
ports:
|
||||
- name: webserver-app
|
||||
protocol: TCP
|
||||
port: 80
|
||||
targetPort: 80
|
Loading…
Reference in New Issue