console-template.yaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. apiVersion: template.openshift.io/v1
  2. kind: Template
  3. metadata:
  4. name: openshift-console
  5. annotations:
  6. openshift.io/display-name: OpenShift Console
  7. description: The server for the OpenShift console.
  8. iconClass: icon-openshift
  9. tags: openshift,infra
  10. openshift.io/support-url: https://access.redhat.com
  11. openshift.io/provider-display-name: Red Hat, Inc.
  12. parameters:
  13. - name: IMAGE
  14. value: openshift/origin-console:latest
  15. required: true
  16. - name: NAMESPACE
  17. # This namespace cannot be changed. Only `openshift-console` is supported.
  18. value: openshift-console
  19. required: true
  20. - name: CONSOLE_HOSTNAME
  21. value: console.router.default.svc.cluster.local
  22. required: true
  23. - name: TLS_CERT
  24. - name: TLS_KEY
  25. - name: TLS_CA_CERT
  26. - name: NODE_SELECTOR
  27. value: "{}"
  28. required: true
  29. - name: REPLICA_COUNT
  30. value: "1"
  31. required: true
  32. - name: SERVER_CONFIG
  33. required: true
  34. - name: OAUTH_SECRET
  35. generate: expression
  36. from: "[a-zA-Z0-9]{32}"
  37. objects:
  38. # to create the web console server
  39. - apiVersion: apps/v1
  40. kind: Deployment
  41. metadata:
  42. name: console
  43. namespace: ${NAMESPACE}
  44. labels:
  45. app: openshift-console
  46. component: ui
  47. spec:
  48. selector:
  49. matchLabels:
  50. app: openshift-console
  51. component: ui
  52. strategy:
  53. type: RollingUpdate
  54. progressDeadlineSeconds: 600
  55. replicas: "${{REPLICA_COUNT}}"
  56. template:
  57. metadata:
  58. labels:
  59. app: openshift-console
  60. component: ui
  61. name: console
  62. spec:
  63. selector:
  64. matchLabels:
  65. app: openshift-console
  66. component: ui
  67. affinity:
  68. podAntiAffinity:
  69. preferredDuringSchedulingIgnoredDuringExecution:
  70. - weight: 100
  71. podAffinityTerm:
  72. labelSelector:
  73. matchLabels:
  74. app: openshift-console
  75. topologyKey: kubernetes.io/hostname
  76. containers:
  77. - command:
  78. - /opt/bridge/bin/bridge
  79. - "--public-dir=/opt/bridge/static"
  80. - "--config=/var/console-config/console-config.yaml"
  81. image: ${IMAGE}
  82. imagePullPolicy: IfNotPresent
  83. readinessProbe:
  84. httpGet:
  85. path: /health
  86. port: 8443
  87. scheme: HTTPS
  88. livenessProbe:
  89. httpGet:
  90. path: /health
  91. port: 8443
  92. scheme: HTTPS
  93. initialDelaySeconds: 30
  94. name: console
  95. ports:
  96. - containerPort: 8443
  97. protocol: TCP
  98. resources:
  99. limits:
  100. cpu: 100m
  101. memory: 100Mi
  102. requests:
  103. cpu: 100m
  104. memory: 100Mi
  105. terminationMessagePath: /dev/termination-log
  106. volumeMounts:
  107. - mountPath: /var/serving-cert
  108. name: serving-cert
  109. readOnly: true
  110. - mountPath: /var/oauth-config
  111. name: oauth-config
  112. readOnly: true
  113. - mountPath: /var/console-config
  114. name: console-config
  115. dnsPolicy: ClusterFirst
  116. restartPolicy: Always
  117. terminationGracePeriodSeconds: 30
  118. volumes:
  119. - name: serving-cert
  120. secret:
  121. defaultMode: 0440
  122. secretName: console-serving-cert
  123. - name: oauth-config
  124. secret:
  125. defaultMode: 0440
  126. secretName: console-oauth-config
  127. - name: console-config
  128. configMap:
  129. defaultMode: 0440
  130. name: console-config
  131. nodeSelector: "${{NODE_SELECTOR}}"
  132. # to create the config for the console
  133. - apiVersion: v1
  134. kind: ConfigMap
  135. metadata:
  136. namespace: ${NAMESPACE}
  137. name: console-config
  138. labels:
  139. app: openshift-console
  140. data:
  141. console-config.yaml: ${SERVER_CONFIG}
  142. # to store the OAauth client ID and secret
  143. - apiVersion: v1
  144. kind: Secret
  145. metadata:
  146. namespace: ${NAMESPACE}
  147. name: console-oauth-config
  148. labels:
  149. app: openshift-console
  150. stringData:
  151. clientSecret: ${OAUTH_SECRET}
  152. # to be able to assign powers to the process
  153. - apiVersion: v1
  154. kind: ServiceAccount
  155. metadata:
  156. namespace: ${NAMESPACE}
  157. name: console
  158. labels:
  159. app: openshift-console
  160. # to be able to expose cluster console inside the cluster
  161. - apiVersion: v1
  162. kind: Service
  163. metadata:
  164. namespace: ${NAMESPACE}
  165. name: console
  166. labels:
  167. app: openshift-console
  168. annotations:
  169. service.alpha.openshift.io/serving-cert-secret-name: console-serving-cert
  170. spec:
  171. selector:
  172. app: openshift-console
  173. component: ui
  174. ports:
  175. - name: https
  176. port: 443
  177. targetPort: 8443
  178. # to be able to expose cluster console outside the cluster
  179. - apiVersion: v1
  180. kind: Route
  181. metadata:
  182. namespace: ${NAMESPACE}
  183. name: console
  184. labels:
  185. app: openshift-console
  186. spec:
  187. host: ${CONSOLE_HOSTNAME}
  188. to:
  189. kind: Service
  190. name: console
  191. port:
  192. targetPort: https
  193. tls:
  194. insecureEdgeTerminationPolicy: Redirect
  195. termination: reencrypt
  196. certificate: ${TLS_CERT}
  197. key: ${TLS_KEY}
  198. caCertificate: ${TLS_CA_CERT}
  199. # to let users log in
  200. - apiVersion: oauth.openshift.io/v1
  201. kind: OAuthClient
  202. metadata:
  203. name: openshift-console
  204. grantMethod: auto
  205. secret: ${OAUTH_SECRET}
  206. redirectURIs:
  207. - https://${CONSOLE_HOSTNAME}/