console-template.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. apiVersion: template.openshift.io/v1
  2. kind: Template
  3. metadata:
  4. name: openshift-web-console
  5. annotations:
  6. openshift.io/display-name: OpenShift Web Console
  7. description: The server for the OpenShift web console.
  8. iconClass: icon-openshift
  9. tags: openshift,infra
  10. openshift.io/documentation-url: https://github.com/openshift/origin-web-console-server
  11. openshift.io/support-url: https://access.redhat.com
  12. openshift.io/provider-display-name: Red Hat, Inc.
  13. parameters:
  14. - name: IMAGE
  15. value: openshift/origin-web-console:latest
  16. - name: NAMESPACE
  17. # This namespace cannot be changed. Only `openshift-web-console` is supported.
  18. value: openshift-web-console
  19. - name: LOGLEVEL
  20. value: "0"
  21. - name: API_SERVER_CONFIG
  22. - name: NODE_SELECTOR
  23. value: "{}"
  24. - name: REPLICA_COUNT
  25. value: "1"
  26. objects:
  27. # to create the web console server
  28. - apiVersion: apps/v1beta1
  29. kind: Deployment
  30. metadata:
  31. namespace: ${NAMESPACE}
  32. name: webconsole
  33. labels:
  34. app: openshift-web-console
  35. webconsole: "true"
  36. spec:
  37. replicas: "${{REPLICA_COUNT}}"
  38. strategy:
  39. type: Recreate
  40. template:
  41. metadata:
  42. name: webconsole
  43. labels:
  44. app: openshift-web-console
  45. webconsole: "true"
  46. spec:
  47. serviceAccountName: webconsole
  48. containers:
  49. - name: webconsole
  50. image: ${IMAGE}
  51. imagePullPolicy: IfNotPresent
  52. command:
  53. - "/usr/bin/origin-web-console"
  54. - "--audit-log-path=-"
  55. - "-v=${LOGLEVEL}"
  56. - "--config=/var/webconsole-config/webconsole-config.yaml"
  57. ports:
  58. - containerPort: 8443
  59. volumeMounts:
  60. - mountPath: /var/serving-cert
  61. name: serving-cert
  62. - mountPath: /var/webconsole-config
  63. name: webconsole-config
  64. readinessProbe:
  65. httpGet:
  66. path: /healthz
  67. port: 8443
  68. scheme: HTTPS
  69. livenessProbe:
  70. exec:
  71. command:
  72. - /bin/sh
  73. - -c
  74. - |-
  75. if [[ ! -f /tmp/webconsole-config.hash ]]; then \
  76. md5sum /var/webconsole-config/webconsole-config.yaml > /tmp/webconsole-config.hash; \
  77. elif [[ $(md5sum /var/webconsole-config/webconsole-config.yaml) != $(cat /tmp/webconsole-config.hash) ]]; then \
  78. echo 'webconsole-config.yaml has changed.'; \
  79. exit 1; \
  80. fi && curl -k -f https://0.0.0.0:8443/console/
  81. resources:
  82. requests:
  83. cpu: 100m
  84. memory: 100Mi
  85. nodeSelector: "${{NODE_SELECTOR}}"
  86. volumes:
  87. - name: serving-cert
  88. secret:
  89. defaultMode: 0440
  90. secretName: webconsole-serving-cert
  91. - name: webconsole-config
  92. configMap:
  93. defaultMode: 0440
  94. name: webconsole-config
  95. # to create the config for the web console
  96. - apiVersion: v1
  97. kind: ConfigMap
  98. metadata:
  99. namespace: ${NAMESPACE}
  100. name: webconsole-config
  101. labels:
  102. app: openshift-web-console
  103. data:
  104. webconsole-config.yaml: ${API_SERVER_CONFIG}
  105. # to be able to assign powers to the process
  106. - apiVersion: v1
  107. kind: ServiceAccount
  108. metadata:
  109. namespace: ${NAMESPACE}
  110. name: webconsole
  111. labels:
  112. app: openshift-web-console
  113. # to be able to expose web console inside the cluster
  114. - apiVersion: v1
  115. kind: Service
  116. metadata:
  117. namespace: ${NAMESPACE}
  118. name: webconsole
  119. labels:
  120. app: openshift-web-console
  121. annotations:
  122. service.alpha.openshift.io/serving-cert-secret-name: webconsole-serving-cert
  123. prometheus.io/scrape: "true"
  124. prometheus.io/scheme: https
  125. spec:
  126. selector:
  127. webconsole: "true"
  128. ports:
  129. - name: https
  130. port: 443
  131. targetPort: 8443