Diego Alejandro Torres Fuerte
2020-01-14 7542f93de2818a937b3c13517220b2376189a432
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
---
apiVersion: v1
kind: Template
labels:
  template: rhpam-businesscental-with-users
  group: xpaas
metadata:
  name: rhpam-businesscentral-with-users
objects:
- kind: Service
  apiVersion: v1
  spec:
    ports:
    - name: http
      port: 8080
      targetPort: 8080
    - name: https
      port: 8443
      targetPort: 8443
    - name: git-ssh
      port: 8001
      targetPort: 8001
    selector:
      deploymentConfig: "{{ businesscentral_application_name }}"
  metadata:
    name: "{{ businesscentral_application_name }}"
    labels:
      app: "{{ app_name }}"
      service: "{{ businesscentral_application_name }}"
- kind: Route
  apiVersion: v1
  id: "{{ businesscentral_application_name }}-https"
  metadata:
    name: "{{ businesscentral_application_name }}"
    labels:
      app: "{{ app_name }}"
      service: "{{ businesscentral_application_name }}"
    annotations:
      haproxy.router.openshift.io/timeout: 60s
  spec:
    to:
      name: "{{ businesscentral_application_name }}"
    port:
      targetPort: http
    tls:
      termination: edge
- kind: DeploymentConfig
  apiVersion: v1
  metadata:
    name: "{{ businesscentral_application_name }}"
    labels:
      app: "{{ app_name }}"
      service: "{{ businesscentral_application_name }}"
  spec:
    strategy:
      type: Recreate
    triggers:
    - type: ImageChange
      imageChangeParams:
        automatic: true
        containerNames:
        - "{{ businesscentral_application_name }}"
        from:
          kind: ImageStreamTag
          namespace: openshift
          name: rhpam-bc-apd:1.2
    - type: ConfigChange
    replicas: 1
    selector:
      deploymentConfig: "{{ businesscentral_application_name }}"
    template:
      metadata:
        name: "{{ businesscentral_application_name }}"
        labels:
          deploymentConfig: "{{ businesscentral_application_name }}"
          app: "{{ app_name }}"
          service: "{{ businesscentral_application_name }}"
      spec:
        serviceAccountName: "{{ bc_service_account }}"
        terminationGracePeriodSeconds: 60
        containers:
        - name: "{{ businesscentral_application_name }}"
          image: rhpam-bc-apd:1.2
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              cpu: "{{ businesscentral_cpu_request }}"
              memory: "{{ businesscentral_memory_request }}"
            limits:
              cpu: "{{ businesscentral_cpu_limit }}"
              memory: "{{ businesscentral_memory_limit }}"
          volumeMounts:
          - name: "{{ businesscentral_application_name }}-pvol"
            mountPath: "/opt/eap/standalone/data/kie"
          livenessProbe:
            exec:
              command:
              - "/bin/bash"
              - "-c"
              - "curl --fail --silent -u '{{ kie_admin_user }}:{{ kie_admin_password }}' http://localhost:8080/kie-wb.jsp"
            initialDelaySeconds: 180
            timeoutSeconds: 2
            periodSeconds: 15
          readinessProbe:
            exec:
              command:
              - "/bin/bash"
              - "-c"
              - "curl --fail --silent -u '{{ kie_admin_user }}:{{ kie_admin_password }}' http://localhost:8080/kie-wb.jsp"
            initialDelaySeconds: 60
            timeoutSeconds: 2
            periodSeconds: 30
            failureThreshold: 6
          ports:
          - name: jolokia
            containerPort: 8778
            protocol: TCP
          - name: http
            containerPort: 8080
            protocol: TCP
          - name: https
            containerPort: 8443
            protocol: TCP
          - name: git-ssh
            containerPort: 8001
            protocol: TCP
          env:
          - name: JAVA_MAX_MEM_RATIO
            value: "{{ businesscentral_java_max_mem_ratio }}"
          - name: JAVA_INITIAL_MEM_RATIO
            value: "{{ businesscentral_java_initial_mem_ratio }}"
          - name: GC_MAX_METASPACE_SIZE
            value: "{{ businesscentral_gc_max_metaspace_size }}"
          - name: KIE_ADMIN_USER
            value: "{{ kie_admin_user }}"
          - name: KIE_ADMIN_PWD
            value: "{{ kie_admin_password }}"
          - name: KIE_MBEANS
            value: "{{ kie_mbeans }}"
          - name: KIE_SERVER_CONTROLLER_OPENSHIFT_PREFER_KIESERVER_SERVICE
            value: "{{ kie_server_controller_prefer_kieserver_service }}"
          - name: KIE_SERVER_CONTROLLER_TEMPLATE_CACHE_TTL
            value: "{{ kie_server_controller_template_cache_ttl }}"
          - name: KIE_WORKBENCH_CONTROLLER_OPENSHIFT_ENABLED
            value: "{{ kie_workbench_controller_openshift_enabled }}"
          - name: KIE_SERVER_CONTROLLER_USER
            value: "{{ kieserver_controller_user }}"
          - name: KIE_SERVER_CONTROLLER_PWD
            value: "{{ kieserver_controller_password }}"
          - name: KIE_SERVER_USER
            value: "{{ kieserver_user }}"
          - name: KIE_SERVER_PWD
            value: "{{ kieserver_password }}"
          - name: KIE_MAVEN_USER
            value: "{{ kie_maven_user }}"
          - name: KIE_MAVEN_PWD
            value: "{{ kie_maven_password }}"
          - name: ADMIN_USERNAME
            value: "eapadmin"
          - name: ADMIN_PASSWORD
            value: "eapadmin1!"
          - name: MAVEN_REPOS
            value: "EXTERNAL"
          - name: EXTERNAL_MAVEN_REPO_HOST
            value: "{{ nexus_host }}"
          - name: EXTERNAL_MAVEN_REPO_PORT
            value: "{{ nexus_port }}"
          - name: EXTERNAL_MAVEN_REPO_PATH
            value: "{{ nexus_path }}"
          - name: JAVA_OPTS_APPEND
            value: "{{ businesscentral_java_opts_append }}"
        volumes:
        - name: "{{ businesscentral_application_name }}-pvol"
          persistentVolumeClaim:
            claimName: "{{ businesscentral_pvc_name }}"
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: "{{ businesscentral_pvc_name }}"
    labels:
      application: "{{ app_name }}"
      service: "{{ businesscentral_application_name }}"
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: "{{ businesscentral_pvc_volume_capacity }}"