Skip to content

Commit

Permalink
[KIECLOUD-97] - Propagate OpenShiftStartupStrategy related changes to…
Browse files Browse the repository at this point in the history
… KIE APB

Signed-off-by: Filippe Spolti <[email protected]>
  • Loading branch information
spolti committed Jun 4, 2019
1 parent c114081 commit e127b61
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 162 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
target
.idea/
*.iml
18 changes: 9 additions & 9 deletions apb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ _apb_businesscentral_hostname: &_apb_businesscentral_hostname
name: apb_businesscentral_hostname
description: Public hostname for Business Central. Generated if empty
# OCP Enablement
_apb_controller_ocp_enabled: &_apb_controller_ocp_enabled
name: apb_controller_ocp_enabled
title: Enable OpenShift Integration
description: If set to true, turns on OpenShift integration feature (Sets the org.kie.workbench.controller.openshift.enabled system property)
_apb_controller_global_discovery: &_apb_controller_global_discovery
name: apb_controller_global_discovery
title: Enable KIE server global discovery
description: If set to true, turns on KIE server global discovery feature (Sets the org.kie.server.controller.openshift.global.discovery.enabled system property)
type: boolean
default: false
display_group: Business Central
Expand Down Expand Up @@ -215,7 +215,7 @@ _apb_kieserver_startup_strategy: &_apb_kieserver_startup_strategy
required: true
type: enum
enum: ['ControllerBasedStartupStrategy', 'OpenShiftStartupStrategy']
default: ControllerBasedStartupStrategy
default: OpenShiftStartupStrategy
display_group: Process Server
_apb_kieserver_prometheus_ext_disabled: &_apb_kieserver_prometheus_ext_disabled
name: apb_kieserver_prometheus_ext_disabled
Expand Down Expand Up @@ -704,7 +704,7 @@ plans:
- <<: *_apb_businesscentral_hostname
display_group: Business Central
# OCP Enablement
- *_apb_controller_ocp_enabled
- *_apb_controller_global_discovery
- *_apb_controller_prefer_kieserver_svc
- *_apb_controller_template_cache_ttl
# Git hooks
Expand Down Expand Up @@ -920,7 +920,7 @@ plans:
- <<: *_apb_kieserver_startup_strategy
description: "When set to OpenShiftStartupStrategy, allows Process Server to start up independently used shared state from OpenShift API service; when set to LocalContainersStartupStrategy, allows KIE server to start up and function with local config, even when a controller is configured and unavailable"
enum: ['LocalContainersStartupStrategy', 'OpenShiftStartupStrategy']
default: LocalContainersStartupStrategy
default: OpenShiftStartupStrategy
- *_apb_kieserver_image_stream_name
# Prometheus
- *_apb_kieserver_prometheus_ext_disabled
Expand Down Expand Up @@ -1033,7 +1033,7 @@ plans:
description: Public hostname for Business Central Monitoring. Generated if empty
display_group: Business Central Monitoring
# OCP Enablement
- *_apb_controller_ocp_enabled
- *_apb_controller_global_discovery
- *_apb_controller_prefer_kieserver_svc
- *_apb_controller_template_cache_ttl
# Other users
Expand Down Expand Up @@ -1157,7 +1157,7 @@ plans:
description: Public hostname for Business Central Monitoring. Generated if empty
display_group: Business Central Monitoring
# OCP Enablement
- *_apb_controller_ocp_enabled
- *_apb_controller_global_discovery
- *_apb_controller_prefer_kieserver_svc
- *_apb_controller_template_cache_ttl

