Compare commits

...

4 Commits

Author SHA1 Message Date
chris b4a9b30a3f staticpage exmpl 2019-05-19 13:37:13 +02:00
chris 78e51c18a7 make ingress a daemonset 2019-05-19 13:37:13 +02:00
chris b330957564 move ceph directory on hosts 2019-05-19 13:37:13 +02:00
chris b029dfbf90 fix https nodeport 2019-05-19 13:37:13 +02:00
7 changed files with 125 additions and 10 deletions

View File

@ -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):
ssh root@$(hetzner-kube cluster master-ip k8s-test)
apt install haproxy
mv haproxy.conf /etc/haproxy/haproxy.cfg
apt install -y haproxy
mv haproxy.cfg /etc/haproxy/haproxy.cfg
systemctl restart haproxy
### 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
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
helm install --namespace k8spress --name wordpress -f helm-wordpress.yaml stable/wordpress

View File

@ -186,7 +186,7 @@ subjects:
---
apiVersion: apps/v1
kind: Deployment
kind: DaemonSet
metadata:
name: nginx-ingress-controller
namespace: ingress-nginx
@ -194,11 +194,6 @@ metadata:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
template:
metadata:
labels:
@ -261,5 +256,4 @@ spec:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
---

View File

@ -18,6 +18,7 @@ spec:
port: 443
targetPort: 443
protocol: TCP
nodePort: 30181
selector:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx

View File

@ -171,7 +171,7 @@ spec:
cephVersion:
# For the latest ceph images, see https://hub.docker.com/r/ceph/ceph/tags
image: ceph/ceph:v13.2.4-20190109
dataDirHostPath: /rook
dataDirHostPath: /ceph
dashboard:
enabled: true
mon:

View File

@ -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

27
staticpage-ingress.yaml Normal file
View File

@ -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: /

40
staticpage.yaml Normal file
View File

@ -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