console-template.yaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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: docker.io/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: RollingUpdate
  40. rollingUpdate:
  41. # behave like a recreate deployment, but don't wait for pods to terminate
  42. maxUnavailable: 100%
  43. template:
  44. metadata:
  45. name: webconsole
  46. labels:
  47. app: openshift-web-console
  48. webconsole: "true"
  49. spec:
  50. serviceAccountName: webconsole
  51. containers:
  52. - name: webconsole
  53. image: ${IMAGE}
  54. imagePullPolicy: IfNotPresent
  55. command:
  56. - "/usr/bin/origin-web-console"
  57. - "--audit-log-path=-"
  58. - "-v=${LOGLEVEL}"
  59. - "--config=/var/webconsole-config/webconsole-config.yaml"
  60. ports:
  61. - containerPort: 8443
  62. volumeMounts:
  63. - mountPath: /var/serving-cert
  64. name: serving-cert
  65. - mountPath: /var/webconsole-config
  66. name: webconsole-config
  67. readinessProbe:
  68. httpGet:
  69. path: /healthz
  70. port: 8443
  71. scheme: HTTPS
  72. livenessProbe:
  73. exec:
  74. command:
  75. - /bin/sh
  76. - -c
  77. - |-
  78. if [[ ! -f /tmp/webconsole-config.hash ]]; then \
  79. md5sum /var/webconsole-config/webconsole-config.yaml > /tmp/webconsole-config.hash; \
  80. elif [[ $(md5sum /var/webconsole-config/webconsole-config.yaml) != $(cat /tmp/webconsole-config.hash) ]]; then \
  81. echo 'webconsole-config.yaml has changed.'; \
  82. exit 1; \
  83. fi && curl -k -f https://0.0.0.0:8443/console/
  84. resources:
  85. requests:
  86. cpu: 100m
  87. memory: 100Mi
  88. nodeSelector: "${{NODE_SELECTOR}}"
  89. volumes:
  90. - name: serving-cert
  91. secret:
  92. defaultMode: 0440
  93. secretName: webconsole-serving-cert
  94. - name: webconsole-config
  95. configMap:
  96. defaultMode: 0440
  97. name: webconsole-config
  98. # to create the config for the web console
  99. - apiVersion: v1
  100. kind: ConfigMap
  101. metadata:
  102. namespace: ${NAMESPACE}
  103. name: webconsole-config
  104. labels:
  105. app: openshift-web-console
  106. data:
  107. webconsole-config.yaml: ${API_SERVER_CONFIG}
  108. # to be able to assign powers to the process
  109. - apiVersion: v1
  110. kind: ServiceAccount
  111. metadata:
  112. namespace: ${NAMESPACE}
  113. name: webconsole
  114. labels:
  115. app: openshift-web-console
  116. # to be able to expose web console inside the cluster
  117. - apiVersion: v1
  118. kind: Service
  119. metadata:
  120. namespace: ${NAMESPACE}
  121. name: webconsole
  122. labels:
  123. app: openshift-web-console
  124. annotations:
  125. service.alpha.openshift.io/serving-cert-secret-name: webconsole-serving-cert
  126. prometheus.io/scrape: "true"
  127. prometheus.io/scheme: https
  128. spec:
  129. selector:
  130. webconsole: "true"
  131. ports:
  132. - name: https
  133. port: 443
  134. targetPort: 8443