Skip to content

Commit 6a94bf9

Browse files
authored
Merge pull request #21734 from ahardin-rh/issue-21396
Issue 21396 fix
2 parents eb1d57f + 46639f2 commit 6a94bf9

File tree

1 file changed

+67
-16
lines changed

1 file changed

+67
-16
lines changed

modules/olm-enabling-operator-restricted-network.adoc

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,79 @@ for your Operator to run properly in a restricted network environment:
1212
require to perform their functions.
1313
* Reference all specified images by a digest (SHA) and not by a tag.
1414

15-
.Prerequisites
15+
You must use SHA references to related images in two places in the Operator's
16+
CSV:
1617

17-
* An Operator project with a CSV
18-
19-
.Procedure
20-
21-
* In your Operator's CSV, define a list of any related images:
18+
* in `spec.relatedImages`:
2219
+
2320
[source,yaml]
2421
----
25-
kind: ClusterServiceVersion
26-
metadata:
27-
name: etcd-operator
28-
spec:
2922
...
23+
spec:
3024
relatedImages: <1>
31-
- name: default
32-
image: quay.io/coreos/etcd@sha256:12345 <2>
33-
- name: etcd-2.1.5
34-
image: quay.io/coreos/etcd@sha256:12345 <2>
35-
- name: etcd-3.1.1
36-
image: quay.io/coreos/etcd@sha256:12345 <2>
25+
- name: etcd-operator <2>
26+
value: quay.io/etcd-operator/operator@sha256:d134a9865524c29fcf75bbc4469013bc38d8a15cb5f41acfddb6b9e492f556e4 <3>
27+
- name: etcd-image
28+
value: quay.io/etcd-operator/etcd@sha256:13348c15263bd8838ec1d5fc4550ede9860fcbb0f843e48cbccec07810eebb68
29+
...
3730
----
3831
<1> Create a `relatedImages` section and set the list of related images.
32+
<2> Specify a unique identifier for the image.
33+
<3> Specify each image by a digest (SHA), not by an image tag.
34+
35+
* in the `env` section of the Operators Deployments when declaring environment
36+
variables that inject the image that the Operator should use:
37+
+
38+
[source,yaml]
39+
----
40+
spec:
41+
install:
42+
spec:
43+
deployments:
44+
- name: etcd-operator-v3.1.1
45+
spec:
46+
replicas: 1
47+
selector:
48+
matchLabels:
49+
name: etcd-operator
50+
strategy:
51+
type: Recreate
52+
template:
53+
metadata:
54+
labels:
55+
name: etcd-operator
56+
spec:
57+
containers:
58+
- args:
59+
- /opt/etcd/bin/etcd_operator_run.sh
60+
env:
61+
- name: WATCH_NAMESPACE
62+
valueFrom:
63+
fieldRef:
64+
fieldPath: metadata.annotations['olm.targetNamespaces']
65+
- name: ETCD_OPERATOR_DEFAULT_ETCD_IMAGE <1>
66+
value: quay.io/etcd-operator/etcd@sha256:13348c15263bd8838ec1d5fc4550ede9860fcbb0f843e48cbccec07810eebb68 <2>
67+
- name: ETCD_LOG_LEVEL
68+
value: INFO
69+
image: quay.io/etcd-operator/operator@sha256:d134a9865524c29fcf75bbc4469013bc38d8a15cb5f41acfddb6b9e492f556e4 <3>
70+
imagePullPolicy: IfNotPresent
71+
livenessProbe:
72+
httpGet:
73+
path: /healthy
74+
port: 8080
75+
initialDelaySeconds: 10
76+
periodSeconds: 30
77+
name: etcd-operator
78+
readinessProbe:
79+
httpGet:
80+
path: /ready
81+
port: 8080
82+
initialDelaySeconds: 10
83+
periodSeconds: 30
84+
resources: {}
85+
serviceAccountName: etcd-operator
86+
strategy: deployment
87+
----
88+
<1> Inject the images referenced by the Operator via environment variables.
3989
<2> Specify each image by a digest (SHA), not by an image tag.
90+
<3> Also reference the Operator container image by a digest (SHA), not by an image tag.

0 commit comments

Comments
 (0)