-
Notifications
You must be signed in to change notification settings - Fork 4
/
octavia-ingress-controller-test.txt
81 lines (74 loc) · 1.96 KB
/
octavia-ingress-controller-test.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#1. Verify service account and cluster role binding
kubectl -n kube-system get ServiceAccount octavia-ingress-controller
kubectl -n kube-system get ClusterRoleBinding octavia-ingress-controller
#2. Verify octavia-ingress-controller configuration
kubectl -n kube-system get ConfigMap octavia-ingress-controller-config
#3. Verify octavia-ingress-controller deployment
kubectl -n kube-system get StatefulSet octavia-ingress-controller
#4. Create a backend service
cat <<EOF > dep-webserver.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: webserver
namespace: default
labels:
app: webserver
spec:
replicas: 1
selector:
matchLabels:
app: webserver
template:
metadata:
labels:
app: webserver
spec:
containers:
- name: webserver
image: lingxiankong/alpine-test
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
EOF
kubectl apply -f dep-webserver.yaml
kubectl expose deployment webserver --type=NodePort --target-port=8080
kubectl get svc
source karno-openrc.sh
openstack server list
ssh -l core 10.14.14.1XX curl http://10.XXX.XXX.XXX:8080
#5. Create an ingress resource
cat <<EOF > ing-test-octavia-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test-octavia-ingress
annotations:
kubernetes.io/ingress.class: "openstack"
octavia.ingress.kubernetes.io/internal: "false"
spec:
rules:
- host: web.stratus.ok
http:
paths:
- path: /ping
pathType: Exact
backend:
service:
name: webserver
port:
number: 8080
EOF
kubectl apply -f ing-test-octavia-ingress.yaml
kubectl get ing -w
#Ctrl+C
openstack loadbalancer list
curl -H "Host: web.stratus.ok" http://10.14.14.1XX/ping
#6. Delete resources
kubectl delete ing test-octavia-ingress
kubectl get ing
openstack loadbalancer list
kubectl delete svc webserver
kubectl get svc
kubectl delete deployment webserver
kubectl get deployment