Skip to main content

Azure Kubernetes Service

Set up an Azure Kubernetes Service to deploy Timbr. You can use your curent AKS, or create a new one with the default settings.

After we have an Azure Kubernetes Service to deploy the Timbr containers, we can create the namespace with a YAML file containing the following:

apiVersion: v1
kind: Namespace
metadata:
name: <namespace name>

Verify the deployment process by clicking on Namespaces:

As you can see there are 4 generated namespaces and the newly created one. After the new Namespace is created and the status is Active we can proceed to deploy the MySQL server by creating a YAML file with the following infromation:

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: <MySQL app name>
namespace: <timbr namespace name>
spec:
selector:
matchLabels:
app: <MySQL app name>
serviceName: "<MySQL service name>"
replicas: 1
template:
metadata:
labels:
app: <app name>
spec:
terminationGracePeriodSeconds: 10
containers:
- image: <container registry domain>/timbr-mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: <root password for MySQL>
args:
- "--ignore-db-dir=lost+found"
imagePullPolicy: Always
name: <MySQL container name>
ports:
- containerPort: 3306
protocol: TCP
volumeMounts:
- mountPath: /var/lib/mysql/
subPath: mysql
name: <volume claim template name>
imagePullSecrets:
- name: <timbr container registry credentials>
volumeClaimTemplates:
- metadata:
name: <volume claim template name>
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 30Gi
---
apiVersion: v1
kind: Service
metadata:
name: <MySQL service name>
namespace: <timbr namespace name>
spec:
selector:
app: <MySQL app name>
ports:
- name: <MySQL container port name>
port: 3306
protocol: TCP
targetPort: 3306

To verify the deployment process click on Workloads -> Stateful sets:

Now click on the MySQL deployment and make sure that the pod is running:

If there are any errors, you can view them by clicking on the “Events” in the left sidebar.

More than that, we can validate the service of the MySQL by clicking on “Services and ingresses -> Services”:

We can see the Cluster IP of this service this is the IP address of the MySQL server.

After that we need to deploy the timbr environment with this YAML:

apiVersion: apps/v1
kind: Deployment
metadata:
name: <timbr platform and server app name>
namespace: <timbr namespace name>
spec:
replicas: 1
selector:
matchLabels:
app: <timbr platform and server app name>
template:
metadata:
labels:
app: <timbr platform and server app name>
spec:
containers:
- name: <timbr server container name>
image: <container registry domain>/timbr-server-stable:latest
ports:
- containerPort: 11000
protocol: TCP
env:
- name: TIMBR_DB_JDBC
value: jdbc:mysql://<MySQL service name>:3306
- name: TIMBR_DB_JDBC_DRIVER
value: com.mysql.jdbc.Driver
- name: TIMBR_DB_JDBC_PARAMS
value: useSSL=true
- name: GRAPH_ALGORITHM_MANAGER_URL
value: http://40.121.143.64:12000/execute_algorithm
- name: <timbr platform container name>
image: <container registry domain>/timbr-platform-staging:latest
ports:
- containerPort: 8088
protocol: TCP
env:
- name: DB_CONNECTION
value: mysql
- name: DB_HOST
value: <MySQL service ip>
- name: DB_PORT
value: '3306'
- name: DB_DATABASE
value: timbr_platform?ssl=true
- name: DB_USERNAME
value: <db username of mysql>
- name: DB_PASSWORD
value: <db password of mysql>
- name: SQLLAB_LIMIT
value: '1000'
- name: FLASK_ENV
value: production
- name: MASTER_DATA_GIT_REPOSITORY
value: <git repository URL >
- name: MASTER_DATA_ROOT
value: <folder path to manage master data directory>
- name: MASTER_DATA_BASE_DIR
value: <folder path to base dir of master data management>
imagePullSecrets:
- name: <timbr container registry credentials>
---
apiVersion: v1
kind: Service
metadata:
name: <timbr platform and server service name>
namespace: <timbr namespace name>
spec:
type: LoadBalancer
loadBalancerIP: <enter specific IP address or leave it empty and it will be generated>
selector:
app: <timbr platform and server app name>
ports:
- name: <timbr server container port name>
protocol: TCP
port: 11000
targetPort: 11000
- name: <timbr platform container port name>
protocol: TCP
port: 8088
targetPort: 8088

We can track the deployment process at “Deployments” section under “Workloads”: As you can see there are 5 generated deployments and the newly created one: “timbr-server-and-platform”.

Now click on “timbr-server-and-platform” deployment and check if the pod is running:

More than that, we can validate the service of the timbr server and the timbr platform by clicking on “Services and ingresses -> Services”:

Here we can see information for our service: 1. External IP – the IP address of the timbr server and the timbr platform. 2. Ports – the logical port where the container is listening on.

To access our application we need to know our port number, which it’s combination with the External IP will give you access to the application. We can get it by clicking on “timbr-server-and-platform-service” and check the port of each container:

