Compare commits
4 Commits
1e9169fcd5
...
b4a9b30a3f
Author | SHA1 | Date |
---|---|---|
|
b4a9b30a3f | |
|
78e51c18a7 | |
|
b330957564 | |
|
b029dfbf90 |
20
README.md
20
README.md
|
@ -57,8 +57,8 @@ http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-da
|
||||||
|
|
||||||
scp haproxy.conf root@ssh root@$(hetzner-kube cluster master-ip k8s-test):
|
scp haproxy.conf root@ssh root@$(hetzner-kube cluster master-ip k8s-test):
|
||||||
ssh root@$(hetzner-kube cluster master-ip k8s-test)
|
ssh root@$(hetzner-kube cluster master-ip k8s-test)
|
||||||
apt install haproxy
|
apt install -y haproxy
|
||||||
mv haproxy.conf /etc/haproxy/haproxy.cfg
|
mv haproxy.cfg /etc/haproxy/haproxy.cfg
|
||||||
systemctl restart haproxy
|
systemctl restart haproxy
|
||||||
|
|
||||||
### frontend LB variante 2
|
### frontend LB variante 2
|
||||||
|
@ -66,6 +66,22 @@ http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-da
|
||||||
ssh root@$(hetzner-kube cluster master-ip k8s-test) apt install -y python
|
ssh root@$(hetzner-kube cluster master-ip k8s-test) apt install -y python
|
||||||
ansible-playbook -i "$(hetzner-kube cluster master-ip k8s-test)," -u root ansible-haproxy.yaml
|
ansible-playbook -i "$(hetzner-kube cluster master-ip k8s-test)," -u root ansible-haproxy.yaml
|
||||||
|
|
||||||
|
## static page
|
||||||
|
|
||||||
|
kubectl apply -f staticpage.yaml
|
||||||
|
kubectl proxy
|
||||||
|
http://localhost:8001/api/v1/namespaces/testsite/pods/http:static-nginx:/proxy/#!
|
||||||
|
|
||||||
|
### add ingress
|
||||||
|
|
||||||
|
kubectl apply -f staticpage-ingress.yaml
|
||||||
|
|
||||||
|
## set up SSL
|
||||||
|
|
||||||
|
### add ssl to testsite
|
||||||
|
|
||||||
|
kubectl apply -f staticpage-ingress-ssl.yaml
|
||||||
|
|
||||||
## test deployment
|
## test deployment
|
||||||
|
|
||||||
helm install --namespace k8spress --name wordpress -f helm-wordpress.yaml stable/wordpress
|
helm install --namespace k8spress --name wordpress -f helm-wordpress.yaml stable/wordpress
|
||||||
|
|
|
@ -186,7 +186,7 @@ subjects:
|
||||||
---
|
---
|
||||||
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: DaemonSet
|
||||||
metadata:
|
metadata:
|
||||||
name: nginx-ingress-controller
|
name: nginx-ingress-controller
|
||||||
namespace: ingress-nginx
|
namespace: ingress-nginx
|
||||||
|
@ -194,11 +194,6 @@ metadata:
|
||||||
app.kubernetes.io/name: ingress-nginx
|
app.kubernetes.io/name: ingress-nginx
|
||||||
app.kubernetes.io/part-of: ingress-nginx
|
app.kubernetes.io/part-of: ingress-nginx
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/name: ingress-nginx
|
|
||||||
app.kubernetes.io/part-of: ingress-nginx
|
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
|
@ -261,5 +256,4 @@ spec:
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
timeoutSeconds: 10
|
timeoutSeconds: 10
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
@ -18,6 +18,7 @@ spec:
|
||||||
port: 443
|
port: 443
|
||||||
targetPort: 443
|
targetPort: 443
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
nodePort: 30181
|
||||||
selector:
|
selector:
|
||||||
app.kubernetes.io/name: ingress-nginx
|
app.kubernetes.io/name: ingress-nginx
|
||||||
app.kubernetes.io/part-of: ingress-nginx
|
app.kubernetes.io/part-of: ingress-nginx
|
||||||
|
|
|
@ -171,7 +171,7 @@ spec:
|
||||||
cephVersion:
|
cephVersion:
|
||||||
# For the latest ceph images, see https://hub.docker.com/r/ceph/ceph/tags
|
# For the latest ceph images, see https://hub.docker.com/r/ceph/ceph/tags
|
||||||
image: ceph/ceph:v13.2.4-20190109
|
image: ceph/ceph:v13.2.4-20190109
|
||||||
dataDirHostPath: /rook
|
dataDirHostPath: /ceph
|
||||||
dashboard:
|
dashboard:
|
||||||
enabled: true
|
enabled: true
|
||||||
mon:
|
mon:
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: web-service
|
||||||
|
namespace: testsite
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 80
|
||||||
|
name: http
|
||||||
|
selector:
|
||||||
|
app: web-backend
|
||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: testsite-ingress
|
||||||
|
namespace: testsite
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: "nginx"
|
||||||
|
certmanager.k8s.io/cluster-issuer: letsencrypt-staging
|
||||||
|
certmanager.k8s.io/acme-challenge-type: http01
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: test.k.zknt.org
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
serviceName: web-service
|
||||||
|
servicePort: 80
|
||||||
|
path: /
|
||||||
|
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- test.k.zknt.org
|
||||||
|
secretName: testsite-certificate
|
|
@ -0,0 +1,27 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: web-service
|
||||||
|
namespace: testsite
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: 80
|
||||||
|
selector:
|
||||||
|
app: web-backend
|
||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: testsite-ingress
|
||||||
|
namespace: testsite
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: test.k.zknt.org
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
serviceName: web-service
|
||||||
|
servicePort: 80
|
||||||
|
path: /
|
|
@ -0,0 +1,40 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: testsite
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: webdir
|
||||||
|
namespace: testsite
|
||||||
|
data:
|
||||||
|
index.html: |
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Blank page</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
Nothing here to see.
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: static-nginx
|
||||||
|
namespace: testsite
|
||||||
|
labels:
|
||||||
|
app: web-backend
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: webserver
|
||||||
|
image: nginx:alpine
|
||||||
|
volumeMounts:
|
||||||
|
- name: webdir
|
||||||
|
mountPath: /usr/share/nginx/html
|
||||||
|
volumes:
|
||||||
|
- name: webdir
|
||||||
|
configMap:
|
||||||
|
name: webdir
|
||||||
|
|
Loading…
Reference in New Issue