Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support web console image for cluster up #17575

Merged
merged 2 commits into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hack/test-end-to-end-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ if os::util::ensure::system_binary_exists 'systemctl'; then
${USE_SUDO:+sudo} systemctl restart docker.service
fi

# Tag the web console image with the same tag as the other origin images
docker pull openshift/origin-web-console:latest
docker tag openshift/origin-web-console:latest openshift/origin-web-console:${TAG}

# Setup
os::log::info "openshift version: `openshift version`"
os::log::info "oc version: `oc version`"
Expand Down
21 changes: 21 additions & 0 deletions install/origin-web-console/console-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
kind: AssetConfig
apiVersion: v1
extensionDevelopment: false
extensionProperties: null
extensionScripts: null
extensionStylesheets: null
extensions: null
loggingPublicURL: ""
logoutURL: ""
masterPublicURL: https://127.0.0.1:8443
metricsPublicURL: ""
publicURL: https://127.0.0.1:8443/console/
servingInfo:
bindAddress: 0.0.0.0:8443
bindNetwork: tcp4
certFile: /var/serving-cert/tls.crt
clientCA: ""
keyFile: /var/serving-cert/tls.key
maxRequestsInFlight: 0
namedCertificates: null
requestTimeoutSeconds: 0
121 changes: 121 additions & 0 deletions install/origin-web-console/console-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: openshift-web-console
annotations:
openshift.io/display-name: OpenShift Web Console
description: The server for the OpenShift web console.
iconClass: icon-openshift
tags: openshift,infra
openshift.io/documentation-url: https://github.com/openshift/origin-web-console-server
openshift.io/support-url: https://access.redhat.com
openshift.io/provider-display-name: Red Hat, Inc.
parameters:
- name: IMAGE
value: openshift/origin-web-console:latest
- name: NAMESPACE
# This namespace cannot be changed. Only `openshift-web-console` is supported.
value: openshift-web-console
- name: LOGLEVEL
value: "0"
- name: API_SERVER_CONFIG
- name: NODE_SELECTOR
value: "{}"
- name: REPLICA_COUNT
value: "1"
objects:

# to create the web console server
- apiVersion: apps/v1beta1
kind: Deployment
metadata:
namespace: ${NAMESPACE}
name: webconsole
labels:
app: openshift-web-console
webconsole: "true"
spec:
replicas: "${{REPLICA_COUNT}}"
strategy:
type: Recreate
template:
metadata:
name: webconsole
labels:
webconsole: "true"
spec:
serviceAccountName: webconsole
containers:
- name: webconsole
image: ${IMAGE}
imagePullPolicy: IfNotPresent
command:
- "/usr/bin/origin-web-console"
- "--audit-log-path=-"
- "-v=${LOGLEVEL}"
- "--config=/var/webconsole-config/webconsole-config.yaml"
ports:
- containerPort: 8443
volumeMounts:
- mountPath: /var/serving-cert
name: serving-cert
- mountPath: /var/webconsole-config
name: webconsole-config
readinessProbe:
Copy link
Contributor

@deads2k deads2k Jan 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

health check? livenessProbe

httpGet:
path: /healthz
port: 8443
scheme: HTTPS
livenessProbe:
httpGet:
path: /
port: 8443
scheme: HTTPS
nodeSelector: "${{NODE_SELECTOR}}"
volumes:
- name: serving-cert
secret:
defaultMode: 400
secretName: webconsole-serving-cert
- name: webconsole-config
configMap:
defaultMode: 440
name: webconsole-config

# to create the config for the web console
- apiVersion: v1
kind: ConfigMap
metadata:
namespace: ${NAMESPACE}
name: webconsole-config
labels:
app: openshift-web-console
data:
webconsole-config.yaml: ${API_SERVER_CONFIG}

# to be able to assign powers to the process
- apiVersion: v1
kind: ServiceAccount
metadata:
namespace: ${NAMESPACE}
name: webconsole
labels:
app: openshift-web-console

# to be able to expose web console inside the cluster
- apiVersion: v1
kind: Service
metadata:
namespace: ${NAMESPACE}
name: webconsole
labels:
app: openshift-web-console
annotations:
service.alpha.openshift.io/serving-cert-secret-name: webconsole-serving-cert
spec:
selector:
webconsole: "true"
ports:
- name: https
port: 443
targetPort: 8443
183 changes: 183 additions & 0 deletions pkg/oc/bootstrap/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/oc/bootstrap/docker/openshift/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ func (h *Helper) updateConfig(configDir string, opt *StartOptions) error {
}
cfg.AssetConfig.ExtensionScripts = append(cfg.AssetConfig.ExtensionScripts, serviceCatalogExtensionPath)

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