commit | author | age
|
c11a99
|
1 |
# |
WK |
2 |
# /etc/ansible/hosts file for OpenShift Container Platform 3.10.34 |
|
3 |
# |
|
4 |
|
|
5 |
[OSEv3:vars] |
|
6 |
|
|
7 |
########################################################################### |
|
8 |
### Ansible Vars |
|
9 |
########################################################################### |
|
10 |
timeout=60 |
|
11 |
ansible_user={{ansible_ssh_user}} |
|
12 |
ansible_become=yes |
|
13 |
|
|
14 |
########################################################################### |
|
15 |
### OpenShift Basic Vars |
|
16 |
########################################################################### |
|
17 |
|
|
18 |
openshift_deployment_type=openshift-enterprise |
|
19 |
|
|
20 |
openshift_disable_check="disk_availability,memory_availability,docker_image_availability" |
|
21 |
|
8ff946
|
22 |
openshift_image_tag=v{{ osrelease }} |
WK |
23 |
openshift_release={{ osrelease }} |
c11a99
|
24 |
oreg_url=registry.access.redhat.com/openshift3/ose-${component}:${version} |
WK |
25 |
openshift_examples_modify_imagestreams=true |
|
26 |
|
|
27 |
{% if container_runtime == "cri-o" %} |
|
28 |
openshift_use_crio=True |
|
29 |
openshift_crio_enable_docker_gc=True |
|
30 |
openshift_crio_docker_gc_node_selector={'runtime': 'cri-o'} |
|
31 |
{% endif %} |
|
32 |
|
|
33 |
openshift_node_groups=[{'name': 'node-config-master', 'labels': ['node-role.kubernetes.io/master=true','runtime={{container_runtime}}']}, {'name': 'node-config-infra', 'labels': ['node-role.kubernetes.io/infra=true','runtime={{container_runtime}}']}, {'name': 'node-config-glusterfs', 'labels': ['runtime={{container_runtime}}']}, {'name': 'node-config-compute', 'labels': ['node-role.kubernetes.io/compute=true','runtime={{container_runtime}}'], 'edits': [{ 'key': 'kubeletArguments.pods-per-core','value': ['20']}]}] |
|
34 |
# Configure node kubelet arguments. pods-per-core is valid in OpenShift Origin 1.3 or OpenShift Container Platform 3.3 and later. -> These need to go into the above |
|
35 |
# openshift_node_kubelet_args={'pods-per-core': ['10'], 'max-pods': ['250'], 'image-gc-high-threshold': ['85'], 'image-gc-low-threshold': ['75']} |
|
36 |
|
|
37 |
# Configure logrotate scripts |
|
38 |
# See: https://github.com/nickhammond/ansible-logrotate |
|
39 |
logrotate_scripts=[{"name": "syslog", "path": "/var/log/cron\n/var/log/maillog\n/var/log/messages\n/var/log/secure\n/var/log/spooler\n", "options": ["daily", "rotate 7","size 500M", "compress", "sharedscripts", "missingok"], "scripts": {"postrotate": "/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true"}}] |
|
40 |
|
|
41 |
{% if install_glusterfs|bool %} |
|
42 |
########################################################################### |
|
43 |
### OpenShift Container Storage |
|
44 |
########################################################################### |
|
45 |
|
|
46 |
openshift_master_dynamic_provisioning_enabled=True |
|
47 |
|
|
48 |
# CNS storage cluster |
|
49 |
# From https://github.com/red-hat-storage/openshift-cic |
|
50 |
openshift_storage_glusterfs_namespace=openshift-storage |
|
51 |
openshift_storage_glusterfs_storageclass=true |
|
52 |
openshift_storage_glusterfs_storageclass_default=true |
|
53 |
|
|
54 |
openshift_storage_glusterfs_block_deploy=true |
|
55 |
openshift_storage_glusterfs_block_host_vol_create=true |
|
56 |
openshift_storage_glusterfs_block_host_vol_size=200 |
|
57 |
openshift_storage_glusterfs_block_storageclass=true |
|
58 |
openshift_storage_glusterfs_block_storageclass_default=false |
|
59 |
|
|
60 |
# Container image to use for glusterfs pods |
|
61 |
openshift_storage_glusterfs_image="registry.access.redhat.com/rhgs3/rhgs-server-rhel7:v3.9" |
|
62 |
|
|
63 |
# Container image to use for glusterblock-provisioner pod |
|
64 |
openshift_storage_glusterfs_block_image="registry.access.redhat.com/rhgs3/rhgs-gluster-block-prov-rhel7:v3.9" |
|
65 |
|
|
66 |
# Container image to use for heketi pods |
|
67 |
openshift_storage_glusterfs_heketi_image="registry.access.redhat.com/rhgs3/rhgs-volmanager-rhel7:v3.9" |
|
68 |
{% endif %} |
|
69 |
|
|
70 |
{% if install_nfs|bool %} |
|
71 |
# Set this line to enable NFS |
|
72 |
openshift_enable_unsupported_configurations=True |
|
73 |
{% endif %} |
|
74 |
|
|
75 |
########################################################################### |
|
76 |
### OpenShift Cockpit Vars |
|
77 |
########################################################################### |
|
78 |
|
|
79 |
# Enable cockpit |
|
80 |
osm_use_cockpit=true |
|
81 |
osm_cockpit_plugins=['cockpit-kubernetes'] |
|
82 |
|
|
83 |
########################################################################### |
|
84 |
### OpenShift Master Vars |
|
85 |
########################################################################### |
|
86 |
|
|
87 |
openshift_master_api_port={{master_api_port}} |
|
88 |
openshift_master_console_port={{master_api_port}} |
|
89 |
|
|
90 |
openshift_master_cluster_method=native |
|
91 |
openshift_master_cluster_hostname={{master_lb_dns}} |
|
92 |
openshift_master_cluster_public_hostname={{master_lb_dns}} |
|
93 |
openshift_master_default_subdomain={{cloudapps_suffix}} |
|
94 |
openshift_master_overwrite_named_certificates={{openshift_master_overwrite_named_certificates}} |
|
95 |
|
|
96 |
{% if install_lets_encrypt_certificates|bool %} |
|
97 |
openshift_master_named_certificates={{lets_encrypt_openshift_master_named_certificates|to_json}} |
|
98 |
{% endif %} |
|
99 |
|
|
100 |
openshift_set_hostname=True |
|
101 |
|
|
102 |
########################################################################### |
|
103 |
### OpenShift Network Vars |
|
104 |
########################################################################### |
|
105 |
|
|
106 |
osm_cluster_network_cidr=10.1.0.0/16 |
|
107 |
openshift_portal_net=172.30.0.0/16 |
|
108 |
|
|
109 |
# os_sdn_network_plugin_name='redhat/openshift-ovs-networkpolicy' |
|
110 |
{{multi_tenant_setting}} |
|
111 |
|
|
112 |
########################################################################### |
|
113 |
### OpenShift Authentication Vars |
|
114 |
########################################################################### |
|
115 |
|
|
116 |
{% if install_idm == "ldap" or 'ldap' in install_idms|d([]) %} |
|
117 |
{{openshift_master_ldap_ca_file}} |
|
118 |
{% endif %} |
|
119 |
|
|
120 |
{% if install_idm == "htpasswd" or 'htpasswd' in install_idms|d([]) %} |
|
121 |
openshift_master_htpasswd_file=/root/htpasswd.openshift |
|
122 |
{% endif %} |
|
123 |
|
|
124 |
openshift_master_identity_providers={{identity_providers|to_json}} |
|
125 |
|
|
126 |
{% if admission_plugin_config is defined %} |
|
127 |
########################################################################### |
|
128 |
### OpenShift admission plugin config |
|
129 |
########################################################################### |
|
130 |
|
|
131 |
openshift_master_admission_plugin_config={{admission_plugin_config|to_json}} |
|
132 |
{% endif %} |
|
133 |
|
|
134 |
########################################################################### |
|
135 |
### OpenShift Metrics and Logging Vars |
|
136 |
########################################################################### |
|
137 |
|
|
138 |
######################## |
|
139 |
# Enable cluster metrics |
|
140 |
######################## |
|
141 |
openshift_metrics_install_metrics={{install_metrics}} |
|
142 |
|
|
143 |
{% if install_nfs|bool and not install_glusterfs|bool %} |
|
144 |
openshift_metrics_storage_kind=nfs |
|
145 |
openshift_metrics_storage_access_modes=['ReadWriteOnce'] |
|
146 |
openshift_metrics_storage_nfs_directory=/srv/nfs |
|
147 |
openshift_metrics_storage_nfs_options='*(rw,root_squash)' |
|
148 |
openshift_metrics_storage_volume_name=metrics |
|
149 |
openshift_metrics_storage_volume_size=10Gi |
|
150 |
openshift_metrics_storage_labels={'storage': 'metrics'} |
|
151 |
openshift_metrics_cassanda_pvc_storage_class_name='' |
|
152 |
{% endif %} |
|
153 |
|
|
154 |
{% if install_glusterfs|bool %} |
|
155 |
openshift_metrics_storage_kind=dynamic |
|
156 |
openshift_metrics_storage_volume_size=20Gi |
|
157 |
openshift_metrics_cassandra_pvc_storage_class_name='glusterfs-storage-block' |
|
158 |
{% endif %} |
|
159 |
|
|
160 |
openshift_metrics_hawkular_nodeselector={"node-role.kubernetes.io/infra": "true"} |
|
161 |
openshift_metrics_cassandra_nodeselector={"node-role.kubernetes.io/infra": "true"} |
|
162 |
openshift_metrics_heapster_nodeselector={"node-role.kubernetes.io/infra": "true"} |
|
163 |
|
|
164 |
# Store Metrics for 2 days |
|
165 |
openshift_metrics_duration=2 |
|
166 |
|
|
167 |
{% if install_prometheus|bool %} |
|
168 |
######################### |
|
169 |
# Add Prometheus Metrics: |
|
170 |
######################### |
|
171 |
openshift_hosted_prometheus_deploy=true |
|
172 |
openshift_prometheus_namespace=openshift-metrics |
|
173 |
openshift_prometheus_node_selector={"node-role.kubernetes.io/infra":"true"} |
|
174 |
|
|
175 |
# Prometheus |
|
176 |
{% if install_glusterfs|bool %} |
|
177 |
openshift_prometheus_storage_type='pvc' |
|
178 |
openshift_prometheus_storage_kind=dynamic |
|
179 |
openshift_prometheus_storage_class='glusterfs-storage-block' |
|
180 |
openshift_prometheus_storage_volume_size=20Gi |
|
181 |
openshift_prometheus_storage_access_modes=['ReadWriteOnce'] |
|
182 |
openshift_prometheus_storage_volume_name=prometheus |
|
183 |
{% elif install_nfs|bool %} |
|
184 |
openshift_prometheus_storage_type='emptydir' |
|
185 |
{% endif %} |
|
186 |
|
|
187 |
# For prometheus-alertmanager |
|
188 |
{% if install_glusterfs|bool %} |
|
189 |
openshift_prometheus_alertmanager_storage_type='pvc' |
|
190 |
openshift_prometheus_alertmanager_storage_kind=dynamic |
|
191 |
openshift_prometheus_alertmanager_storage_class='glusterfs-storage-block' |
|
192 |
openshift_prometheus_alertmanager_storage_access_modes=['ReadWriteOnce'] |
|
193 |
openshift_prometheus_alertmanager_storage_volume_size=10Gi |
|
194 |
openshift_prometheus_alertmanager_storage_volume_name=prometheus-alertmanager |
|
195 |
{% elif install_nfs|bool %} |
|
196 |
openshift_prometheus_alertmanager_storage_type='emptydir' |
|
197 |
{% endif %} |
|
198 |
|
|
199 |
# For prometheus-alertbuffer |
|
200 |
{% if install_glusterfs|bool %} |
|
201 |
openshift_prometheus_alertbuffer_storage_type='pvc' |
|
202 |
openshift_prometheus_alertbuffer_storage_kind=dynamic |
|
203 |
openshift_prometheus_alertbuffer_storage_class='glusterfs-storage-block' |
|
204 |
openshift_prometheus_alertbuffer_storage_access_modes=['ReadWriteOnce'] |
|
205 |
openshift_prometheus_alertbuffer_storage_volume_name=prometheus-alertbuffer |
|
206 |
openshift_prometheus_alertbuffer_storage_volume_size=10Gi |
|
207 |
{% elif install_nfs|bool %} |
|
208 |
openshift_prometheus_alertbuffer_storage_type='emptydir' |
|
209 |
{% endif %} |
|
210 |
|
|
211 |
# Suggested Quotas and limits for Prometheus components: |
|
212 |
openshift_prometheus_memory_requests=2Gi |
|
213 |
openshift_prometheus_cpu_requests=750m |
|
214 |
openshift_prometheus_memory_limit=2Gi |
|
215 |
openshift_prometheus_cpu_limit=750m |
|
216 |
openshift_prometheus_alertmanager_memory_requests=300Mi |
|
217 |
openshift_prometheus_alertmanager_cpu_requests=200m |
|
218 |
openshift_prometheus_alertmanager_memory_limit=300Mi |
|
219 |
openshift_prometheus_alertmanager_cpu_limit=200m |
|
220 |
openshift_prometheus_alertbuffer_memory_requests=300Mi |
|
221 |
openshift_prometheus_alertbuffer_cpu_requests=200m |
|
222 |
openshift_prometheus_alertbuffer_memory_limit=300Mi |
|
223 |
openshift_prometheus_alertbuffer_cpu_limit=200m |
|
224 |
# The following file will need to be copied over to the bastion before deployment |
|
225 |
# There is an example in ocp-workshop/files |
|
226 |
# openshift_prometheus_additional_rules_file=/root/prometheus_alerts_rules.yml |
|
227 |
|
|
228 |
# Grafana |
|
229 |
openshift_grafana_node_selector={"node-role.kubernetes.io/infra":"true"} |
|
230 |
openshift_grafana_storage_type=pvc |
|
231 |
openshift_grafana_pvc_size=2Gi |
|
232 |
openshift_grafana_node_exporter=true |
e8812c
|
233 |
openshift_grafana_prometheus_namespace="openshift-metrics" |
WK |
234 |
openshift_grafana_prometheus_serviceaccount="prometheus" |
|
235 |
openshift_grafana_prometheus_route="prometheus" |
|
236 |
|
c11a99
|
237 |
{% if install_glusterfs|bool %} |
WK |
238 |
openshift_grafana_sc_name=glusterfs-storage |
|
239 |
{% endif %} |
|
240 |
|
|
241 |
{% endif %} |
|
242 |
|
|
243 |
# Enable cluster logging |
|
244 |
######################## |
|
245 |
openshift_logging_install_logging={{install_logging}} |
|
246 |
|
|
247 |
{% if install_nfs|bool and not install_glusterfs|bool %} |
|
248 |
openshift_logging_storage_kind=nfs |
|
249 |
openshift_logging_storage_access_modes=['ReadWriteOnce'] |
|
250 |
openshift_logging_storage_nfs_directory=/srv/nfs |
|
251 |
openshift_logging_storage_nfs_options='*(rw,root_squash)' |
|
252 |
openshift_logging_storage_volume_name=logging |
|
253 |
openshift_logging_storage_volume_size=10Gi |
|
254 |
openshift_logging_storage_labels={'storage': 'logging'} |
|
255 |
openshift_logging_es_pvc_storage_class_name='' |
|
256 |
{% endif %} |
|
257 |
{% if install_glusterfs|bool %} |
|
258 |
openshift_logging_es_pvc_dynamic=true |
|
259 |
openshift_logging_es_pvc_size=20Gi |
|
260 |
openshift_logging_es_cluster_size=1 |
|
261 |
openshift_logging_es_pvc_storage_class_name='glusterfs-storage-block' |
|
262 |
{% endif %} |
|
263 |
|
|
264 |
openshift_logging_kibana_nodeselector={"node-role.kubernetes.io/infra": "true"} |
|
265 |
openshift_logging_curator_nodeselector={"node-role.kubernetes.io/infra": "true"} |
|
266 |
openshift_logging_es_nodeselector={"node-role.kubernetes.io/infra": "true"} |
|
267 |
|
|
268 |
openshift_logging_es_cluster_size=1 |
|
269 |
openshift_logging_curator_default_days=3 |
|
270 |
|
|
271 |
########################################################################### |
|
272 |
### OpenShift Router and Registry Vars |
|
273 |
########################################################################### |
|
274 |
|
|
275 |
openshift_hosted_router_replicas={{infranode_instance_count}} |
|
276 |
|
|
277 |
{% if install_lets_encrypt_certificates|bool %} |
|
278 |
openshift_hosted_router_certificate={{lets_encrypt_openshift_hosted_router_certificate|to_json}} |
|
279 |
{% endif %} |
|
280 |
|
|
281 |
openshift_hosted_registry_replicas=1 |
|
282 |
openshift_hosted_registry_pullthrough=true |
|
283 |
openshift_hosted_registry_acceptschema2=true |
|
284 |
openshift_hosted_registry_enforcequota=true |
|
285 |
|
|
286 |
{% if s3user_access_key is defined %} |
|
287 |
# Registry AWS S3 |
|
288 |
# S3 bucket must already exist. |
|
289 |
openshift_hosted_registry_storage_kind=object |
|
290 |
openshift_hosted_registry_storage_provider=s3 |
|
291 |
openshift_hosted_registry_storage_s3_accesskey={{ s3user_access_key }} |
|
292 |
openshift_hosted_registry_storage_s3_secretkey={{ s3user_secret_access_key }} |
|
293 |
openshift_hosted_registry_storage_s3_bucket={{ project_tag }} |
|
294 |
openshift_hosted_registry_storage_s3_region={{ aws_region_final|d(aws_region) }} |
|
295 |
openshift_hosted_registry_storage_s3_chunksize=26214400 |
|
296 |
openshift_hosted_registry_storage_s3_rootdirectory=/registry |
|
297 |
{% endif %} |
|
298 |
|
|
299 |
########################################################################### |
|
300 |
### OpenShift Service Catalog Vars |
|
301 |
########################################################################### |
|
302 |
|
|
303 |
openshift_enable_service_catalog=true |
|
304 |
|
|
305 |
template_service_broker_install=true |
|
306 |
# openshift_template_service_broker_namespaces=['openshift'] |
|
307 |
|
|
308 |
ansible_service_broker_install=true |
|
309 |
ansible_service_broker_local_registry_whitelist=['.*-apb$'] |
|
310 |
|
|
311 |
########################################################################### |
|
312 |
### OpenShift Hosts |
|
313 |
########################################################################### |
|
314 |
[OSEv3:children] |
|
315 |
masters |
|
316 |
etcd |
|
317 |
nodes |
|
318 |
{% if install_nfs|bool %} |
|
319 |
nfs |
|
320 |
{% endif %} |
|
321 |
{% if install_glusterfs|bool %} |
|
322 |
glusterfs |
|
323 |
{% endif %} |
|
324 |
{% if groups['newnodes']|d([])|length > 0 %} |
|
325 |
new_nodes |
|
326 |
{% endif %} |
|
327 |
|
|
328 |
[masters] |
|
329 |
{% for host in groups['masters']|sort %} |
|
330 |
{{ hostvars[host].internaldns }} |
|
331 |
{% endfor %} |
|
332 |
|
|
333 |
[etcd] |
|
334 |
{% for host in groups['masters']|sort %} |
|
335 |
{{ hostvars[host].internaldns }} |
|
336 |
{% endfor %} |
|
337 |
|
|
338 |
[nodes] |
|
339 |
## These are the masters |
|
340 |
{% for host in groups['masters']|sort %} |
|
341 |
{{ hostvars[host].internaldns }} openshift_node_group_name='node-config-master' |
|
342 |
{% endfor %} |
|
343 |
|
|
344 |
## These are infranodes |
|
345 |
{% for host in groups['infranodes']|sort %} |
|
346 |
{{ hostvars[host].internaldns }} openshift_node_group_name='node-config-infra' |
|
347 |
{% endfor %} |
|
348 |
|
|
349 |
## These are regular nodes |
|
350 |
{% for host in groups['nodes']|sort |
|
351 |
if host not in groups['newnodes']|d([]) |
|
352 |
and host not in groups['glusterfs']|d([]) |
|
353 |
%} |
|
354 |
{{ hostvars[host].internaldns }} openshift_node_group_name='node-config-compute' |
|
355 |
{% endfor %} |
|
356 |
|
|
357 |
{% if groups['glusterfs']|d([])|length > 0 %} |
|
358 |
## These are glusterfs nodes |
|
359 |
{% for host in groups['glusterfs']|sort %} |
|
360 |
{{ hostvars[host].internaldns }} openshift_node_group_name='node-config-compute' |
|
361 |
{% endfor %} |
|
362 |
{% endif %} |
|
363 |
|
|
364 |
{% if groups['newnodes']|d([])|length > 0 %} |
|
365 |
# scaleup performed, leave an empty group, see: |
|
366 |
# https://docs.openshift.com/container-platform/3.7/install_config/adding_hosts_to_existing_cluster.html |
|
367 |
[new_nodes] |
|
368 |
{% for host in groups['newnodes']|sort %} |
|
369 |
{{ hostvars[host].internaldns }} ansible_ssh_user={{remote_user}} ansible_ssh_private_key_file=~/.ssh/{{key_name}}.pem openshift_node_group_name='node-config-compute' |
|
370 |
{% endfor %} |
|
371 |
{% endif %} |
|
372 |
|
|
373 |
{% if install_nfs|bool %} |
|
374 |
[nfs] |
|
375 |
{% for host in [groups['support']|sort|first] %} |
|
376 |
{{ hostvars[host].internaldns }} |
|
377 |
{% endfor %} |
|
378 |
{% endif %} |
|
379 |
|
|
380 |
{% if install_glusterfs|bool %} |
|
381 |
{% set query = "[?name=='support']|[0].volumes[?purpose=='glusterfs'].device_name" %} |
|
382 |
[glusterfs] |
|
383 |
{% for host in groups['glusterfs']|sort %} |
|
384 |
{% if loop.index % 3 == 1 %} |
|
385 |
{% set glusterfs_zone = 1 %} |
|
386 |
{% elif loop.index % 3 == 2 %} |
|
387 |
{% set glusterfs_zone = 2 %} |
|
388 |
{% elif loop.index % 3 == 0 %} |
|
389 |
{% set glusterfs_zone = 3 %} |
|
390 |
{% endif %} |
|
391 |
{% if cloud_provider == 'ec2' %} |
|
392 |
{{ hostvars[host].internaldns }} glusterfs_zone={{ glusterfs_zone }} glusterfs_devices='{{instances|json_query(query)|to_json}}' |
|
393 |
{% elif cloud_provider == 'azure' %} |
|
394 |
{{ hostvars[host].internaldns }} glusterfs_zone={{ glusterfs_zone }} glusterfs_devices='{{ [ hostvars[host].glusterfs_device_name ] |to_json}}' |
|
395 |
{% endif %} |
|
396 |
{% endfor %} |
|
397 |
{% endif %} |