Skip to content

Commit 782ae04

Browse files
committed
Install web console server
1 parent cc3a0b4 commit 782ae04

File tree

26 files changed

+430
-1
lines changed

26 files changed

+430
-1
lines changed
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,114 @@
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+
value: openshift-web-console
18+
- name: LOGLEVEL
19+
value: "0"
20+
- name: API_SERVER_CONFIG
21+
- name: NODE_SELECTOR
22+
value: "{}"
23+
- name: REPLICA_COUNT
24+
value: "1"
25+
objects:
26+
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+
webconsole: "true"
45+
spec:
46+
serviceAccountName: webconsole
47+
containers:
48+
- name: webconsole
49+
image: ${IMAGE}
50+
imagePullPolicy: IfNotPresent
51+
command:
52+
- "/usr/bin/origin-web-console"
53+
- "--audit-log-path=-"
54+
- "--config=/var/webconsole-config/webconsole-config.yaml"
55+
ports:
56+
- containerPort: 8443
57+
volumeMounts:
58+
- mountPath: /var/serving-cert
59+
name: serving-cert
60+
- mountPath: /var/webconsole-config
61+
name: webconsole-config
62+
readinessProbe:
63+
httpGet:
64+
path: /healthz
65+
port: 8443
66+
scheme: HTTPS
67+
nodeSelector: "${{NODE_SELECTOR}}"
68+
volumes:
69+
- name: serving-cert
70+
secret:
71+
defaultMode: 420
72+
secretName: webconsole-serving-cert
73+
- name: webconsole-config
74+
configMap:
75+
defaultMode: 420
76+
name: webconsole-config
77+
78+
# to create the config for the web console
79+
- apiVersion: v1
80+
kind: ConfigMap
81+
metadata:
82+
namespace: ${NAMESPACE}
83+
name: webconsole-config
84+
labels:
85+
app: openshift-web-console
86+
data:
87+
webconsole-config.yaml: ${API_SERVER_CONFIG}
88+
89+
# to be able to assign powers to the process
90+
- apiVersion: v1
91+
kind: ServiceAccount
92+
metadata:
93+
namespace: ${NAMESPACE}
94+
name: webconsole
95+
labels:
96+
app: openshift-web-console
97+
98+
# to be able to expose web console inside the cluster
99+
- apiVersion: v1
100+
kind: Service
101+
metadata:
102+
namespace: ${NAMESPACE}
103+
name: webconsole
104+
labels:
105+
app: openshift-web-console
106+
annotations:
107+
service.alpha.openshift.io/serving-cert-secret-name: webconsole-serving-cert
108+
spec:
109+
selector:
110+
webconsole: "true"
111+
ports:
112+
- name: https
113+
port: 443
114+
targetPort: 8443

playbooks/common/openshift-cluster/upgrades/v3_9/upgrade.yml

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222

2323
- import_playbook: validator.yml
2424

25+
# Install the web console before upgrading the masters since 3.9 masters will
26+
# immediately begin proxying to the webconsole service.
27+
- import_playbook: ../../../../openshift-web-console/private/config.yml
28+
2529
- name: Flag pre-upgrade checks complete for hosts without errors
2630
hosts: oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config
2731
tasks:

playbooks/deploy_cluster.yml

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
- import_playbook: openshift-hosted/private/config.yml
2424

25+
- import_playbook: openshift-web-console/private/config.yml
26+
when: openshift_web_console_install | default(true) | bool
27+
2528
- import_playbook: openshift-metrics/private/config.yml
2629
when: openshift_metrics_install_metrics | default(false) | bool
2730

playbooks/openshift-logging/private/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
roles:
1717
- openshift_logging
1818

19+
# TODO: Remove when master config property is removed
1920
- name: Update Master configs
2021
hosts: oo_masters:!oo_first_master
2122
tasks:

playbooks/openshift-metrics/private/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
roles:
1717
- role: openshift_metrics
1818

19+
# TODO: Remove when master config property is removed
1920
- name: OpenShift Metrics
2021
hosts: oo_masters:!oo_first_master
2122
serial: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
- import_playbook: ../init/main.yml
3+
4+
- import_playbook: private/config.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
- name: Web Console Install Checkpoint Start
3+
hosts: all
4+
gather_facts: false
5+
tasks:
6+
- name: Set Web Console install 'In Progress'
7+
run_once: true
8+
set_stats:
9+
data:
10+
installer_phase_web_console:
11+
status: "In Progress"
12+
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
13+
14+
- name: Web Console
15+
hosts: oo_first_master
16+
roles:
17+
- openshift_web_console
18+
vars:
19+
first_master: "{{ groups.oo_first_master[0] }}"
20+
21+
- name: Web Console Install Checkpoint End
22+
hosts: all
23+
gather_facts: false
24+
tasks:
25+
- name: Set Web Console install 'Complete'
26+
run_once: true
27+
set_stats:
28+
data:
29+
installer_phase_web_console:
30+
status: "Complete"
31+
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../roles/

