Commit 46ca05b2 authored by Geoff Simmons's avatar Geoff Simmons

Update the "multiple controller" example.

parent ed5adcdb
...@@ -8,3 +8,4 @@ metadata: ...@@ -8,3 +8,4 @@ metadata:
type: Opaque type: Opaque
data: data:
admin: BhjBhxjqrbCnW2eYLoUL+C2TN51a8sWQIfL9oRWPY2E= admin: BhjBhxjqrbCnW2eYLoUL+C2TN51a8sWQIfL9oRWPY2E=
dataplaneapi: OWVjYmNlZjItMzA3MC00NjhlLTkzMGEtM2NhMTliNGJkMWM0
...@@ -8,3 +8,4 @@ metadata: ...@@ -8,3 +8,4 @@ metadata:
type: Opaque type: Opaque
data: data:
admin: IZqtwnccuVoCblGaTq8yK8mOk8gtLwWmbZq17tpcdwo= admin: IZqtwnccuVoCblGaTq8yK8mOk8gtLwWmbZq17tpcdwo=
dataplaneapi: MzllNDZhNWQtZjVkMy00YzYwLWJjODEtMmJlOGVjYzkwNjM2
apiVersion: v1
kind: Service
metadata:
name: varnish-coffee-admin
namespace: cafe
labels:
app: varnish-ingress
spec:
clusterIP: None
ports:
- port: 6081
targetPort: 6081
protocol: TCP
name: varnishadm
- port: 5555
targetPort: 5555
protocol: TCP
name: dataplane
- port: 5556
targetPort: 5556
protocol: TCP
name: faccess
- port: 9443
targetPort: 9443
protocol: TCP
name: stats
selector:
app: varnish-ingress
ingress: coffee
apiVersion: v1
kind: Service
metadata:
name: varnish-tea-admin
namespace: cafe
labels:
app: varnish-ingress
spec:
clusterIP: None
ports:
- port: 6081
targetPort: 6081
protocol: TCP
name: varnishadm
- port: 5555
targetPort: 5555
protocol: TCP
name: dataplane
- port: 5556
targetPort: 5556
protocol: TCP
name: faccess
- port: 9443
targetPort: 9443
protocol: TCP
name: stats
selector:
app: varnish-ingress
ingress: tea
...@@ -5,7 +5,7 @@ metadata: ...@@ -5,7 +5,7 @@ metadata:
namespace: cafe namespace: cafe
annotations: annotations:
kubernetes.io/ingress.class: "varnish-coffee" kubernetes.io/ingress.class: "varnish-coffee"
ingress.varnish-cache.org/varnish-svc: "varnish-coffee" ingress.varnish-cache.org/varnish-svc: "varnish-coffee-admin"
spec: spec:
rules: rules:
- host: coffee.example.com - host: coffee.example.com
......
...@@ -11,14 +11,20 @@ kubectl apply -f coffee.yaml ...@@ -11,14 +11,20 @@ kubectl apply -f coffee.yaml
kubectl apply -f tea.yaml kubectl apply -f tea.yaml
kubectl apply -f tls-cert-secret.yaml
kubectl apply -f adm-secret-tea.yaml kubectl apply -f adm-secret-tea.yaml
kubectl apply -f nodeport-tea.yaml kubectl apply -f nodeport-tea.yaml
kubectl apply -f admin-svc-tea.yaml
kubectl apply -f varnish-tea.yaml kubectl apply -f varnish-tea.yaml
kubectl apply -f adm-secret-coffee.yaml kubectl apply -f adm-secret-coffee.yaml
kubectl apply -f admin-svc-coffee.yaml
kubectl apply -f nodeport-coffee.yaml kubectl apply -f nodeport-coffee.yaml
kubectl apply -f varnish-coffee.yaml kubectl apply -f varnish-coffee.yaml
......
...@@ -10,14 +10,14 @@ metadata: ...@@ -10,14 +10,14 @@ metadata:
spec: spec:
type: NodePort type: NodePort
ports: ports:
- port: 6081
targetPort: 6081
protocol: TCP
name: varnishadm
- port: 80 - port: 80
targetPort: 80 targetPort: 80
protocol: TCP protocol: TCP
name: http name: http
- port: 443
targetPort: 443
protocol: TCP
name: tls
selector: selector:
app: varnish-ingress app: varnish-ingress
ingress: coffee ingress: coffee
......
...@@ -10,14 +10,14 @@ metadata: ...@@ -10,14 +10,14 @@ metadata:
spec: spec:
type: NodePort type: NodePort
ports: ports:
- port: 6081
targetPort: 6081
protocol: TCP
name: varnishadm
- port: 80 - port: 80
targetPort: 80 targetPort: 80
protocol: TCP protocol: TCP
name: http name: http
- port: 443
targetPort: 443
protocol: TCP
name: tls
selector: selector:
app: varnish-ingress app: varnish-ingress
ingress: tea ingress: tea
......
...@@ -5,7 +5,7 @@ metadata: ...@@ -5,7 +5,7 @@ metadata:
namespace: cafe namespace: cafe
annotations: annotations:
kubernetes.io/ingress.class: "varnish" kubernetes.io/ingress.class: "varnish"
ingress.varnish-cache.org/varnish-svc: "varnish-tea" ingress.varnish-cache.org/varnish-svc: "varnish-tea-admin"
spec: spec:
rules: rules:
- host: tea.example.com - host: tea.example.com
......
apiVersion: v1
kind: Secret
metadata:
name: tls-cert
namespace: cafe
labels:
app: varnish-ingress
type: Opaque
...@@ -8,14 +8,20 @@ kubectl delete -f varnish-coffee.yaml ...@@ -8,14 +8,20 @@ kubectl delete -f varnish-coffee.yaml
kubectl delete -f nodeport-coffee.yaml kubectl delete -f nodeport-coffee.yaml
kubectl delete -f admin-svc-coffee.yaml
kubectl delete -f adm-secret-coffee.yaml kubectl delete -f adm-secret-coffee.yaml
kubectl delete -f varnish-tea.yaml kubectl delete -f varnish-tea.yaml
kubectl delete -f nodeport-tea.yaml kubectl delete -f nodeport-tea.yaml
kubectl delete -f admin-svc-tea.yaml
kubectl delete -f adm-secret-tea.yaml kubectl delete -f adm-secret-tea.yaml
kubectl delete -f tls-cert-secret.yaml
kubectl delete -f tea.yaml kubectl delete -f tea.yaml
kubectl delete -f coffee.yaml kubectl delete -f coffee.yaml
......
...@@ -15,6 +15,8 @@ spec: ...@@ -15,6 +15,8 @@ spec:
app: varnish-ingress app: varnish-ingress
ingress: coffee ingress: coffee
spec: spec:
securityContext:
fsGroup: 998
containers: containers:
- image: varnish-ingress/varnish - image: varnish-ingress/varnish
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
...@@ -24,14 +26,14 @@ spec: ...@@ -24,14 +26,14 @@ spec:
containerPort: 80 containerPort: 80
- name: k8s - name: k8s
containerPort: 8080 containerPort: 8080
- name: varnishadm
containerPort: 6081
volumeMounts: volumeMounts:
- name: adm-secret - name: adm-secret
mountPath: "/var/run/varnish" mountPath: "/var/run/varnish"
readOnly: true readOnly: true
- name: varnish-home - name: varnish-home
mountPath: "/var/run/varnish-home" mountPath: "/var/run/varnish-home"
- name: offload
mountPath: "/var/run/offload"
livenessProbe: livenessProbe:
exec: exec:
command: command:
...@@ -46,6 +48,37 @@ spec: ...@@ -46,6 +48,37 @@ spec:
args: args:
- -n - -n
- /var/run/varnish-home - /var/run/varnish-home
- image: varnish-ingress/haproxy
imagePullPolicy: IfNotPresent
name: varnish-ingress-offloader
ports:
- name: tls
containerPort: 443
- name: k8s
containerPort: 8443
volumeMounts:
- name: tls-cert
mountPath: "/etc/ssl/private"
readOnly: true
- name: offload
mountPath: "/var/run/offload"
env:
- name: SECRET_DATAPLANEAPI
valueFrom:
secretKeyRef:
name: coffee-secret
key: dataplaneapi
livenessProbe:
exec:
command:
- /usr/bin/pgrep
- -P
- "0"
- haproxy
readinessProbe:
httpGet:
path: /healthz
port: k8s
volumes: volumes:
- name: adm-secret - name: adm-secret
secret: secret:
...@@ -53,6 +86,12 @@ spec: ...@@ -53,6 +86,12 @@ spec:
items: items:
- key: admin - key: admin
path: _.secret path: _.secret
- name: tls-cert
secret:
secretName: tls-cert
defaultMode: 0440
- name: varnish-home - name: varnish-home
emptyDir: emptyDir:
medium: "Memory" medium: "Memory"
- name: offload
emptyDir: {}
...@@ -15,6 +15,8 @@ spec: ...@@ -15,6 +15,8 @@ spec:
app: varnish-ingress app: varnish-ingress
ingress: tea ingress: tea
spec: spec:
securityContext:
fsGroup: 998
containers: containers:
- image: varnish-ingress/varnish - image: varnish-ingress/varnish
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
...@@ -24,14 +26,14 @@ spec: ...@@ -24,14 +26,14 @@ spec:
containerPort: 80 containerPort: 80
- name: k8s - name: k8s
containerPort: 8080 containerPort: 8080
- name: varnishadm
containerPort: 6081
volumeMounts: volumeMounts:
- name: adm-secret - name: adm-secret
mountPath: "/var/run/varnish" mountPath: "/var/run/varnish"
readOnly: true readOnly: true
- name: varnish-home - name: varnish-home
mountPath: "/var/run/varnish-home" mountPath: "/var/run/varnish-home"
- name: offload
mountPath: "/var/run/offload"
livenessProbe: livenessProbe:
exec: exec:
command: command:
...@@ -46,6 +48,37 @@ spec: ...@@ -46,6 +48,37 @@ spec:
args: args:
- -n - -n
- /var/run/varnish-home - /var/run/varnish-home
- image: varnish-ingress/haproxy
imagePullPolicy: IfNotPresent
name: varnish-ingress-offloader
ports:
- name: tls
containerPort: 443
- name: k8s
containerPort: 8443
volumeMounts:
- name: tls-cert
mountPath: "/etc/ssl/private"
readOnly: true
- name: offload
mountPath: "/var/run/offload"
env:
- name: SECRET_DATAPLANEAPI
valueFrom:
secretKeyRef:
name: tea-secret
key: dataplaneapi
livenessProbe:
exec:
command:
- /usr/bin/pgrep
- -P
- "0"
- haproxy
readinessProbe:
httpGet:
path: /healthz
port: k8s
volumes: volumes:
- name: adm-secret - name: adm-secret
secret: secret:
...@@ -53,6 +86,12 @@ spec: ...@@ -53,6 +86,12 @@ spec:
items: items:
- key: admin - key: admin
path: _.secret path: _.secret
- name: tls-cert
secret:
secretName: tls-cert
defaultMode: 0440
- name: varnish-home - name: varnish-home
emptyDir: emptyDir:
medium: "Memory" medium: "Memory"
- name: offload
emptyDir: {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment