Skip to content

Commit 8274834

Browse files
UPSTREAM: <carry>: use projected volume for CAs to avoid subPath limitations
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
1 parent 193faf3 commit 8274834

File tree

2 files changed

+25
-31
lines changed

2 files changed

+25
-31
lines changed
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
- op: add
22
path: /spec/template/spec/volumes/-
3-
value: {"name":"trusted-ca-bundle", "configMap":{"optional":false,"name":"trusted-ca-bundle", "items":[{"key":"ca-bundle.crt","path":"ca-bundle.crt"}]}}
4-
- op: add
5-
path: /spec/template/spec/volumes/-
6-
value: {"name":"service-ca", "configMap":{"optional":false,"name":"openshift-service-ca.crt", "items":[{"key":"service-ca.crt","path":"service-ca.crt"}]}}
7-
- op: add
8-
path: /spec/template/spec/containers/0/volumeMounts/-
9-
value: {"name":"trusted-ca-bundle", "mountPath":"/var/trusted-cas/ca-bundle.crt", "subPath":"ca-bundle.crt" }
3+
value: {"name":"ca-certs", "projected": {"sources":[{"configMap":{"optional":false,"name":"trusted-ca-bundle", "items":[{"key":"ca-bundle.crt","path":"ca-bundle.crt"}]}},{"configMap":{"optional":false,"name":"openshift-service-ca.crt", "items":[{"key":"service-ca.crt","path":"service-ca.crt"}]}}]}}
104
- op: add
115
path: /spec/template/spec/containers/0/volumeMounts/-
12-
value: {"name":"service-ca", "mountPath":"/var/trusted-cas/service-ca.crt", "subPath":"service-ca.crt" }
6+
value: {"name":"ca-certs", "mountPath":"/var/ca-certs", "readOnly": true}
137
- op: add
14-
path: /spec/template/spec/containers/0/args/-
15-
value: "--ca-certs-dir=/var/trusted-cas"
8+
path: /spec/template/spec/containers/0/env
9+
value: [{"name":"SSL_CERT_DIR", "value":"/var/ca-certs"}]

openshift/manifests/20-deployment-openshift-operator-controller-operator-controller-controller-manager.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ spec:
4343
- --health-probe-bind-address=:8081
4444
- --metrics-bind-address=127.0.0.1:8080
4545
- --leader-elect
46-
- --ca-certs-dir=/var/trusted-cas
4746
- --v=${LOG_VERBOSITY}
4847
- --global-pull-secret=openshift-config/pull-secret
4948
command:
5049
- /manager
50+
env:
51+
- name: SSL_CERT_DIR
52+
value: /var/ca-certs
5153
image: ${OPERATOR_CONTROLLER_IMAGE}
5254
imagePullPolicy: IfNotPresent
5355
livenessProbe:
@@ -76,12 +78,9 @@ spec:
7678
volumeMounts:
7779
- mountPath: /var/cache
7880
name: cache
79-
- mountPath: /var/trusted-cas/ca-bundle.crt
80-
name: trusted-ca-bundle
81-
subPath: ca-bundle.crt
82-
- mountPath: /var/trusted-cas/service-ca.crt
83-
name: service-ca
84-
subPath: service-ca.crt
81+
- mountPath: /var/ca-certs
82+
name: ca-certs
83+
readOnly: true
8584
- mountPath: /etc/containers
8685
name: etc-containers
8786
readOnly: true
@@ -131,20 +130,21 @@ spec:
131130
volumes:
132131
- emptyDir: {}
133132
name: cache
134-
- configMap:
135-
items:
136-
- key: ca-bundle.crt
137-
path: ca-bundle.crt
138-
name: operator-controller-trusted-ca-bundle
139-
optional: false
140-
name: trusted-ca-bundle
141-
- configMap:
142-
items:
143-
- key: service-ca.crt
144-
path: service-ca.crt
145-
name: openshift-service-ca.crt
146-
optional: false
147-
name: service-ca
133+
- name: ca-certs
134+
projected:
135+
sources:
136+
- configMap:
137+
items:
138+
- key: ca-bundle.crt
139+
path: ca-bundle.crt
140+
name: operator-controller-trusted-ca-bundle
141+
optional: false
142+
- configMap:
143+
items:
144+
- key: service-ca.crt
145+
path: service-ca.crt
146+
name: openshift-service-ca.crt
147+
optional: false
148148
- hostPath:
149149
path: /etc/containers
150150
type: Directory

0 commit comments

Comments
 (0)