For example, the address: 20.88.168.235:8088 will display the timbr application.
the AKS is on air we need to create the namespace with YAML:

apiVersion: v1
kind: Namespace
metadata:
name: <namespace name>
To verify the deployment process click on “Namespaces”:

As you can see there are 4 generated namespaces and the newly created one. After the new Namespace is created and the status is “Active” we can proceed.

Now we need to deploy the MySQL server with this YAML:

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: <MySQL app name>
namespace: <timbr namespace name>
spec:
selector:
matchLabels:
app: <MySQL app name>
serviceName: "<MySQL service name>"
replicas: 1
template:
metadata:
labels:
app: <app name>
spec:
terminationGracePeriodSeconds: 10
containers:
- image: <container registry domain>/timbr-mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: <root password for MySQL>
args:
- "--ignore-db-dir=lost+found"
imagePullPolicy: Always
name: <MySQL container name>
ports:
- containerPort: 3306
protocol: TCP
volumeMounts:
- mountPath: /var/lib/mysql/
subPath: mysql
name: <volume claim template name>
imagePullSecrets:
- name: <timbr container registry credentials>
volumeClaimTemplates:
- metadata:
name: <volume claim template name>
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 30Gi
---
apiVersion: v1
kind: Service
metadata:
name: <MySQL service name>
namespace: <timbr namespace name>
spec:
#clusterIP: None
clusterIP: 10.0.211.178
selector:
app: <MySQL app name>
ports:
- name: <MySQL container port name>
port: 3306
protocol: TCP
targetPort: 3306

To verify the deployment process click on “Workloads -> Stateful sets”:

Now click on the MySQL deployment and make sure that the pod is running:

If there are any errors, you can view them by clicking on the “Events” in the left sidebar.

More than that, we can validate the service of the MySQL by clicking on “Services and ingresses -> Services”:

We can see the Cluster IP of this service this is the IP address of the MySQL server. After that we need to deploy the timbr environment with this YAML:

apiVersion: apps/v1
kind: Deployment
metadata:
name: <timbr platform and server app name>
namespace: <timbr namespace name>
spec:
replicas: 1
selector:
matchLabels:
app: <timbr platform and server app name>
template:
metadata:
labels:
app: <timbr platform and server app name>
spec:
containers:
- name: <timbr server container name>
image: <container registry domain>/timbr-server-stable:latest
ports:
- containerPort: 11000
protocol: TCP
env:
- name: TIMBR_DB_JDBC
value: jdbc:mysql://<MySQL service name>:3306
- name: TIMBR_DB_JDBC_DRIVER
value: com.mysql.jdbc.Driver
- name: TIMBR_DB_JDBC_PARAMS
value: useSSL=true
- name: GRAPH_ALGORITHM_MANAGER_URL
value: http://40.121.143.64:12000/execute_algorithm
- name: <timbr platform container name>
image: <container registry domain>/timbr-platform-staging:latest
ports:
- containerPort: 8088
protocol: TCP
env:
- name: DB_CONNECTION
value: mysql
- name: DB_HOST
value: <MySQL service ip>
- name: DB_PORT
value: '3306'
- name: DB_DATABASE
value: timbr_platform?ssl=true
- name: DB_USERNAME
value: <db username of mysql>
- name: DB_PASSWORD
value: <db password of mysql>
- name: SQLLAB_LIMIT
value: '1000'
- name: FLASK_ENV
value: production
- name: MASTER_DATA_GIT_REPOSITORY
value: <git repository URL>
- name: MASTER_DATA_ROOT
value: <folder path to manage master data directory>
- name: MASTER_DATA_BASE_DIR
value: <folder path to base dir of master data management>
imagePullSecrets:
- name: <timbr container registry credentials>
---
apiVersion: v1
kind: Service
metadata:
name: <timbr platform and server service name>
namespace: <timbr namespace name>
spec:
type: LoadBalancer
loadBalancerIP: <enter specific IP address or leave it empty and it will be generated>
selector:
app: <timbr platform and server app name>
ports:
- name: <timbr server container port name>
protocol: TCP
port: 11000
targetPort: 11000
- name: <timbr platform container port name>
protocol: TCP
port: 8088
targetPort: 8088

We can track the deployment process at “Deployments” section under “Workloads”: As you can see there are 5 generated deployments and the newly created one: “timbr-server-and-platform”.

Now click on “timbr-server-and-platform” deployment and check if the pod is running:

More than that, we can validate the service of the timbr server and the timbr platform by clicking on “Services and ingresses -> Services”:

Here we can see information for our service: 1. External IP – the IP address of the timbr server and the timbr platform. 2. Ports – the logical port where the container is listening on.

To access our application we need to know our port number, which it’s combination with the External IP will give you access to the application. We can get it by clicking on “timbr-server-and-platform-service” and check the port of each container:

For example, the address: 20.88.168.235:8088 will display the timbr application.