deployment.toml for Kubernetes¶
You need to create a deployment-config.toml
file and use it as the input to the WSO2 API Microgateway Toolkit in order to create a Docker image to be mounted on Kubernetes by including the runtime executable artifacts, so that you do not have to mount the artifacts from outside. When using this approach, it will generate the Docker images from the WSO2 API Microgateway base image by including all the API runtime artifacts as well.
Sample file¶
[kubernetes]
[kubernetes.kubernetesDeployment]
enable = true
#name = ''
#labels = '{"": ""}'
#replicas = ''
#enableLiveness = ''
#initialDelaySeconds = ''
#periodSeconds = ''
#livenessPort = ''
#imagePullPolicy = ''
#imagePullSecrets = ['']
#image = ''
#env = ''
#buildImage = ''
#cmd = 'CMD gateway ${APP} --b7a.config.file=conf/micro-gw.conf'
[kubernetes.kubernetesDeployment.copyFiles]
enable = false
[[kubernetes.kubernetesDeployment.copyFiles.files]]
source = ''
target = ''
[kubernetes.kubernetesDeployment.livenessProbe]
enable = false
port = ''
initialDelaySeconds = ''
periodSeconds = ''
[kubernetes.kubernetesDeployment.readinessProbe]
enable = false
port = ''
initialDelaySeconds = ''
periodSeconds = ''
#dockerHost = ''
#dockerCertPath = ''
#push = ''
#registry = 'index.docker.io/${DOCKER_USERNAME}'
#username = ''
#password = ''
#baseImage = ''
#singleYAML = ''
[kubernetes.kubernetesService]
enable = true
#name = ''
#labels = '{"": ""}'
serviceType = 'NodePort'
#port = ''
#[kubernetes.kubernetesServiceHttps]
#enable = false
#name = ''
#labels = '{"": ""}'
#serviceType = ''
#port = ''
#[kubernetes.kubernetesServiceHttp]
#enable = false
#name = ''
#labels = '{"": ""}'
#serviceType = ''
#port = ''
#[kubernetes.kubernetesServiceToken]
#enable = false
#name = ''
#labels = '{"": ""}'
#serviceType = ''
#port = ''
[kubernetes.kubernetesIngress]
enable = false
#name = ''
#labels = '{"", ""}'
#hostname = ''
#annotations = ''
#path = ''
#targetPath = ''
#ingressClass = ''
[kubernetes.secureKubernetesIngress]
enable = false
#name = ''
#labels = '{"": ""}'
#hostname = ''
#annotations = ''
#path = ''
#targetPath = ''
#ingressClass = ''
#keyStorePath = '${ballerina.home}/bre/security/ballerinaKeystore.p12'
#keyStorePassword = '$env{Keystore_Password}'
[kubernetes.kubernetesHpa]
enable = false
#name = ''
#labels = '{"": ""}'
#minReplicas = ''
#maxReplicas = ''
#cpuPrecentage = ''
[kubernetes.kubernetesSecret]
enable = false
#[[kubernetes.kubernetesSecret.secrets]]
#name = ''
#mountPath = ''
#readOnly = false
#data = ['']
[kubernetes.kubernetesConfigMap]
enable = true
ballerinaConf = '<MICROGW_TOOLKIT_HOME>/resources/conf/micro-gw.conf'
#[[kubernetes.kubernetesConfigMap.configMaps]]
#name = ''
#mountPath = ''
#data = ['']
#readOnly = false
[kubernetes.kubernetesPersistentVolumeClaim]
enable = false
#name = ''
#mountPath = ''
#readOnly = ''
#accessMode = ''
#volumeClaimSize = ''
Descriptions for the configurations¶
kubernetes.kubernetesDeployment¶
Parameter | Description | Default value |
---|---|---|
|
Name of the deployment. | <outputfilename>-deployment |
|
Namespace of the deployment. | null |
|
The labels related to the particular deployment. | "app: <outputfilename>" |
|
The number of replicas. | 1 |
|
The endpoints that the deployment depends on. | null |
|
Enable or disable the liveness probe. | false |
|
The initial delay in seconds before performing the first probe. | 10s |
|
The time interval between liveness probes in seconds. | 5s |
|
The port checked by the liveness probe. | <ServicePort> |
|
Docker image pull policy. | IfNotPresent |
|
Docker image with tag. | <output file name>:latest |
|
List of environment variables. | null |
|
Enable or disable building the Docker image. | true |
copyFiles |
Copy external files for the Docker image. | null |
dockerHost |
Docker host IP and docker PORT. Example: tcp://192.168.99.100:2376 |
null |
dockerCertPath |
Docker cert path. | null |
push |
Enable or disable pushing the Docker image to the registry. This can only be enabled if buildImage parameter is set to true. |
false |
registry |
Docker registry URL | null |
username |
Username for the Docker registry. | null |
password |
Password for the Docker registry. | null |
baseImage |
Base image to create the Docker image. | ballerina/ballerina:latest |
imagePullSecrets |
Image pull secrets value. | null |
singleYAML |
Enable or disable generating a single YAML file for all k8s resources. | false |
kubernetes.kubernetesService¶
Parameter | Description | Default value |
---|---|---|
name |
Name of the service. | <service name>-service |
labels |
The labels for the service. | "app: <outputfilename>" |
serviceType |
The type of service. | ClusterIP |
port |
The port used by the service. | Port number |
kubernetes.kubernetesIngress¶
Parameter |
Description |
Default value |
---|---|---|
|
Name of the Ingress. |
<service name>-ingress |
|
The labels for the service. |
"app: <outputfilename>" |
|
Host name of the Ingress. |
<service name>.com |
|
Map of additional annotations. |
null |
|
Resource path. |
/ |
|
This URL will be used to rewrite the target URI, which defines where the traffic should be redirected.
|
null |
|
Ingress class. |
nginx |
|
Enable or disable Ingress transport level security (TLS). |
false |
kubernetes.kubernetesHPA¶
Parameter | Description | Default value |
---|---|---|
name |
Name of the Horizontal Pod Autoscaler | <service name>-hpa |
labels |
The labels for the service. | "app: <outputfilename>" |
minReplicas |
The minimum number of replicas in the deployment. | No of replicas in deployment |
maxReplicas |
The maximum number of replicas in the deployment. | minReplicas+1 |
cpuPrecentage |
CPU percentage to start scaling. | 50 |
kubernetes.kubernetesSecret¶
Parameter | Description | Default value |
---|---|---|
name |
Name of the secret mount. | <service_name>-secret |
mountPath |
Path to the mount on the container. | null |
readOnly |
Denotes whether the mount is read-only or not. | true |
data |
Paths to the data files. | null |
kubernetes.kubernetesConfigMap¶
Parameter | Description | Default value |
---|---|---|
name |
Name of the config map mount | <service_name>-config-map |
mountPath |
Path to the mount on the container | null |
readOnly |
Denotes whether the mount is read-only or not. | true |
ballerinaConf |
Location of the Ballerina conf file. | null |
data |
Paths to the data files. | null |
kubernetes.kubernetesPersistentVolumeClaim¶
Parameter | Description | Default value |
---|---|---|
name |
Name of the secret mount. | null |
annotations |
The metadata annotations in the map. | null |
mountPath |
Path to mount on the container. | null |
readOnly |
Denotes whether the mount is read-only or not. | false |
accessMode |
Access mode. | ReadWriteOnce |
volumeClaimSize |
Size of the volume claim. | null |