roles/installer_checkpoint/callback_plugins/installer_checkpoint.py

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def v2_playbook_on_stats(self, stats):
3131
'installer_phase_node',
3232
'installer_phase_glusterfs',
3333
'installer_phase_hosted',
34+
'installer_phase_web_console',
3435
'installer_phase_metrics',
3536
'installer_phase_logging',
3637
'installer_phase_prometheus',
@@ -80,6 +81,10 @@ def v2_playbook_on_stats(self, stats):
8081
'title': 'Hosted Install',
8182
'playbook': 'playbooks/openshift-hosted/config.yml'
8283
},
84+
'installer_phase_web_console': {
85+
'title': 'Web Console Install',
86+
'playbook': 'playbooks/openshift-web-console/config.yml'
87+
},
8388
'installer_phase_metrics': {
8489
'title': 'Metrics Install',
8590
'playbook': 'playbooks/openshift-metrics/config.yml'

roles/openshift_logging/tasks/delete_logging.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,14 @@
130130
name: openshift_logging_eventrouter
131131
when:
132132
not openshift_logging_install_eventrouter | default(false) | bool
133+
134+
# Update asset config in openshift-web-console namespace
135+
- name: Remove Kibana route information from web console asset config
136+
include_role:
137+
name: openshift_web_console
138+
tasks_from: update_asset_config.yml
139+
vars:
140+
asset_config_edits:
141+
- key: loggingPublicURL
142+
value: ""
143+
when: openshift_web_console_install | default(true) | bool

roles/openshift_logging/tasks/install_logging.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -311,4 +311,16 @@
311311
openshift_logging_install_eventrouter | default(false) | bool
312312

313313

314+
# TODO: Remove when asset config is removed from master-config.yaml
314315
- include_tasks: update_master_config.yaml
316+
317+
# Update asset config in openshift-web-console namespace
318+
- name: Add Kibana route information to web console asset config
319+
include_role:
320+
name: openshift_web_console
321+
tasks_from: update_asset_config.yml
322+
vars:
323+
asset_config_edits:
324+
- key: loggingPublicURL
325+
value: "https://{{ openshift_logging_kibana_hostname }}"
326+
when: openshift_web_console_install | default(true) | bool

roles/openshift_logging/tasks/update_master_config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
# TODO: Remove when asset config is removed from master-config.yaml
23
- name: Adding Kibana route information to loggingPublicURL
34
modify_yaml:
45
dest: "{{ openshift.common.config_base }}/master/master-config.yaml"

roles/openshift_metrics/tasks/install_metrics.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,20 @@
6767
with_items: "{{ hawkular_agent_object_defs.results }}"
6868
when: openshift_metrics_install_hawkular_agent | bool
6969

70+
# TODO: Remove when asset config is removed from master-config.yaml
7071
- include_tasks: update_master_config.yaml
7172

73+
# Update asset config in openshift-web-console namespace
74+
- name: Add metrics route information to web console asset config
75+
include_role:
76+
name: openshift_web_console
77+
tasks_from: update_asset_config.yml
78+
vars:
79+
asset_config_edits:
80+
- key: metricsPublicURL
81+
value: "https://{{ openshift_metrics_hawkular_hostname}}/hawkular/metrics"
82+
when: openshift_web_console_install | default(true) | bool
83+
7284
- command: >
7385
{{openshift_client_binary}}
7486
--config={{mktemp.stdout}}/admin.kubeconfig

roles/openshift_metrics/tasks/uninstall_metrics.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,14 @@
1818
clusterrolebinding/heapster-cluster-reader
1919
clusterrolebinding/hawkular-metrics
2020
changed_when: delete_metrics.stdout != 'No resources found'
21+
22+
# Update asset config in openshift-web-console namespace
23+
- name: Remove metrics route information from web console asset config
24+
include_role:
25+
name: openshift_web_console
26+
tasks_from: update_asset_config.yml
27+
vars:
28+
asset_config_edits:
29+
- key: metricsPublicURL
30+
value: ""
31+
when: openshift_web_console_install | default(true) | bool

roles/openshift_metrics/tasks/update_master_config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
# TODO: Remove when asset config is removed from master-config.yaml
23
- name: Adding metrics route information to metricsPublicURL
34
modify_yaml:
45
dest: "{{ openshift.common.config_base }}/master/master-config.yaml"
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
22
__openshift_metrics_image_prefix: "registry.access.redhat.com/openshift3/"
3-
__openshift_metrics_image_version: "v3.7"
3+
__openshift_metrics_image_version: "v3.9"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
openshift_web_console_nodeselector: {"region":"infra"}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
galaxy_info:
3+
author: OpenShift Development <[email protected]>
4+
description: Deploy OpenShift web console
5+
company: Red Hat, Inc.
6+
license: Apache License, Version 2.0
7+
min_ansible_version: 2.4
8+
platforms:
9+
- name: EL
10+
versions:
11+
- 7
12+
- name: Fedora
13+
versions:
14+
- all
15+
categories:
16+
- openshift
17+
dependencies:
18+
- role: lib_openshift
19+
- role: openshift_facts

0 commit comments

Comments
 (0)