cfme-template.yaml 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127
  1. apiVersion: v1
  2. kind: Template
  3. labels:
  4. template: cloudforms
  5. metadata:
  6. name: cloudforms
  7. annotations:
  8. description: CloudForms appliance with persistent storage
  9. tags: instant-app,cloudforms,cfme
  10. iconClass: icon-rails
  11. objects:
  12. - apiVersion: v1
  13. kind: ServiceAccount
  14. metadata:
  15. name: cfme-orchestrator
  16. - apiVersion: v1
  17. kind: ServiceAccount
  18. metadata:
  19. name: cfme-anyuid
  20. - apiVersion: v1
  21. kind: ServiceAccount
  22. metadata:
  23. name: cfme-privileged
  24. - apiVersion: v1
  25. kind: ServiceAccount
  26. metadata:
  27. name: cfme-httpd
  28. - apiVersion: v1
  29. kind: Secret
  30. metadata:
  31. name: "${NAME}-secrets"
  32. stringData:
  33. pg-password: "${DATABASE_PASSWORD}"
  34. admin-password: "${APPLICATION_ADMIN_PASSWORD}"
  35. database-url: postgresql://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_SERVICE_NAME}/${DATABASE_NAME}?encoding=utf8&pool=5&wait_timeout=5
  36. v2-key: "${V2_KEY}"
  37. - apiVersion: v1
  38. kind: Secret
  39. metadata:
  40. name: "${ANSIBLE_SERVICE_NAME}-secrets"
  41. stringData:
  42. rabbit-password: "${ANSIBLE_RABBITMQ_PASSWORD}"
  43. secret-key: "${ANSIBLE_SECRET_KEY}"
  44. admin-password: "${ANSIBLE_ADMIN_PASSWORD}"
  45. - apiVersion: v1
  46. kind: ConfigMap
  47. metadata:
  48. name: "${DATABASE_SERVICE_NAME}-configs"
  49. data:
  50. 01_miq_overrides.conf: |
  51. #------------------------------------------------------------------------------
  52. # CONNECTIONS AND AUTHENTICATION
  53. #------------------------------------------------------------------------------
  54. tcp_keepalives_count = 9
  55. tcp_keepalives_idle = 3
  56. tcp_keepalives_interval = 75
  57. #------------------------------------------------------------------------------
  58. # RESOURCE USAGE (except WAL)
  59. #------------------------------------------------------------------------------
  60. shared_preload_libraries = 'pglogical,repmgr_funcs'
  61. max_worker_processes = 10
  62. #------------------------------------------------------------------------------
  63. # WRITE AHEAD LOG
  64. #------------------------------------------------------------------------------
  65. wal_level = 'logical'
  66. wal_log_hints = on
  67. wal_buffers = 16MB
  68. checkpoint_completion_target = 0.9
  69. #------------------------------------------------------------------------------
  70. # REPLICATION
  71. #------------------------------------------------------------------------------
  72. max_wal_senders = 10
  73. wal_sender_timeout = 0
  74. max_replication_slots = 10
  75. hot_standby = on
  76. #------------------------------------------------------------------------------
  77. # ERROR REPORTING AND LOGGING
  78. #------------------------------------------------------------------------------
  79. log_filename = 'postgresql.log'
  80. log_rotation_age = 0
  81. log_min_duration_statement = 5000
  82. log_connections = on
  83. log_disconnections = on
  84. log_line_prefix = '%t:%r:%c:%u@%d:[%p]:'
  85. log_lock_waits = on
  86. #------------------------------------------------------------------------------
  87. # AUTOVACUUM PARAMETERS
  88. #------------------------------------------------------------------------------
  89. log_autovacuum_min_duration = 0
  90. autovacuum_naptime = 5min
  91. autovacuum_vacuum_threshold = 500
  92. autovacuum_analyze_threshold = 500
  93. autovacuum_vacuum_scale_factor = 0.05
  94. #------------------------------------------------------------------------------
  95. # LOCK MANAGEMENT
  96. #------------------------------------------------------------------------------
  97. deadlock_timeout = 5s
  98. #------------------------------------------------------------------------------
  99. # VERSION/PLATFORM COMPATIBILITY
  100. #------------------------------------------------------------------------------
  101. escape_string_warning = off
  102. standard_conforming_strings = off
  103. - apiVersion: v1
  104. kind: ConfigMap
  105. metadata:
  106. name: "${HTTPD_SERVICE_NAME}-configs"
  107. data:
  108. application.conf: |
  109. # Timeout: The number of seconds before receives and sends time out.
  110. Timeout 120
  111. RewriteEngine On
  112. Options SymLinksIfOwnerMatch
  113. <VirtualHost *:80>
  114. KeepAlive on
  115. # Without ServerName mod_auth_mellon compares against http:// and not https:// from the IdP
  116. ServerName https://%{REQUEST_HOST}
  117. ProxyPreserveHost on
  118. RewriteCond %{REQUEST_URI} ^/ws [NC]
  119. RewriteCond %{HTTP:UPGRADE} ^websocket$ [NC]
  120. RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
  121. RewriteRule .* ws://${NAME}%{REQUEST_URI} [P,QSA,L]
  122. # For httpd, some ErrorDocuments must by served by the httpd pod
  123. RewriteCond %{REQUEST_URI} !^/proxy_pages
  124. # For SAML /saml2 is only served by mod_auth_mellon in the httpd pod
  125. RewriteCond %{REQUEST_URI} !^/saml2
  126. RewriteRule ^/ http://${NAME}%{REQUEST_URI} [P,QSA,L]
  127. ProxyPassReverse / http://${NAME}/
  128. # Ensures httpd stdout/stderr are seen by docker logs.
  129. ErrorLog "| /usr/bin/tee /proc/1/fd/2 /var/log/httpd/error_log"
  130. CustomLog "| /usr/bin/tee /proc/1/fd/1 /var/log/httpd/access_log" common
  131. </VirtualHost>
  132. authentication.conf: |
  133. # Load appropriate authentication configuration files
  134. #
  135. Include "conf.d/configuration-${HTTPD_AUTH_TYPE}-auth"
  136. configuration-internal-auth: |
  137. # Internal authentication
  138. #
  139. configuration-external-auth: |
  140. Include "conf.d/external-auth-load-modules-conf"
  141. <Location /dashboard/kerberos_authenticate>
  142. AuthType Kerberos
  143. AuthName "Kerberos Login"
  144. KrbMethodNegotiate On
  145. KrbMethodK5Passwd Off
  146. KrbAuthRealms ${HTTPD_AUTH_KERBEROS_REALMS}
  147. Krb5KeyTab /etc/http.keytab
  148. KrbServiceName Any
  149. Require pam-account httpd-auth
  150. ErrorDocument 401 /proxy_pages/invalid_sso_credentials.js
  151. </Location>
  152. Include "conf.d/external-auth-login-form-conf"
  153. Include "conf.d/external-auth-application-api-conf"
  154. Include "conf.d/external-auth-lookup-user-details-conf"
  155. Include "conf.d/external-auth-remote-user-conf"
  156. configuration-active-directory-auth: |
  157. Include "conf.d/external-auth-load-modules-conf"
  158. <Location /dashboard/kerberos_authenticate>
  159. AuthType Kerberos
  160. AuthName "Kerberos Login"
  161. KrbMethodNegotiate On
  162. KrbMethodK5Passwd Off
  163. KrbAuthRealms ${HTTPD_AUTH_KERBEROS_REALMS}
  164. Krb5KeyTab /etc/krb5.keytab
  165. KrbServiceName Any
  166. Require pam-account httpd-auth
  167. ErrorDocument 401 /proxy_pages/invalid_sso_credentials.js
  168. </Location>
  169. Include "conf.d/external-auth-login-form-conf"
  170. Include "conf.d/external-auth-application-api-conf"
  171. Include "conf.d/external-auth-lookup-user-details-conf"
  172. Include "conf.d/external-auth-remote-user-conf"
  173. configuration-saml-auth: |
  174. LoadModule auth_mellon_module modules/mod_auth_mellon.so
  175. <Location />
  176. MellonEnable "info"
  177. MellonIdPMetadataFile "/etc/httpd/saml2/idp-metadata.xml"
  178. MellonSPPrivateKeyFile "/etc/httpd/saml2/sp-key.key"
  179. MellonSPCertFile "/etc/httpd/saml2/sp-cert.cert"
  180. MellonSPMetadataFile "/etc/httpd/saml2/sp-metadata.xml"
  181. MellonVariable "sp-cookie"
  182. MellonSecureCookie On
  183. MellonCookiePath "/"
  184. MellonIdP "IDP"
  185. MellonEndpointPath "/saml2"
  186. MellonUser username
  187. MellonMergeEnvVars On
  188. MellonSetEnvNoPrefix "REMOTE_USER" username
  189. MellonSetEnvNoPrefix "REMOTE_USER_EMAIL" email
  190. MellonSetEnvNoPrefix "REMOTE_USER_FIRSTNAME" firstname
  191. MellonSetEnvNoPrefix "REMOTE_USER_LASTNAME" lastname
  192. MellonSetEnvNoPrefix "REMOTE_USER_FULLNAME" fullname
  193. MellonSetEnvNoPrefix "REMOTE_USER_GROUPS" groups
  194. </Location>
  195. <Location /saml_login>
  196. AuthType "Mellon"
  197. MellonEnable "auth"
  198. Require valid-user
  199. </Location>
  200. Include "conf.d/external-auth-remote-user-conf"
  201. external-auth-load-modules-conf: |
  202. LoadModule authnz_pam_module modules/mod_authnz_pam.so
  203. LoadModule intercept_form_submit_module modules/mod_intercept_form_submit.so
  204. LoadModule lookup_identity_module modules/mod_lookup_identity.so
  205. LoadModule auth_kerb_module modules/mod_auth_kerb.so
  206. external-auth-login-form-conf: |
  207. <Location /dashboard/external_authenticate>
  208. InterceptFormPAMService httpd-auth
  209. InterceptFormLogin user_name
  210. InterceptFormPassword user_password
  211. InterceptFormLoginSkip admin
  212. InterceptFormClearRemoteUserForSkipped on
  213. </Location>
  214. external-auth-application-api-conf: |
  215. <LocationMatch ^/api>
  216. SetEnvIf Authorization '^Basic +YWRtaW46' let_admin_in
  217. SetEnvIf X-Auth-Token '^.+$' let_api_token_in
  218. SetEnvIf X-MIQ-Token '^.+$' let_sys_token_in
  219. AuthType Basic
  220. AuthName "External Authentication (httpd) for API"
  221. AuthBasicProvider PAM
  222. AuthPAMService httpd-auth
  223. Require valid-user
  224. Order Allow,Deny
  225. Allow from env=let_admin_in
  226. Allow from env=let_api_token_in
  227. Allow from env=let_sys_token_in
  228. Satisfy Any
  229. </LocationMatch>
  230. external-auth-lookup-user-details-conf: |
  231. <LocationMatch ^/dashboard/external_authenticate$|^/dashboard/kerberos_authenticate$|^/api>
  232. LookupUserAttr mail REMOTE_USER_EMAIL
  233. LookupUserAttr givenname REMOTE_USER_FIRSTNAME
  234. LookupUserAttr sn REMOTE_USER_LASTNAME
  235. LookupUserAttr displayname REMOTE_USER_FULLNAME
  236. LookupUserAttr domainname REMOTE_USER_DOMAIN
  237. LookupUserGroups REMOTE_USER_GROUPS ":"
  238. LookupDbusTimeout 5000
  239. </LocationMatch>
  240. external-auth-remote-user-conf: |
  241. RequestHeader unset X_REMOTE_USER
  242. RequestHeader set X_REMOTE_USER %{REMOTE_USER}e env=REMOTE_USER
  243. RequestHeader set X_EXTERNAL_AUTH_ERROR %{EXTERNAL_AUTH_ERROR}e env=EXTERNAL_AUTH_ERROR
  244. RequestHeader set X_REMOTE_USER_EMAIL %{REMOTE_USER_EMAIL}e env=REMOTE_USER_EMAIL
  245. RequestHeader set X_REMOTE_USER_FIRSTNAME %{REMOTE_USER_FIRSTNAME}e env=REMOTE_USER_FIRSTNAME
  246. RequestHeader set X_REMOTE_USER_LASTNAME %{REMOTE_USER_LASTNAME}e env=REMOTE_USER_LASTNAME
  247. RequestHeader set X_REMOTE_USER_FULLNAME %{REMOTE_USER_FULLNAME}e env=REMOTE_USER_FULLNAME
  248. RequestHeader set X_REMOTE_USER_GROUPS %{REMOTE_USER_GROUPS}e env=REMOTE_USER_GROUPS
  249. RequestHeader set X_REMOTE_USER_DOMAIN %{REMOTE_USER_DOMAIN}e env=REMOTE_USER_DOMAIN
  250. - apiVersion: v1
  251. kind: ConfigMap
  252. metadata:
  253. name: "${HTTPD_SERVICE_NAME}-auth-configs"
  254. data:
  255. auth-type: internal
  256. auth-kerberos-realms: undefined
  257. auth-configuration.conf: |
  258. # External Authentication Configuration File
  259. #
  260. # For details on usage please see https://github.com/ManageIQ/manageiq-pods/blob/master/README.md#configuring-external-authentication
  261. - apiVersion: v1
  262. kind: Service
  263. metadata:
  264. annotations:
  265. description: Exposes and load balances CloudForms pods
  266. service.alpha.openshift.io/dependencies: '[{"name":"${DATABASE_SERVICE_NAME}","namespace":"","kind":"Service"},{"name":"${MEMCACHED_SERVICE_NAME}","namespace":"","kind":"Service"}]'
  267. name: "${NAME}"
  268. spec:
  269. clusterIP: None
  270. ports:
  271. - name: http
  272. port: 80
  273. protocol: TCP
  274. targetPort: 80
  275. selector:
  276. name: "${NAME}"
  277. - apiVersion: v1
  278. kind: Route
  279. metadata:
  280. name: "${HTTPD_SERVICE_NAME}"
  281. spec:
  282. host: "${APPLICATION_DOMAIN}"
  283. port:
  284. targetPort: http
  285. tls:
  286. termination: edge
  287. insecureEdgeTerminationPolicy: Redirect
  288. to:
  289. kind: Service
  290. name: "${HTTPD_SERVICE_NAME}"
  291. - apiVersion: v1
  292. kind: PersistentVolumeClaim
  293. metadata:
  294. name: "${NAME}-${DATABASE_SERVICE_NAME}"
  295. spec:
  296. accessModes:
  297. - ReadWriteOnce
  298. resources:
  299. requests:
  300. storage: "${DATABASE_VOLUME_CAPACITY}"
  301. - apiVersion: apps/v1beta1
  302. kind: StatefulSet
  303. metadata:
  304. name: "${NAME}"
  305. annotations:
  306. description: Defines how to deploy the CloudForms appliance
  307. spec:
  308. serviceName: "${NAME}"
  309. replicas: "${APPLICATION_REPLICA_COUNT}"
  310. template:
  311. metadata:
  312. labels:
  313. name: "${NAME}"
  314. name: "${NAME}"
  315. spec:
  316. containers:
  317. - name: cloudforms
  318. image: "${FRONTEND_APPLICATION_IMG_NAME}:${FRONTEND_APPLICATION_IMG_TAG}"
  319. livenessProbe:
  320. exec:
  321. command:
  322. - pidof
  323. - MIQ Server
  324. initialDelaySeconds: 480
  325. timeoutSeconds: 3
  326. readinessProbe:
  327. tcpSocket:
  328. port: 80
  329. initialDelaySeconds: 200
  330. timeoutSeconds: 3
  331. ports:
  332. - containerPort: 80
  333. protocol: TCP
  334. volumeMounts:
  335. - name: "${NAME}-server"
  336. mountPath: "/persistent"
  337. env:
  338. - name: MY_POD_NAMESPACE
  339. valueFrom:
  340. fieldRef:
  341. fieldPath: metadata.namespace
  342. - name: APPLICATION_INIT_DELAY
  343. value: "${APPLICATION_INIT_DELAY}"
  344. - name: DATABASE_REGION
  345. value: "${DATABASE_REGION}"
  346. - name: DATABASE_URL
  347. valueFrom:
  348. secretKeyRef:
  349. name: "${NAME}-secrets"
  350. key: database-url
  351. - name: V2_KEY
  352. valueFrom:
  353. secretKeyRef:
  354. name: "${NAME}-secrets"
  355. key: v2-key
  356. - name: APPLICATION_ADMIN_PASSWORD
  357. valueFrom:
  358. secretKeyRef:
  359. name: "${NAME}-secrets"
  360. key: admin-password
  361. - name: ANSIBLE_ADMIN_PASSWORD
  362. valueFrom:
  363. secretKeyRef:
  364. name: "${ANSIBLE_SERVICE_NAME}-secrets"
  365. key: admin-password
  366. resources:
  367. requests:
  368. memory: "${APPLICATION_MEM_REQ}"
  369. cpu: "${APPLICATION_CPU_REQ}"
  370. limits:
  371. memory: "${APPLICATION_MEM_LIMIT}"
  372. lifecycle:
  373. preStop:
  374. exec:
  375. command:
  376. - "/opt/rh/cfme-container-scripts/sync-pv-data"
  377. serviceAccount: cfme-orchestrator
  378. serviceAccountName: cfme-orchestrator
  379. terminationGracePeriodSeconds: 90
  380. volumeClaimTemplates:
  381. - metadata:
  382. name: "${NAME}-server"
  383. annotations:
  384. spec:
  385. accessModes:
  386. - ReadWriteOnce
  387. resources:
  388. requests:
  389. storage: "${APPLICATION_VOLUME_CAPACITY}"
  390. - apiVersion: v1
  391. kind: Service
  392. metadata:
  393. annotations:
  394. description: Headless service for CloudForms backend pods
  395. name: "${NAME}-backend"
  396. spec:
  397. clusterIP: None
  398. selector:
  399. name: "${NAME}-backend"
  400. - apiVersion: apps/v1beta1
  401. kind: StatefulSet
  402. metadata:
  403. name: "${NAME}-backend"
  404. annotations:
  405. description: Defines how to deploy the CloudForms appliance
  406. spec:
  407. serviceName: "${NAME}-backend"
  408. replicas: 0
  409. template:
  410. metadata:
  411. labels:
  412. name: "${NAME}-backend"
  413. name: "${NAME}-backend"
  414. spec:
  415. containers:
  416. - name: cloudforms
  417. image: "${BACKEND_APPLICATION_IMG_NAME}:${BACKEND_APPLICATION_IMG_TAG}"
  418. livenessProbe:
  419. exec:
  420. command:
  421. - pidof
  422. - MIQ Server
  423. initialDelaySeconds: 480
  424. timeoutSeconds: 3
  425. volumeMounts:
  426. - name: "${NAME}-server"
  427. mountPath: "/persistent"
  428. env:
  429. - name: APPLICATION_INIT_DELAY
  430. value: "${APPLICATION_INIT_DELAY}"
  431. - name: DATABASE_URL
  432. valueFrom:
  433. secretKeyRef:
  434. name: "${NAME}-secrets"
  435. key: database-url
  436. - name: MIQ_SERVER_DEFAULT_ROLES
  437. value: database_operations,event,reporting,scheduler,smartstate,ems_operations,ems_inventory,automate
  438. - name: FRONTEND_SERVICE_NAME
  439. value: "${NAME}"
  440. - name: V2_KEY
  441. valueFrom:
  442. secretKeyRef:
  443. name: "${NAME}-secrets"
  444. key: v2-key
  445. - name: ANSIBLE_ADMIN_PASSWORD
  446. valueFrom:
  447. secretKeyRef:
  448. name: "${ANSIBLE_SERVICE_NAME}-secrets"
  449. key: admin-password
  450. resources:
  451. requests:
  452. memory: "${APPLICATION_MEM_REQ}"
  453. cpu: "${APPLICATION_CPU_REQ}"
  454. limits:
  455. memory: "${APPLICATION_MEM_LIMIT}"
  456. lifecycle:
  457. preStop:
  458. exec:
  459. command:
  460. - "/opt/rh/cfme-container-scripts/sync-pv-data"
  461. serviceAccount: cfme-orchestrator
  462. serviceAccountName: cfme-orchestrator
  463. terminationGracePeriodSeconds: 90
  464. volumeClaimTemplates:
  465. - metadata:
  466. name: "${NAME}-server"
  467. annotations:
  468. spec:
  469. accessModes:
  470. - ReadWriteOnce
  471. resources:
  472. requests:
  473. storage: "${APPLICATION_VOLUME_CAPACITY}"
  474. - apiVersion: v1
  475. kind: Service
  476. metadata:
  477. name: "${MEMCACHED_SERVICE_NAME}"
  478. annotations:
  479. description: Exposes the memcached server
  480. spec:
  481. ports:
  482. - name: memcached
  483. port: 11211
  484. targetPort: 11211
  485. selector:
  486. name: "${MEMCACHED_SERVICE_NAME}"
  487. - apiVersion: v1
  488. kind: DeploymentConfig
  489. metadata:
  490. name: "${MEMCACHED_SERVICE_NAME}"
  491. annotations:
  492. description: Defines how to deploy memcached
  493. spec:
  494. strategy:
  495. type: Recreate
  496. triggers:
  497. - type: ConfigChange
  498. replicas: 1
  499. selector:
  500. name: "${MEMCACHED_SERVICE_NAME}"
  501. template:
  502. metadata:
  503. name: "${MEMCACHED_SERVICE_NAME}"
  504. labels:
  505. name: "${MEMCACHED_SERVICE_NAME}"
  506. spec:
  507. volumes: []
  508. containers:
  509. - name: memcached
  510. image: "${MEMCACHED_IMG_NAME}:${MEMCACHED_IMG_TAG}"
  511. ports:
  512. - containerPort: 11211
  513. readinessProbe:
  514. timeoutSeconds: 1
  515. initialDelaySeconds: 5
  516. tcpSocket:
  517. port: 11211
  518. livenessProbe:
  519. timeoutSeconds: 1
  520. initialDelaySeconds: 30
  521. tcpSocket:
  522. port: 11211
  523. volumeMounts: []
  524. env:
  525. - name: MEMCACHED_MAX_MEMORY
  526. value: "${MEMCACHED_MAX_MEMORY}"
  527. - name: MEMCACHED_MAX_CONNECTIONS
  528. value: "${MEMCACHED_MAX_CONNECTIONS}"
  529. - name: MEMCACHED_SLAB_PAGE_SIZE
  530. value: "${MEMCACHED_SLAB_PAGE_SIZE}"
  531. resources:
  532. requests:
  533. memory: "${MEMCACHED_MEM_REQ}"
  534. cpu: "${MEMCACHED_CPU_REQ}"
  535. limits:
  536. memory: "${MEMCACHED_MEM_LIMIT}"
  537. - apiVersion: v1
  538. kind: Service
  539. metadata:
  540. name: "${DATABASE_SERVICE_NAME}"
  541. annotations:
  542. description: Exposes the database server
  543. spec:
  544. ports:
  545. - name: postgresql
  546. port: 5432
  547. targetPort: 5432
  548. selector:
  549. name: "${DATABASE_SERVICE_NAME}"
  550. - apiVersion: v1
  551. kind: DeploymentConfig
  552. metadata:
  553. name: "${DATABASE_SERVICE_NAME}"
  554. annotations:
  555. description: Defines how to deploy the database
  556. spec:
  557. strategy:
  558. type: Recreate
  559. triggers:
  560. - type: ConfigChange
  561. replicas: 1
  562. selector:
  563. name: "${DATABASE_SERVICE_NAME}"
  564. template:
  565. metadata:
  566. name: "${DATABASE_SERVICE_NAME}"
  567. labels:
  568. name: "${DATABASE_SERVICE_NAME}"
  569. spec:
  570. volumes:
  571. - name: cfme-pgdb-volume
  572. persistentVolumeClaim:
  573. claimName: "${NAME}-${DATABASE_SERVICE_NAME}"
  574. - name: cfme-pg-configs
  575. configMap:
  576. name: "${DATABASE_SERVICE_NAME}-configs"
  577. containers:
  578. - name: postgresql
  579. image: "${POSTGRESQL_IMG_NAME}:${POSTGRESQL_IMG_TAG}"
  580. ports:
  581. - containerPort: 5432
  582. readinessProbe:
  583. timeoutSeconds: 1
  584. initialDelaySeconds: 15
  585. exec:
  586. command:
  587. - "/bin/sh"
  588. - "-i"
  589. - "-c"
  590. - psql -h 127.0.0.1 -U ${POSTGRESQL_USER} -q -d ${POSTGRESQL_DATABASE} -c 'SELECT 1'
  591. livenessProbe:
  592. timeoutSeconds: 1
  593. initialDelaySeconds: 60
  594. tcpSocket:
  595. port: 5432
  596. volumeMounts:
  597. - name: cfme-pgdb-volume
  598. mountPath: "/var/lib/pgsql/data"
  599. - name: cfme-pg-configs
  600. mountPath: "/opt/app-root/src/postgresql-config/"
  601. env:
  602. - name: POSTGRESQL_USER
  603. value: "${DATABASE_USER}"
  604. - name: POSTGRESQL_PASSWORD
  605. valueFrom:
  606. secretKeyRef:
  607. name: "${NAME}-secrets"
  608. key: pg-password
  609. - name: POSTGRESQL_DATABASE
  610. value: "${DATABASE_NAME}"
  611. - name: POSTGRESQL_MAX_CONNECTIONS
  612. value: "${POSTGRESQL_MAX_CONNECTIONS}"
  613. - name: POSTGRESQL_SHARED_BUFFERS
  614. value: "${POSTGRESQL_SHARED_BUFFERS}"
  615. resources:
  616. requests:
  617. memory: "${POSTGRESQL_MEM_REQ}"
  618. cpu: "${POSTGRESQL_CPU_REQ}"
  619. limits:
  620. memory: "${POSTGRESQL_MEM_LIMIT}"
  621. - apiVersion: v1
  622. kind: Service
  623. metadata:
  624. annotations:
  625. description: Exposes and load balances Ansible pods
  626. service.alpha.openshift.io/dependencies: '[{"name":"${DATABASE_SERVICE_NAME}","namespace":"","kind":"Service"}]'
  627. name: "${ANSIBLE_SERVICE_NAME}"
  628. spec:
  629. ports:
  630. - name: http
  631. port: 80
  632. protocol: TCP
  633. targetPort: 80
  634. - name: https
  635. port: 443
  636. protocol: TCP
  637. targetPort: 443
  638. selector:
  639. name: "${ANSIBLE_SERVICE_NAME}"
  640. - apiVersion: v1
  641. kind: DeploymentConfig
  642. metadata:
  643. name: "${ANSIBLE_SERVICE_NAME}"
  644. annotations:
  645. description: Defines how to deploy the Ansible appliance
  646. spec:
  647. strategy:
  648. type: Recreate
  649. serviceName: "${ANSIBLE_SERVICE_NAME}"
  650. replicas: 0
  651. template:
  652. metadata:
  653. labels:
  654. name: "${ANSIBLE_SERVICE_NAME}"
  655. name: "${ANSIBLE_SERVICE_NAME}"
  656. spec:
  657. containers:
  658. - name: ansible
  659. image: "${ANSIBLE_IMG_NAME}:${ANSIBLE_IMG_TAG}"
  660. livenessProbe:
  661. tcpSocket:
  662. port: 443
  663. initialDelaySeconds: 480
  664. timeoutSeconds: 3
  665. readinessProbe:
  666. httpGet:
  667. path: "/"
  668. port: 443
  669. scheme: HTTPS
  670. initialDelaySeconds: 200
  671. timeoutSeconds: 3
  672. ports:
  673. - containerPort: 80
  674. protocol: TCP
  675. - containerPort: 443
  676. protocol: TCP
  677. securityContext:
  678. privileged: true
  679. env:
  680. - name: ADMIN_PASSWORD
  681. valueFrom:
  682. secretKeyRef:
  683. name: "${ANSIBLE_SERVICE_NAME}-secrets"
  684. key: admin-password
  685. - name: RABBITMQ_USER_NAME
  686. value: "${ANSIBLE_RABBITMQ_USER_NAME}"
  687. - name: RABBITMQ_PASSWORD
  688. valueFrom:
  689. secretKeyRef:
  690. name: "${ANSIBLE_SERVICE_NAME}-secrets"
  691. key: rabbit-password
  692. - name: ANSIBLE_SECRET_KEY
  693. valueFrom:
  694. secretKeyRef:
  695. name: "${ANSIBLE_SERVICE_NAME}-secrets"
  696. key: secret-key
  697. - name: DATABASE_SERVICE_NAME
  698. value: "${DATABASE_SERVICE_NAME}"
  699. - name: POSTGRESQL_USER
  700. value: "${DATABASE_USER}"
  701. - name: POSTGRESQL_PASSWORD
  702. valueFrom:
  703. secretKeyRef:
  704. name: "${NAME}-secrets"
  705. key: pg-password
  706. - name: POSTGRESQL_DATABASE
  707. value: "${ANSIBLE_DATABASE_NAME}"
  708. resources:
  709. requests:
  710. memory: "${ANSIBLE_MEM_REQ}"
  711. cpu: "${ANSIBLE_CPU_REQ}"
  712. limits:
  713. memory: "${ANSIBLE_MEM_LIMIT}"
  714. serviceAccount: cfme-privileged
  715. serviceAccountName: cfme-privileged
  716. - apiVersion: v1
  717. kind: Service
  718. metadata:
  719. name: "${HTTPD_SERVICE_NAME}"
  720. annotations:
  721. description: Exposes the httpd server
  722. service.alpha.openshift.io/dependencies: '[{"name":"${NAME}","namespace":"","kind":"Service"}]'
  723. spec:
  724. ports:
  725. - name: http
  726. port: 80
  727. targetPort: 80
  728. selector:
  729. name: httpd
  730. - apiVersion: v1
  731. kind: Service
  732. metadata:
  733. name: "${HTTPD_DBUS_API_SERVICE_NAME}"
  734. annotations:
  735. description: Exposes the httpd server dbus api
  736. service.alpha.openshift.io/dependencies: '[{"name":"${NAME}","namespace":"","kind":"Service"}]'
  737. spec:
  738. ports:
  739. - name: http-dbus-api
  740. port: 8080
  741. targetPort: 8080
  742. selector:
  743. name: httpd
  744. - apiVersion: v1
  745. kind: DeploymentConfig
  746. metadata:
  747. name: "${HTTPD_SERVICE_NAME}"
  748. annotations:
  749. description: Defines how to deploy httpd
  750. spec:
  751. strategy:
  752. type: Recreate
  753. recreateParams:
  754. timeoutSeconds: 1200
  755. triggers:
  756. - type: ConfigChange
  757. replicas: 1
  758. selector:
  759. name: "${HTTPD_SERVICE_NAME}"
  760. template:
  761. metadata:
  762. name: "${HTTPD_SERVICE_NAME}"
  763. labels:
  764. name: "${HTTPD_SERVICE_NAME}"
  765. spec:
  766. volumes:
  767. - name: httpd-config
  768. configMap:
  769. name: "${HTTPD_SERVICE_NAME}-configs"
  770. - name: httpd-auth-config
  771. configMap:
  772. name: "${HTTPD_SERVICE_NAME}-auth-configs"
  773. containers:
  774. - name: httpd
  775. image: "${HTTPD_IMG_NAME}:${HTTPD_IMG_TAG}"
  776. ports:
  777. - containerPort: 80
  778. protocol: TCP
  779. - containerPort: 8080
  780. protocol: TCP
  781. livenessProbe:
  782. exec:
  783. command:
  784. - pidof
  785. - httpd
  786. initialDelaySeconds: 15
  787. timeoutSeconds: 3
  788. readinessProbe:
  789. tcpSocket:
  790. port: 80
  791. initialDelaySeconds: 10
  792. timeoutSeconds: 3
  793. volumeMounts:
  794. - name: httpd-config
  795. mountPath: "${HTTPD_CONFIG_DIR}"
  796. - name: httpd-auth-config
  797. mountPath: "${HTTPD_AUTH_CONFIG_DIR}"
  798. resources:
  799. requests:
  800. memory: "${HTTPD_MEM_REQ}"
  801. cpu: "${HTTPD_CPU_REQ}"
  802. limits:
  803. memory: "${HTTPD_MEM_LIMIT}"
  804. env:
  805. - name: HTTPD_AUTH_TYPE
  806. valueFrom:
  807. configMapKeyRef:
  808. name: "${HTTPD_SERVICE_NAME}-auth-configs"
  809. key: auth-type
  810. - name: HTTPD_AUTH_KERBEROS_REALMS
  811. valueFrom:
  812. configMapKeyRef:
  813. name: "${HTTPD_SERVICE_NAME}-auth-configs"
  814. key: auth-kerberos-realms
  815. lifecycle:
  816. postStart:
  817. exec:
  818. command:
  819. - "/usr/bin/save-container-environment"
  820. serviceAccount: cfme-httpd
  821. serviceAccountName: cfme-httpd
  822. parameters:
  823. - name: NAME
  824. displayName: Name
  825. required: true
  826. description: The name assigned to all of the frontend objects defined in this template.
  827. value: cloudforms
  828. - name: V2_KEY
  829. displayName: CloudForms Encryption Key
  830. required: true
  831. description: Encryption Key for CloudForms Passwords
  832. from: "[a-zA-Z0-9]{43}"
  833. generate: expression
  834. - name: DATABASE_SERVICE_NAME
  835. displayName: PostgreSQL Service Name
  836. required: true
  837. description: The name of the OpenShift Service exposed for the PostgreSQL container.
  838. value: postgresql
  839. - name: DATABASE_USER
  840. displayName: PostgreSQL User
  841. required: true
  842. description: PostgreSQL user that will access the database.
  843. value: root
  844. - name: DATABASE_PASSWORD
  845. displayName: PostgreSQL Password
  846. required: true
  847. description: Password for the PostgreSQL user.
  848. from: "[a-zA-Z0-9]{8}"
  849. generate: expression
  850. - name: DATABASE_NAME
  851. required: true
  852. displayName: PostgreSQL Database Name
  853. description: Name of the PostgreSQL database accessed.
  854. value: vmdb_production
  855. - name: DATABASE_REGION
  856. required: true
  857. displayName: Application Database Region
  858. description: Database region that will be used for application.
  859. value: '0'
  860. - name: APPLICATION_ADMIN_PASSWORD
  861. displayName: Application Admin Password
  862. required: true
  863. description: Admin password that will be set on the application.
  864. value: smartvm
  865. - name: ANSIBLE_DATABASE_NAME
  866. displayName: Ansible PostgreSQL database name
  867. required: true
  868. description: The database to be used by the Ansible continer
  869. value: awx
  870. - name: MEMCACHED_SERVICE_NAME
  871. required: true
  872. displayName: Memcached Service Name
  873. description: The name of the OpenShift Service exposed for the Memcached container.
  874. value: memcached
  875. - name: MEMCACHED_MAX_MEMORY
  876. displayName: Memcached Max Memory
  877. description: Memcached maximum memory for memcached object storage in MB.
  878. value: '64'
  879. - name: MEMCACHED_MAX_CONNECTIONS
  880. displayName: Memcached Max Connections
  881. description: Memcached maximum number of connections allowed.
  882. value: '1024'
  883. - name: MEMCACHED_SLAB_PAGE_SIZE
  884. displayName: Memcached Slab Page Size
  885. description: Memcached size of each slab page.
  886. value: 1m
  887. - name: POSTGRESQL_MAX_CONNECTIONS
  888. displayName: PostgreSQL Max Connections
  889. description: PostgreSQL maximum number of database connections allowed.
  890. value: '1000'
  891. - name: POSTGRESQL_SHARED_BUFFERS
  892. displayName: PostgreSQL Shared Buffer Amount
  893. description: Amount of memory dedicated for PostgreSQL shared memory buffers.
  894. value: 1GB
  895. - name: ANSIBLE_SERVICE_NAME
  896. displayName: Ansible Service Name
  897. description: The name of the OpenShift Service exposed for the Ansible container.
  898. value: ansible
  899. - name: ANSIBLE_ADMIN_PASSWORD
  900. displayName: Ansible admin User password
  901. required: true
  902. description: The password for the Ansible container admin user
  903. from: "[a-zA-Z0-9]{32}"
  904. generate: expression
  905. - name: ANSIBLE_SECRET_KEY
  906. displayName: Ansible Secret Key
  907. required: true
  908. description: Encryption key for the Ansible container
  909. from: "[a-f0-9]{32}"
  910. generate: expression
  911. - name: ANSIBLE_RABBITMQ_USER_NAME
  912. displayName: RabbitMQ Username
  913. required: true
  914. description: Username for the Ansible RabbitMQ Server
  915. value: ansible
  916. - name: ANSIBLE_RABBITMQ_PASSWORD
  917. displayName: RabbitMQ Server Password
  918. required: true
  919. description: Password for the Ansible RabbitMQ Server
  920. from: "[a-zA-Z0-9]{32}"
  921. generate: expression
  922. - name: APPLICATION_CPU_REQ
  923. displayName: Application Min CPU Requested
  924. required: true
  925. description: Minimum amount of CPU time the Application container will need (expressed in millicores).
  926. value: 1000m
  927. - name: POSTGRESQL_CPU_REQ
  928. displayName: PostgreSQL Min CPU Requested
  929. required: true
  930. description: Minimum amount of CPU time the PostgreSQL container will need (expressed in millicores).
  931. value: 500m
  932. - name: MEMCACHED_CPU_REQ
  933. displayName: Memcached Min CPU Requested
  934. required: true
  935. description: Minimum amount of CPU time the Memcached container will need (expressed in millicores).
  936. value: 200m
  937. - name: ANSIBLE_CPU_REQ
  938. displayName: Ansible Min CPU Requested
  939. required: true
  940. description: Minimum amount of CPU time the Ansible container will need (expressed in millicores).
  941. value: 1000m
  942. - name: APPLICATION_MEM_REQ
  943. displayName: Application Min RAM Requested
  944. required: true
  945. description: Minimum amount of memory the Application container will need.
  946. value: 6144Mi
  947. - name: POSTGRESQL_MEM_REQ
  948. displayName: PostgreSQL Min RAM Requested
  949. required: true
  950. description: Minimum amount of memory the PostgreSQL container will need.
  951. value: 4Gi
  952. - name: MEMCACHED_MEM_REQ
  953. displayName: Memcached Min RAM Requested
  954. required: true
  955. description: Minimum amount of memory the Memcached container will need.
  956. value: 64Mi
  957. - name: ANSIBLE_MEM_REQ
  958. displayName: Ansible Min RAM Requested
  959. required: true
  960. description: Minimum amount of memory the Ansible container will need.
  961. value: 2048Mi
  962. - name: APPLICATION_MEM_LIMIT
  963. displayName: Application Max RAM Limit
  964. required: true
  965. description: Maximum amount of memory the Application container can consume.
  966. value: 16384Mi
  967. - name: POSTGRESQL_MEM_LIMIT
  968. displayName: PostgreSQL Max RAM Limit
  969. required: true
  970. description: Maximum amount of memory the PostgreSQL container can consume.
  971. value: 8Gi
  972. - name: MEMCACHED_MEM_LIMIT
  973. displayName: Memcached Max RAM Limit
  974. required: true
  975. description: Maximum amount of memory the Memcached container can consume.
  976. value: 256Mi
  977. - name: ANSIBLE_MEM_LIMIT
  978. displayName: Ansible Max RAM Limit
  979. required: true
  980. description: Maximum amount of memory the Ansible container can consume.
  981. value: 8096Mi
  982. - name: POSTGRESQL_IMG_NAME
  983. displayName: PostgreSQL Image Name
  984. description: This is the PostgreSQL image name requested to deploy.
  985. value: registry.access.redhat.com/cloudforms46/cfme-openshift-postgresql
  986. - name: POSTGRESQL_IMG_TAG
  987. displayName: PostgreSQL Image Tag
  988. description: This is the PostgreSQL image tag/version requested to deploy.
  989. value: latest
  990. - name: MEMCACHED_IMG_NAME
  991. displayName: Memcached Image Name
  992. description: This is the Memcached image name requested to deploy.
  993. value: registry.access.redhat.com/cloudforms46/cfme-openshift-memcached
  994. - name: MEMCACHED_IMG_TAG
  995. displayName: Memcached Image Tag
  996. description: This is the Memcached image tag/version requested to deploy.
  997. value: latest
  998. - name: FRONTEND_APPLICATION_IMG_NAME
  999. displayName: Frontend Application Image Name
  1000. description: This is the Frontend Application image name requested to deploy.
  1001. value: registry.access.redhat.com/cloudforms46/cfme-openshift-app-ui
  1002. - name: BACKEND_APPLICATION_IMG_NAME
  1003. displayName: Backend Application Image Name
  1004. description: This is the Backend Application image name requested to deploy.
  1005. value: registry.access.redhat.com/cloudforms46/cfme-openshift-app
  1006. - name: FRONTEND_APPLICATION_IMG_TAG
  1007. displayName: Front end Application Image Tag
  1008. description: This is the CloudForms Frontend Application image tag/version requested to deploy.
  1009. value: latest
  1010. - name: BACKEND_APPLICATION_IMG_TAG
  1011. displayName: Back end Application Image Tag
  1012. description: This is the CloudForms Backend Application image tag/version requested to deploy.
  1013. value: latest
  1014. - name: ANSIBLE_IMG_NAME
  1015. displayName: Ansible Image Name
  1016. description: This is the Ansible image name requested to deploy.
  1017. value: registry.access.redhat.com/cloudforms46/cfme-openshift-embedded-ansible
  1018. - name: ANSIBLE_IMG_TAG
  1019. displayName: Ansible Image Tag
  1020. description: This is the Ansible image tag/version requested to deploy.
  1021. value: latest
  1022. - name: APPLICATION_DOMAIN
  1023. displayName: Application Hostname
  1024. description: The exposed hostname that will route to the application service, if left blank a value will be defaulted.
  1025. value: ''
  1026. - name: APPLICATION_REPLICA_COUNT
  1027. displayName: Application Replica Count
  1028. description: This is the number of Application replicas requested to deploy.
  1029. value: '1'
  1030. - name: APPLICATION_INIT_DELAY
  1031. displayName: Application Init Delay
  1032. required: true
  1033. description: Delay in seconds before we attempt to initialize the application.
  1034. value: '15'
  1035. - name: APPLICATION_VOLUME_CAPACITY
  1036. displayName: Application Volume Capacity
  1037. required: true
  1038. description: Volume space available for application data.
  1039. value: 5Gi
  1040. - name: DATABASE_VOLUME_CAPACITY
  1041. displayName: Database Volume Capacity
  1042. required: true
  1043. description: Volume space available for database.
  1044. value: 15Gi
  1045. - name: HTTPD_SERVICE_NAME
  1046. required: true
  1047. displayName: Apache httpd Service Name
  1048. description: The name of the OpenShift Service exposed for the httpd container.
  1049. value: httpd
  1050. - name: HTTPD_DBUS_API_SERVICE_NAME
  1051. required: true
  1052. displayName: Apache httpd DBus API Service Name
  1053. description: The name of httpd dbus api service.
  1054. value: httpd-dbus-api
  1055. - name: HTTPD_IMG_NAME
  1056. displayName: Apache httpd Image Name
  1057. description: This is the httpd image name requested to deploy.
  1058. value: registry.access.redhat.com/cloudforms46/cfme-openshift-httpd
  1059. - name: HTTPD_IMG_TAG
  1060. displayName: Apache httpd Image Tag
  1061. description: This is the httpd image tag/version requested to deploy.
  1062. value: latest
  1063. - name: HTTPD_CONFIG_DIR
  1064. displayName: Apache Configuration Directory
  1065. description: Directory used to store the Apache configuration files.
  1066. value: "/etc/httpd/conf.d"
  1067. - name: HTTPD_AUTH_CONFIG_DIR
  1068. displayName: External Authentication Configuration Directory
  1069. description: Directory used to store the external authentication configuration files.
  1070. value: "/etc/httpd/auth-conf.d"
  1071. - name: HTTPD_CPU_REQ
  1072. displayName: Apache httpd Min CPU Requested
  1073. required: true
  1074. description: Minimum amount of CPU time the httpd container will need (expressed in millicores).
  1075. value: 500m
  1076. - name: HTTPD_MEM_REQ
  1077. displayName: Apache httpd Min RAM Requested
  1078. required: true
  1079. description: Minimum amount of memory the httpd container will need.
  1080. value: 512Mi
  1081. - name: HTTPD_MEM_LIMIT
  1082. displayName: Apache httpd Max RAM Limit
  1083. required: true
  1084. description: Maximum amount of memory the httpd container can consume.
  1085. value: 8192Mi