Expand Down
272 changes: 136 additions & 136 deletions image.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ spec:
value: '{{ businesscentral_keystore_alias }}'
- name: HTTPS_PASSWORD
value: '{{ businesscentral_keystore_pwd }}'
{% if controller_ocp_enabled %}
## OpenShift Enhancement BEGIN
- name: KIE_WORKBENCH_CONTROLLER_OPENSHIFT_ENABLED
value: "{{ controller_ocp_enabled }}"
- name: KIE_SERVER_CONTROLLER_OPENSHIFT_GLOBAL_DISCOVERY_ENABLED
value: "{{ controller_global_discovery }}"
- name: KIE_SERVER_CONTROLLER_OPENSHIFT_PREFER_KIESERVER_SERVICE
value: "{{ controller_prefer_kieserver_svc }}"
- name: KIE_SERVER_CONTROLLER_TEMPLATE_CACHE_TTL
value: "{{ controller_template_cache_ttl }}"
- name: KIE_WORKBENCH_CONTROLLER_OPENSHIFT_ENABLED
value: "true"
## OpenShift Enhancement END
{% endif %}
{% if maven_mirror_url %}
- name: MAVEN_MIRROR_URL
value: "{{ maven_mirror_url }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ spec:
value: '{{ kie_execution_user }}'
- name: KIE_SERVER_PWD
value: '{{ kie_execution_pwd }}'
{% if controller_ocp_enabled %}
## OpenShift Enhancement BEGIN
- name: KIE_WORKBENCH_CONTROLLER_OPENSHIFT_ENABLED
value: "{{ controller_ocp_enabled }}"
- name: KIE_SERVER_CONTROLLER_OPENSHIFT_GLOBAL_DISCOVERY_ENABLED
value: "{{ controller_global_discovery }}"
- name: KIE_SERVER_CONTROLLER_OPENSHIFT_PREFER_KIESERVER_SERVICE
value: "{{ controller_prefer_kieserver_svc }}"
- name: KIE_SERVER_CONTROLLER_TEMPLATE_CACHE_TTL
value: "{{ controller_template_cache_ttl }}"
- name: KIE_WORKBENCH_CONTROLLER_OPENSHIFT_ENABLED
value: "true"
## OpenShift Enhancement END
{% endif %}
{% if maven_mirror_url %}
- name: MAVEN_MIRROR_URL
value: "{{ maven_mirror_url }}"
Expand Down
2 changes: 1 addition & 1 deletion modules/rhpam-apb/roles/deploy-kieserver/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ kieserver_deployment_index: "0"
kieserver_deployment_name: "{{ application_name }}-kieserver-{{ kieserver_deployment_index }}"
kieserver_default_secret_name: "{{ kieserver_deployment_name }}"
kieserver_service_name: "rhpam-kieserver"
kieserver_businesscentral_maven_svc: "{{ controller_svc }}"
kieserver_businesscentral_svc: "{{ controller_svc }}"
kieserver_hostname: "{{ apb_kieserver_hostname | default('', true) | trim }}"
kieserver_volume_size: "{{ apb_kieserver_volume_size | default('', true) | trim }}"
kieserver_limits_memory: "1Gi"
Expand Down
4 changes: 4 additions & 0 deletions modules/rhpam-apb/roles/deploy-kieserver/tasks/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
spec:
selector:
deploymentConfig: '{{ kieserver_deployment_name }}'
sessionAffinity: ClientIP
sessionAffinityConfig:
clientIP:
timeoutSeconds: 3600
ports:
- name: http
port: 8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ metadata:
app: {{ kieserver_deployment_name }}
application: {{ application_name }}
service: {{ kieserver_service_name }}
services.server.kie.org/kie-server-id: {{ kieserver_deployment_name }}
spec:
revisionHistoryLimit: 10
strategy:
type: Rolling
rollingParams:
Expand Down Expand Up @@ -40,13 +42,25 @@ spec:
application: {{ application_name }}
service: {{ kieserver_service_name }}
deploymentConfig: {{ kieserver_deployment_name }}
services.server.kie.org/kie-server-id: {{ kieserver_deployment_name }}
spec:
serviceAccountName: {{ service_account_name }}
terminationGracePeriodSeconds: 60
terminationGracePeriodSeconds: 90
containers:
- name: kieserver
image: ' '
imagePullPolicy: "{{ kieserver_image_pull_policy }}"
lifecycle:
postStart:
exec:
command:
- /bin/sh
- /opt/eap/bin/launch/jboss-kie-kieserver-hooks.sh
preStop:
exec:
command:
- /bin/sh
- /opt/eap/bin/launch/jboss-kie-kieserver-hooks.sh
resources:
limits:
memory: "{{ kieserver_limits_memory }}"
Expand Down Expand Up @@ -84,6 +98,8 @@ spec:
protocol: TCP
{% endif %}
env:
- name: WORKBENCH_SERVICE_NAME
value: "{{ kieserver_businesscentral_svc }}"
- name: KIE_SERVER_MODE
value: "{{ kieserver_mode }}"
- name: DATASOURCES
Expand Down Expand Up @@ -130,7 +146,7 @@ spec:
value: "{{ kieserver_db[kieserver_db_type].url }}"
{% endif %}
- name: PROMETHEUS_SERVER_EXT_DISABLED
- value: "{{ kieserver_prometheus_ext_disabled }}"
value: "{{ kieserver_prometheus_ext_disabled }}"
- name: DROOLS_SERVER_FILTER_CLASSES
value: "true"
- name: KIE_ADMIN_USER
Expand Down Expand Up @@ -171,6 +187,10 @@ spec:
value: "{{ router_protocol }}"
{% endif %}
- name: KIE_SERVER_ID
valueFrom:
fieldRef:
fieldPath: metadata.labels['services.server.kie.org/kie-server-id']
- name: KIE_SERVER_ROUTE_NAME
value: "{{ kieserver_deployment_name }}"
- name: KIE_SERVER_HOST
valueFrom:
Expand All @@ -184,7 +204,7 @@ spec:
- name: MAVEN_REPOS
value: "RHPAMCENTR,EXTERNAL"
- name: RHPAMCENTR_MAVEN_REPO_SERVICE
value: "{{ kieserver_businesscentral_maven_svc }}"
value: "{{ kieserver_businesscentral_svc }}"
- name: RHPAMCENTR_MAVEN_REPO_PATH
value: "/maven2/"
- name: RHPAMCENTR_MAVEN_REPO_USERNAME
Expand Down
2 changes: 1 addition & 1 deletion modules/rhpam-apb/roles/rhpam-apb/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ provision_failed: false
service_account_name: "{{ application_name }}-rhpamsvc"

