-
Notifications
You must be signed in to change notification settings - Fork 0
/
vars.yml
302 lines (278 loc) · 8.67 KB
/
vars.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
---
```
# vars file for role_openshift_disconnected_operators
publish: "/tmp/publish" # Directory where olm-icsp.yaml, mapping.txt, contentSource.yaml will be written.
registry_catalog: 'registry.example.domain.com' # Local registry where to mirror Operator images.
catalog_version: "1.0.0" # Arbitrary version number to tag your catalogue image. Unless you are interested in doing AB testing, keep the release version for all subsequent runs.
redhat_operators_image_name: 'redhat-operators' # Operator catalog image.
proxy_env:
https_proxy: 'http://proxy.example.domain.com:8080' # Set HTTP Proxy if required.
no_proxy: "{{registry_catalog}}" # Bypassing the local registry from the HTTP Proxy.
# The URL of the destination registry where the operator images will be mirrored to.
# The URL of the destination registry where the operator catalogue image will be published to.
image_url: "{{registry_catalog}}:5000/{{redhat_operators_image_name}}:{{catalog_version}}"
redhat_operators_packages_url: 'https://quay.io/cnr/api/v1/packages?namespace=redhat-operators' # Service catalog URL where we reterieve operator metadata.
quay_rh_base_url: 'https://quay.io/cnr/api/v1/packages/' # URL we're pulling the Operator package(s) from.
operator_image_list: # Example list of operators to mirror.
- "redhat-operators/jaeger-product"
- "redhat-operators/servicemeshoperator"
- "redhat-operators/cluster-logging"
- "redhat-operators/elasticsearch-operator"
- "redhat-operators/kiali-ossm"
- "redhat-operators/mesh-project"
setup_registry: # Enable the deployment of a local systemd Docker registry certificate and password protected.
deploy: false
autosync_registry: false
registry_image: 'docker.io/library/registry:2'
registry:
- podman
- httpd-tools
- jq
registry_services:
- firewalld
- local-registry
```
**playbook example**
Run playbook: `ansible-playbook -vvv pb_ocp_disconnected_operators.yaml --ask-vault-pass`
```
- hosts: helper
gather_facts: true
pre_tasks:
- include_tasks: pre_tasks.yaml
roles:
- role: role_openshift_disconnected_operators
```
= How to install operators in a disconnected environment.
The following steps walk you through mirroring and configuration of offline operators.
To streamline the deployment create or use an active account at redhat.com to be used as primary user to manage pulling images from Red Hat.
This role assumes already established trust with your local mirror. To read more about operators in restricted environments, please see the [official-documentation] (https://docs.openshift.com/container-platform/4.5/operators/olm-restricted-networks.html)
= Preparation
* With your service account, log in to retrieve the pull secrets for quay.io and registry.redhat.io [Pull-secret-page](https://cloud.redhat.com/openshift/install/pull-secret)
* Fill-out the variables file with your mirror registry URL, username, password and operators to mirror. `vars/main.yml`
* Copy the secret obtained run it through `jq` json processor and save its output to the role's `files/pull-secret.json`
* To complete the preparation, vault your `pull-secret.json`
```
ansible-vault encrypt files/pull-secret.json --ask-vault-pass
```
* Lastly, update the variables file or at execution time, pass in the registry user `reguser` & registry password `regpass` to your local mirror.
= Deployment
Running the role with the current operator_image_list as-is - will mirror all the necessary operator container images to install and deploy 1) Service Mesh 2) Logging stack (clusterlogging).
* Apply the ImageContentSourcePolicy
```
oc apply -f /tmp/publish/image_content_source.yaml
```
* Create a CatalogSource object that references your catalog image.
```
oc apply -f /tmp/publish/catalog_source.yaml
```
* Verify the operator catalog pod to be running.
```
oc get pods -n openshift-marketplace
```
* Check the CatalogSource.
```
oc get catalogsource -n openshift-marketplace
```
* Lastly, check the PackageManifest.
```
oc get packagemanifest -n openshift-marketplace
```
= Deploy Service Mesh Operator and Service Mesh Control Place from the web console.
Deploy the Service Mesh components from the web console following the [online-documentation](https://docs.openshift.com/container-platform/4.5/service_mesh/service_mesh_install/installing-ossm.html)
Templates:
* non-secure production-elasticsearch ISCSI storage backed deployment.
* mTLS FIPS production-elasticsearch ISCSI storage backed deployment.
**Non-Secure storage backed smcp**
```
apiVersion: maistra.io/v1
kind: ServiceMeshControlPlane
metadata:
name: basic-install
spec:
istio:
global:
proxy:
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 128Mi
gateways:
istio-egressgateway:
autoscaleEnabled: false
istio-ingressgateway:
autoscaleEnabled: false
ior_enabled: false
mixer:
policy:
autoscaleEnabled: false
telemetry:
autoscaleEnabled: false
resources:
requests:
cpu: 100m
memory: 1G
limits:
cpu: 500m
memory: 4G
pilot:
autoscaleEnabled: false
traceSampling: 100
kiali:
enabled: true
grafana:
enabled: true
tracing:
enabled: true
jaeger:
template: production-elasticsearch
elasticsearch:
nodeCount: 3
storage:
storageClassName: iscsi
size: "200G"
redundancyPolicy: "SingleRedundancy"
resources:
requests:
cpu: "1"
memory: "16Gi"
limits:
cpu: "1"
memory: "16Gi"
```
= FIPS work around enabled storage backed smcp
```
apiVersion: maistra.io/v1
kind: ServiceMeshControlPlane
metadata:
name: basic-install-fips
spec:
istio:
global:
controlPlaneSecurityEnabled: true
mtls:
enabled: true
tls:
cipherSuites: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
ecdhCurves: CurveP256, CurveP384
maxProtocolVersion: TLSv1_2
minProtocolVersion: TLSv1_2
proxy:
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 128Mi
gateways:
istio-egressgateway:
autoscaleEnabled: false
istio-ingressgateway:
autoscaleEnabled: false
ior_enabled: false
mixer:
policy:
autoscaleEnabled: false
telemetry:
autoscaleEnabled: false
resources:
requests:
cpu: 100m
memory: 1G
limits:
cpu: 500m
memory: 4G
pilot:
autoscaleEnabled: false
traceSampling: 100
kiali:
enabled: true
grafana:
enabled: true
tracing:
enabled: true
jaeger:
template: production-elasticsearch
elasticsearch:
nodeCount: 3
storage:
storageClassName: iscsi
size: "200G"
redundancyPolicy: "SingleRedundancy"
resources:
requests:
cpu: "1"
memory: "16Gi"
limits:
cpu: "1"
memory: "16Gi"
```
= Deploy ClusterLogging from the web console.
To deploy ClusterLogging operator following the [online-documentation](https://docs.openshift.com/container-platform/4.5/logging/cluster-logging-deploying.html#cluster-logging-deploy-console_cluster-logging-deploying)
```
apiVersion: "logging.openshift.io/v1"
kind: "ClusterLogging"
metadata:
name: "instance"
namespace: "openshift-logging"
spec:
ManagementState: "Managed"
logStore:
type: "elasticsearch"
retentionPolicy:
application:
maxage: 7d
infra:
maxage: 7d
audit:
maxage: 7d
elasticsearch:
nodeCount: 3
nodeSelector:
node-role.kubernetes.io/elasticsearch: ""
storage:
storageClassName: iscsi
size: "200G"
redundancyPolicy: "SingleRedundancy"
resources:
limits:
cpu: 1
memory: 16Gi
requests:
cpu: 1
memory: 16Gi
collection:
logs:
type: "fluentd"
fluentd:
resources:
limits:
memory: 1Gi
requests:
cpu: 200m
memory: 1Gi
visualization:
type: "kibana"
kibana:
replicas: 1
resources:
limits:
cpu:
memory:
requests:
cpu: 200m
memory: 1G
curation:
type: "curator"
curator:
schedule: "30 3 * * *"
resources:
limits:
memory: 200Mi
requests:
cpu: 200m
memory: 200Mi
```