Skip to content

Commit a027e96

Browse files
Merge pull request #17575 from spadgett/console-cluster-up
Automatic merge from submit-queue. Support web console image for cluster up https://trello.com/c/9oaUh8xP Install and run the web console server from a template during cluster up. Requires the proxy from #17862 to actually use the console server. @deads2k @jwforres
2 parents 45271ae + 27041dd commit a027e96

File tree

9 files changed

+703
-20
lines changed

9 files changed

+703
-20
lines changed

hack/test-end-to-end-docker.sh

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ if os::util::ensure::system_binary_exists 'systemctl'; then
5050
${USE_SUDO:+sudo} systemctl restart docker.service
5151
fi
5252

53+
# Tag the web console image with the same tag as the other origin images
54+
docker pull openshift/origin-web-console:latest
55+
docker tag openshift/origin-web-console:latest openshift/origin-web-console:${TAG}
56+
5357
# Setup
5458
os::log::info "openshift version: `openshift version`"
5559
os::log::info "oc version: `oc version`"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
kind: AssetConfig
2+
apiVersion: v1
3+
extensionDevelopment: false
4+
extensionProperties: null
5+
extensionScripts: null
6+
extensionStylesheets: null
7+
extensions: null
8+
loggingPublicURL: ""
9+
logoutURL: ""
10+
masterPublicURL: https://127.0.0.1:8443
11+
metricsPublicURL: ""
12+
publicURL: https://127.0.0.1:8443/console/
13+
servingInfo:
14+
bindAddress: 0.0.0.0:8443
15+
bindNetwork: tcp4
16+
certFile: /var/serving-cert/tls.crt
17+
clientCA: ""
18+
keyFile: /var/serving-cert/tls.key
19+
maxRequestsInFlight: 0
20+
namedCertificates: null
21+
requestTimeoutSeconds: 0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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+
28+
# to create the web console server
29+
- apiVersion: apps/v1beta1
30+
kind: Deployment
31+
metadata:
32+
namespace: ${NAMESPACE}
33+
name: webconsole
34+
labels:
35+
app: openshift-web-console
36+
webconsole: "true"
37+
spec:
38+
replicas: "${{REPLICA_COUNT}}"
39+
strategy:
40+
type: Recreate
41+
template:
42+
metadata:
43+
name: webconsole
44+
labels:
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+
httpGet:
71+
path: /
72+
port: 8443
73+
scheme: HTTPS
74+
nodeSelector: "${{NODE_SELECTOR}}"
75+
volumes:
76+
- name: serving-cert
77+
secret:
78+
defaultMode: 400
79+
secretName: webconsole-serving-cert
80+
- name: webconsole-config
81+
configMap:
82+
defaultMode: 440
83+
name: webconsole-config
84+
85+
# to create the config for the web console
86+
- apiVersion: v1
87+
kind: ConfigMap
88+
metadata:
89+
namespace: ${NAMESPACE}
90+
name: webconsole-config
91+
labels:
92+
app: openshift-web-console
93+
data:
94+
webconsole-config.yaml: ${API_SERVER_CONFIG}
95+
96+
# to be able to assign powers to the process
97+
- apiVersion: v1
98+
kind: ServiceAccount
99+
metadata:
100+
namespace: ${NAMESPACE}
101+
name: webconsole
102+
labels:
103+
app: openshift-web-console
104+
105+
# to be able to expose web console inside the cluster
106+
- apiVersion: v1
107+
kind: Service
108+
metadata:
109+
namespace: ${NAMESPACE}
110+
name: webconsole
111+
labels:
112+
app: openshift-web-console
113+
annotations:
114+
service.alpha.openshift.io/serving-cert-secret-name: webconsole-serving-cert
115+
spec:
116+
selector:
117+
webconsole: "true"
118+
ports:
119+
- name: https
120+
port: 443
121+
targetPort: 8443

pkg/oc/bootstrap/bindata.go

+183
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/oc/bootstrap/docker/openshift/helper.go

+1
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ func (h *Helper) updateConfig(configDir string, opt *StartOptions) error {
849849
}
850850
cfg.AssetConfig.ExtensionScripts = append(cfg.AssetConfig.ExtensionScripts, serviceCatalogExtensionPath)
851851

852+
// TODO: remove when we can detect this is enabled in origin-web-console-server
852853
extension := "window.OPENSHIFT_CONSTANTS.TEMPLATE_SERVICE_BROKER_ENABLED = true;\n"
853854
extensionPath := filepath.Join(configDir, "master", "servicecatalog-extension.js")
854855
err = ioutil.WriteFile(extensionPath, []byte(extension), 0644)

0 commit comments

Comments
 (0)