# OpenShift Integration
controller_ocp_enabled: "{{ apb_controller_ocp_enabled | default(false, true) | lower }}"
controller_global_discovery: "{{ apb_controller_global_discovery | default(false, true) | lower }}"
controller_prefer_kieserver_svc: "{{ apb_controller_prefer_kieserver_svc | default(false, true) | lower }}"
controller_template_cache_ttl: "{{ apb_controller_template_cache_ttl | default(60000, true) }}"
8 changes: 4 additions & 4 deletions modules/rhpam-apb/roles/rhpam-apb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
kieserver_mode: 'DEVELOPMENT'
kieserver_db_type: 'H2'
kieserver_replicas: 1
kieserver_startup_strategy: "{{ apb_kieserver_startup_strategy | default('ControllerBasedStartupStrategy', true) | trim }}"
kieserver_startup_strategy: "{{ apb_kieserver_startup_strategy | default('OpenShiftStartupStrategy', true) | trim }}"
when: _apb_plan_id == "trial"

- name: "[RHPAM] Authoring Plan"
Expand All @@ -57,7 +57,7 @@
name: deploy-kieserver
vars:
kieserver_replicas: 1
kieserver_startup_strategy: "{{ apb_kieserver_startup_strategy | default('ControllerBasedStartupStrategy', true) | trim }}"
kieserver_startup_strategy: "{{ apb_kieserver_startup_strategy | default('OpenShiftStartupStrategy', true) | trim }}"
when: _apb_plan_id == "authoring"


Expand Down Expand Up @@ -85,7 +85,7 @@
has_router: true
router_svc: "{{ smartrouter_deployment_name }}"
kieserver_deployment_index: "{{ item }}"
kieserver_startup_strategy: "{{ apb_kieserver_startup_strategy | default('ControllerBasedStartupStrategy', true) | trim }}"
kieserver_startup_strategy: "{{ apb_kieserver_startup_strategy | default('OpenShiftStartupStrategy', true) | trim }}"
with_sequence: start=0 count={{ kie_execution_sets }}
when: _apb_plan_id == "managed"

Expand All @@ -112,7 +112,7 @@
name: deploy-kieserver
vars:
kieserver_mgmt_disabled: true
kieserver_startup_strategy: "{{ apb_kieserver_startup_strategy | default('LocalContainersStartupStrategy', true) | trim }}"
kieserver_startup_strategy: "{{ apb_kieserver_startup_strategy | default('OpenShiftStartupStrategy', true) | trim }}"
has_external_controller: true
has_router: true
kieserver_s2i: true
Expand Down

0 comments on commit e127b61

Please sign in to comment.