Skip to content

Commit cdda84c

Browse files
anik120ankitathomas
authored andcommitted
UPSTREAM: <carry>: Add hostPath mount for /var/lib/kubelet
MCO makes the global pull secrets available in `/var/lib/kubelet`. Operator-controller will look for these secrets in `/etc/operator-controller` folder, ref [operator-controller:1303](operator-framework/operator-controller#1303). This PR hostPath mounts the `/var/lib/kublet` directory from the host to the `/etc/operator-controller` directory in the container's filesystem. RFC: [OLMv1 Private registry support](https://docs.google.com/document/d/1BXD6kj5zXHcGiqvJOikU2xs8kV26TPnzEKp6n7TKD4M/edit?usp=sharing) Signed-off-by: Anik Bhattacharjee <anbhatta@redhat.com>
1 parent c3a6a1b commit cdda84c

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

openshift/generate-manifests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ trap 'rm -rf $TMP_ROOT' EXIT
3939
TMP_CONFIG="${TMP_ROOT}/config"
4040
cp -a "${REPO_ROOT}/config" "$TMP_CONFIG"
4141

42-
# Override namespace to openshift-operator-controller
43-
$YQ -i ".namespace = \"${NAMESPACE}\"" "${TMP_CONFIG}/base/kustomization.yaml"
42+
# Override OPENSHIFT-NAMESPACE to ${NAMESPACE}
43+
find "${TMP_ROOT}" -name "*.yaml" -exec sed -i.tmp "s/OPENSHIFT-NAMESPACE/${NAMESPACE}/g" {} \;
4444

4545
# Create a temp dir for manifests
4646
TMP_MANIFEST_DIR="${TMP_ROOT}/manifests"

openshift/kustomize/overlays/openshift/kustomization.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ patches:
1414
kind: Deployment
1515
name: controller-manager
1616
path: patches/manager_deployment_ca.yaml
17+
- target:
18+
kind: Deployment
19+
name: controller-manager
20+
path: patches/manager_deployment_mount_auth_host.yaml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- op: add
2+
path: /spec/template/spec/volumes/-
3+
value: {"name":"global-auth-file", "hostPath":{"path":"/var/lib/kubelet/config.json", "type": "File"}}
4+
- op: add
5+
path: /spec/template/spec/containers/0/volumeMounts/-
6+
value: {"name":"global-auth-file", "readOnly": true, "mountPath":"/etc/operator-controller/auth.json"}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ spec:
7878
name: olmv1-certificate
7979
readOnly: true
8080
subPath: olm-ca.crt
81+
- mountPath: /etc/operator-controller/auth.json
82+
name: global-auth-file
83+
readOnly: true
8184
- args:
8285
- --secure-listen-address=0.0.0.0:8443
8386
- --upstream=http://127.0.0.1:8080/
@@ -115,4 +118,8 @@ spec:
115118
name: operator-controller-openshift-ca
116119
optional: false
117120
name: olmv1-certificate
121+
- hostPath:
122+
path: /var/lib/kubelet/config.json
123+
type: File
124+
name: global-auth-file
118125
priorityClassName: system-cluster-critical

0 commit comments

Comments
 (0)