Skip to content

Commit

Permalink
Merge pull request #604 from SanojPunchihewa/4.2.x
Browse files Browse the repository at this point in the history
[420] Add option to define the toml configs via Helm
  • Loading branch information
SanojPunchihewa authored Oct 11, 2023
2 parents 0be4d5a + 1fbc2d6 commit 72f4406
Show file tree
Hide file tree
Showing 16 changed files with 222 additions and 26 deletions.
1 change: 1 addition & 0 deletions advanced/am-pattern-1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ If you do not have an active WSO2 subscription, **do not change** the parameters
| `wso2.deployment.mi.resources.requests.cpu` | The minimum amount of CPU that should be allocated for a Pod | 500m |
| `wso2.deployment.mi.resources.limits.memory` | The maximum amount of memory that should be allocated for a Pod | 1Gi |
| `wso2.deployment.mi.resources.limits.cpu` | The maximum amount of CPU that should be allocated for a Pod | 1000m |
| `wso2.deployment.mi.config` | Custom deployment configuration file (`<WSO2MI>/conf/deployment.toml`) | - |
| `wso2.deployment.mi.ingress.management.hostname` | Hostname for Micro Integrator management apis | `management.mi.wso2.com` |
| `wso2.deployment.mi.ingress.management.annotations` | Ingress resource annotations for API Manager Gateway | Community NGINX Ingress controller annotations |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.wso2.deployment.mi.config }}
# Copyright (c) 2023, WSO2 LLC (https://www.wso2.com) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "am-pattern-1.resource.prefix" . }}-mi-1-conf
namespace: {{ .Release.Namespace }}
data:
{{- range $index, $content := .Values.wso2.deployment.mi.config }}
{{ $index }}: |-
{{ tpl $content $ | indent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ spec:
node: {{ template "am-pattern-1.resource.prefix" . }}-mi-1
template:
metadata:
{{- if .Values.wso2.deployment.mi.config }}
annotations:
checksum.mi.conf: {{ include (print $.Template.BasePath "/mi/instance-1/wso2am-pattern-1-mi-conf.yaml") . | sha256sum }}
{{- end }}
labels:
deployment: {{ template "am-pattern-1.resource.prefix" . }}-mi
node: {{ template "am-pattern-1.resource.prefix" . }}-mi-1
Expand Down Expand Up @@ -89,6 +93,12 @@ spec:
value: {{ $val | quote }}
{{- end }}
{{- end }}
{{- if .Values.wso2.deployment.mi.config }}
volumeMounts:
- name: wso2mi-conf
mountPath: /home/wso2carbon/wso2-config-volume/conf/deployment.toml
subPath: deployment.toml
{{- end }}
serviceAccountName: {{ .Values.kubernetes.serviceAccount }}
{{- if .Values.wso2.deployment.mi.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -97,3 +107,9 @@ spec:
imagePullSecrets:
- name: {{ template "am-pattern-1.resource.prefix" . }}-mi-1-wso2-private-registry-creds
{{ end }}
{{- if .Values.wso2.deployment.mi.config }}
volumes:
- name: wso2mi-conf
configMap:
name: {{ template "am-pattern-1.resource.prefix" . }}-mi-1-conf
{{ end }}
6 changes: 6 additions & 0 deletions advanced/am-pattern-1/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ wso2:
# Environment variables for the Micro integrator deployment.
envs:
# ENV_NAME: ENV_VALUE

# Add the customized deployment configurations for the WSO2 MI v4.2.0 (<WSO2MI>/conf/deployment.toml)
# config:
# deployment.toml: |-
# # toml configurations for the WSO2 MI v4.2.0

# Configure synapse testing.
synapseTest:
enabled: false
Expand Down
1 change: 1 addition & 0 deletions advanced/am-pattern-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ If you do not have an active WSO2 subscription, **do not change** the parameters
| `wso2.deployment.mi.resources.requests.cpu` | The minimum amount of CPU that should be allocated for a Pod | 500m |
| `wso2.deployment.mi.resources.limits.memory` | The maximum amount of memory that should be allocated for a Pod | 1Gi |
| `wso2.deployment.mi.resources.limits.cpu` | The maximum amount of CPU that should be allocated for a Pod | 1000m |
| `wso2.deployment.mi.config` | Custom deployment configuration file (`<WSO2MI>/conf/deployment.toml`) | - |
| `wso2.deployment.mi.ingress.management.hostname` | Hostname for Micro Integrator management apis | `management.mi.wso2.com` |
| `wso2.deployment.mi.ingress.management.annotations` | Ingress resource annotations for API Manager Gateway | Community NGINX Ingress controller annotations |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.wso2.deployment.mi.config }}
# Copyright (c) 2023, WSO2 LLC (https://www.wso2.com) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "am-pattern-2.resource.prefix" . }}-mi-2-conf
namespace: {{ .Release.Namespace }}
data:
{{- range $index, $content := .Values.wso2.deployment.mi.config }}
{{ $index }}: |-
{{ tpl $content $ | indent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ spec:
node: {{ template "am-pattern-2.resource.prefix" . }}-mi-2
template:
metadata:
{{- if .Values.wso2.deployment.mi.config }}
annotations:
checksum.mi.conf: {{ include (print $.Template.BasePath "/mi/instance-2/wso2am-pattern-2-mi-conf.yaml") . | sha256sum }}
{{- end }}
labels:
deployment: {{ template "am-pattern-2.resource.prefix" . }}-mi
node: {{ template "am-pattern-2.resource.prefix" . }}-mi-2
Expand Down Expand Up @@ -89,6 +93,12 @@ spec:
value: {{ $val | quote }}
{{- end }}
{{- end }}
{{- if .Values.wso2.deployment.mi.config }}
volumeMounts:
- name: wso2mi-conf
mountPath: /home/wso2carbon/wso2-config-volume/conf/deployment.toml
subPath: deployment.toml
{{- end }}
serviceAccountName: {{ .Values.kubernetes.serviceAccount }}
{{- if .Values.wso2.deployment.mi.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -97,3 +107,9 @@ spec:
imagePullSecrets:
- name: {{ template "am-pattern-2.resource.prefix" . }}-mi-2-wso2-private-registry-creds
{{ end }}
{{- if .Values.wso2.deployment.mi.config }}
volumes:
- name: wso2mi-conf
configMap:
name: {{ template "am-pattern-2.resource.prefix" . }}-mi-2-conf
{{ end }}
6 changes: 6 additions & 0 deletions advanced/am-pattern-2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ wso2:
# Environment variables for the Micro integrator deployment.
envs:
# ENV_NAME: ENV_VALUE

# Add the customized deployment configurations for the WSO2 MI v4.2.0 (<WSO2MI>/conf/deployment.toml)
# config:
# deployment.toml: |-
# # toml configurations for the WSO2 MI v4.2.0

# Configure synapse testing.
synapseTest:
enabled: false
Expand Down
1 change: 1 addition & 0 deletions advanced/am-pattern-3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ If you do not have an active WSO2 subscription, **do not change** the parameters
| `wso2.deployment.mi.resources.requests.cpu` | The minimum amount of CPU that should be allocated for a Pod | 500m |
| `wso2.deployment.mi.resources.limits.memory` | The maximum amount of memory that should be allocated for a Pod | 1Gi |
| `wso2.deployment.mi.resources.limits.cpu` | The maximum amount of CPU that should be allocated for a Pod | 1000m |
| `wso2.deployment.mi.config` | Custom deployment configuration file (`<WSO2MI>/conf/deployment.toml`) | - |
| `wso2.deployment.mi.ingress.management.hostname` | Hostname for Micro Integrator management apis | `management.mi.wso2.com` |
| `wso2.deployment.mi.ingress.management.annotations` | Ingress resource annotations for API Manager Gateway | Community NGINX Ingress controller annotations |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.wso2.deployment.mi.config }}
# Copyright (c) 2023, WSO2 LLC (https://www.wso2.com) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "am-pattern-3.resource.prefix" . }}-mi-1-conf
namespace: {{ .Release.Namespace }}
data:
{{- range $index, $content := .Values.wso2.deployment.mi.config }}
{{ $index }}: |-
{{ tpl $content $ | indent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ spec:
node: {{ template "am-pattern-3.resource.prefix" . }}-mi-1
template:
metadata:
{{- if .Values.wso2.deployment.mi.config }}
annotations:
checksum.mi.conf: {{ include (print $.Template.BasePath "/mi/instance-1/wso2am-pattern-3-mi-conf.yaml") . | sha256sum }}
{{- end }}
labels:
deployment: {{ template "am-pattern-3.resource.prefix" . }}-mi
node: {{ template "am-pattern-3.resource.prefix" . }}-mi-1
Expand Down Expand Up @@ -100,6 +104,12 @@ spec:
value: {{ $val | quote }}
{{- end }}
{{- end }}
{{- if .Values.wso2.deployment.mi.config }}
volumeMounts:
- name: wso2mi-conf
mountPath: /home/wso2carbon/wso2-config-volume/conf/deployment.toml
subPath: deployment.toml
{{- end }}
serviceAccountName: {{ .Values.kubernetes.serviceAccount }}
{{- if .Values.wso2.deployment.mi.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -108,3 +118,9 @@ spec:
imagePullSecrets:
- name: {{ template "am-pattern-3.resource.prefix" . }}-mi-1-wso2-private-registry-creds
{{ end }}
{{- if .Values.wso2.deployment.mi.config }}
volumes:
- name: wso2mi-conf
configMap:
name: {{ template "am-pattern-3.resource.prefix" . }}-mi-1-conf
{{ end }}
12 changes: 9 additions & 3 deletions advanced/am-pattern-3/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ wso2:
subscription:
username: ""
password: ""

# WSO2 Choreo Analytics Parameters
# If provided, these parameters will be used publish analytics data to Choreo Analytics environment (https://apim.docs.wso2.com/en/latest/observe/api-manager-analytics/configure-analytics/register-for-analytics/).
choreoAnalytics:
Expand Down Expand Up @@ -164,7 +164,7 @@ wso2:

# API Manager's Control Plane specific configurations
cp:
db:
db:
hostname: wso2am-mysql-db-service
port: 3306
type: mysql
Expand All @@ -174,7 +174,7 @@ wso2:
username: wso2carbon
password: wso2carbon
url: jdbc:mysql://wso2am-mysql-db-service:3306/WSO2AM_DB?useSSL=false&amp;autoReconnect=true&amp;requireSSL=false&amp;verifyServerCertificate=false
apim_shared:
apim_shared:
username: wso2carbon
password: wso2carbon
url: jdbc:mysql://wso2am-mysql-db-service:3306/WSO2AM_SHARED_DB?useSSL=false&amp;autoReconnect=true&amp;requireSSL=false&amp;verifyServerCertificate=false
Expand Down Expand Up @@ -287,6 +287,12 @@ wso2:
# Environment variables for the Micro integrator deployment.
envs:
# ENV_NAME: ENV_VALUE

# Add the customized deployment configurations for the WSO2 MI v4.2.0 (<WSO2MI>/conf/deployment.toml)
# config:
# deployment.toml: |-
# # toml configurations for the WSO2 MI v4.2.0

# Configure synapse testing.
synapseTest:
enabled: false
Expand Down
1 change: 1 addition & 0 deletions advanced/am-pattern-4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ If you do not have an active WSO2 subscription, **do not change** the parameters
| `wso2.deployment.mi.resources.requests.cpu` | The minimum amount of CPU that should be allocated for a Pod | 500m |
| `wso2.deployment.mi.resources.limits.memory` | The maximum amount of memory that should be allocated for a Pod | 1Gi |
| `wso2.deployment.mi.resources.limits.cpu` | The maximum amount of CPU that should be allocated for a Pod | 1000m |
| `wso2.deployment.mi.config` | Custom deployment configuration file (`<WSO2MI>/conf/deployment.toml`) | - |
| `wso2.deployment.mi.ingress.management.hostname` | Hostname for Micro Integrator management apis | `management.mi.wso2.com` |
| `wso2.deployment.mi.ingress.management.annotations` | Ingress resource annotations for API Manager Gateway | Community NGINX Ingress controller annotations |
Expand Down
26 changes: 26 additions & 0 deletions advanced/am-pattern-4/templates/mi/wso2am-pattern-4-mi-conf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.wso2.deployment.mi.config }}
# Copyright (c) 2023, WSO2 LLC (https://www.wso2.com) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "am-pattern-4.resource.prefix" . }}-mi-conf
namespace: {{ .Release.Namespace }}
data:
{{- range $index, $content := .Values.wso2.deployment.mi.config }}
{{ $index }}: |-
{{ tpl $content $ | indent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ spec:
node: {{ template "am-pattern-4.resource.prefix" . }}-mi
template:
metadata:
{{- if .Values.wso2.deployment.mi.config }}
annotations:
checksum.mi.conf: {{ include (print $.Template.BasePath "/mi/wso2am-pattern-4-mi-conf.yaml") . | sha256sum }}
{{- end }}
labels:
deployment: {{ template "am-pattern-4.resource.prefix" . }}-mi
node: {{ template "am-pattern-4.resource.prefix" . }}-mi
Expand Down Expand Up @@ -100,6 +104,12 @@ spec:
value: {{ $val | quote }}
{{- end }}
{{- end }}
{{- if .Values.wso2.deployment.mi.config }}
volumeMounts:
- name: wso2mi-conf
mountPath: /home/wso2carbon/wso2-config-volume/conf/deployment.toml
subPath: deployment.toml
{{- end }}
serviceAccountName: {{ .Values.kubernetes.serviceAccount }}
{{- if .Values.wso2.deployment.mi.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -108,3 +118,9 @@ spec:
imagePullSecrets:
- name: {{ template "am-pattern-4.resource.prefix" . }}-mi-wso2-private-registry-creds
{{ end }}
{{- if .Values.wso2.deployment.mi.config }}
volumes:
- name: wso2mi-conf
configMap:
name: {{ template "am-pattern-4.resource.prefix" . }}-mi-conf
{{ end }}
Loading

0 comments on commit 72f4406

Please sign in to comment.