Commit 71017c3c authored by Geoff Simmons's avatar Geoff Simmons

Update deployment YAMLs to support TLS offload.

This introduces moving the port definitions for admin services to
a headless Service -- varnish-ingress-admin in admin-svc.yaml. Services
that implement Ingress with Varnish are identified by this Service:
label app=varnish-ingress and at least the port named varnishadm,
possibly also the admin ports for the haproxy offloader (dataplane
and faccess).
parent da2f29b8
......@@ -7,3 +7,4 @@ metadata:
type: Opaque
data:
admin: XGASQn0dd/oEsWh5WMXUpmKAKNZYnQGsHSmO/nHkv1w=
dataplaneapi: ZTI0YmIzMTItY2IyMS00NmQ2LWFhZWMtOGFlNjc2ZjA2ZmVhCg==
apiVersion: v1
kind: Service
metadata:
name: varnish-ingress-admin
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
......@@ -2,6 +2,10 @@
kubectl apply -f adm-secret.yaml
kubectl apply -f tls-cert-secret.yaml
kubectl apply -f varnish.yaml
kubectl apply -f admin-svc.yaml
kubectl apply -f nodeport.yaml
......@@ -7,16 +7,16 @@ metadata:
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
spec:
type: NodePort
type: NodePort
ports:
- port: 6081
targetPort: 6081
protocol: TCP
name: varnishadm
- port: 80
targetPort: 80
protocol: TCP
name: http
- port: 443
targetPort: 443
protocol: TCP
name: tls
selector:
app: varnish-ingress
publishNotReadyAddresses: true
......@@ -20,6 +20,17 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- secrets
resourceNames:
- tls-cert
verbs:
- get
- list
- watch
- update
- apiGroups:
- ""
resources:
......
apiVersion: v1
kind: Secret
metadata:
name: tls-cert
labels:
app: varnish-ingress
type: Opaque
......@@ -2,8 +2,12 @@
kubectl delete -f nodeport.yaml
kubectl delete -f admin-svc.yaml
kubectl delete -f varnish.yaml
kubectl delete -f tls-cert-secret.yaml
kubectl delete -f adm-secret.yaml
echo Waiting until varnish-ingress Pods are deleted
......
......@@ -12,6 +12,10 @@ spec:
labels:
app: varnish-ingress
spec:
securityContext:
# group varnish in the varnish and haproxy containers
# The varnish and haproxy users belong to this group.
fsGroup: 998
containers:
- image: varnish-ingress/varnish
imagePullPolicy: IfNotPresent
......@@ -21,14 +25,14 @@ spec:
containerPort: 80
- name: k8s
containerPort: 8080
- name: varnishadm
containerPort: 6081
volumeMounts:
- name: adm-secret
mountPath: "/var/run/varnish"
readOnly: true
- name: varnish-home
mountPath: "/var/run/varnish-home"
- name: offload
mountPath: "/var/run/offload"
livenessProbe:
exec:
command:
......@@ -43,6 +47,37 @@ spec:
args:
- -n
- /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: adm-secret
key: dataplaneapi
livenessProbe:
exec:
command:
- /usr/bin/pgrep
- -P
- "0"
- haproxy
readinessProbe:
httpGet:
path: /healthz
port: k8s
volumes:
- name: adm-secret
secret:
......@@ -50,6 +85,12 @@ spec:
items:
- key: admin
path: _.secret
- name: tls-cert
secret:
secretName: tls-cert
defaultMode: 0440
- name: varnish-home
emptyDir:
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