Compare commits
3 Commits
94fff2eb22
...
master
Author | SHA1 | Date | |
---|---|---|---|
350f17fd36 | |||
822cd4a3ef | |||
5366d94508 |
@@ -1,5 +1,25 @@
|
||||
# K8s setup with Nignx Ingress
|
||||
|
||||
```kubectl apply -f k8s/ingress```
|
||||
|
||||
Edit hosts file on host machine
|
||||
|
||||
Get ip of vm
|
||||
|
||||
```ip -o a | grep ens```
|
||||
|
||||
```sudo nano /etc/hosts```
|
||||
|
||||
```<ip> ingress.local```
|
||||
|
||||
http://ingress.local
|
||||
|
||||
http://ingress.local/v2
|
||||
|
||||
|
||||
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#server-side-https-enforcement-through-redirect
|
||||
|
||||
https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/
|
||||
|
||||
https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/
|
||||
|
||||
```kubectl apply -f k8s/ingress```
|
||||
|
@@ -27,4 +27,4 @@ spec:
|
||||
number: 8080
|
||||
tls:
|
||||
- hosts:
|
||||
- hello-world.info
|
||||
- ingress.local
|
1
letsencrypt/README.md
Normal file
1
letsencrypt/README.md
Normal file
@@ -0,0 +1 @@
|
||||
https://stackoverflow.com/questions/67430592/how-to-setup-letsencrypt-with-kubernetes-microk8s-using-default-ingress
|
24
letsencrypt/ingress-routes.yaml
Normal file
24
letsencrypt/ingress-routes.yaml
Normal file
@@ -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
|
15
letsencrypt/letsencrypt-prod.yaml
Normal file
15
letsencrypt/letsencrypt-prod.yaml
Normal file
@@ -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
|
15
letsencrypt/letsencrypt-staging.yaml
Normal file
15
letsencrypt/letsencrypt-staging.yaml
Normal file
@@ -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
|
29
letsencrypt/webserver-depl-svc.yaml
Normal file
29
letsencrypt/webserver-depl-svc.yaml
Normal file
@@ -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
|
Reference in New Issue
Block a user