About Running Mendix on Kubernetes

1
    when I  try  to run Mendix  APP  on Kubernetes  according to  this article  as following:    https://docs.mendix.com/developerportal/deploy/run-mendix-on-kubernetes#1-introduction I am not clear about the following description: mendix-app-secrets.yaml: apiVersion: v1 kind: Secret metadata: name: mendix-app-secrets type: Opaque data: admin-password: YOUR_ADMIN_PASSWORD db-endpoint: YOUR_DATABASE_ENDPOINT license-key: YOUR_LICENSE_KEY license-id: YOUR_LICENSE_ID   postgres-deployment.yaml: apiVersion: apps/v1beta1 kind: Deployment metadata: name: postgres spec: replicas: 1 template: metadata: labels: service: postgres spec: containers: - name: postgres image: postgres:10.1 ports: - containerPort: 5432 env: - name: POSTGRES_DB value: db0 - name: POSTGRES_USER value: mendix - name: POSTGRES_PASSWORD value: mendix volumeMounts: - mountPath: "/var/lib/postgresql/data" name: "mendix-pgdata" volumes: - hostPath: path: "/home/docker/pgdata" name: mendix-pgdata mendix-app-secrets.yaml   Does the attribute value of  db-endpoint in mendix-app-secrets.yaml   have anything to do with the attribute value of env  in postgres-deployment.yaml , or what to do with it, and how to write its attribute value?  Here are the errors I made during deployment        
asked
2 answers
4

Hi there,

The first thing about the secrets file is that every value needs to be a Base64 Encoded version of itself so:

admin-password: MyP@S5W0rd1!

Should be:

admin-password: TXlQQFM1VzByZDEh

The second thing (to address your question about the database endpoint) is that the examples make use of the Mendix docker build pack and the format used for postgres there is:

postgres://username:password@host:port/databaseName

So from the example will be:

postgres://mendix:mendix@postgres-service:5432/db0

I’ve used the name of the postgres service in postgres-service.yaml for the host, I’m not sure if this is correct but it worked for me.

Base64 Encoded:

cG9zdGdyZXM6Ly9tZW5kaXg6bWVuZGl4QHBvc3RncmVzLXNlcnZpY2U6NTQzMi9kYjA=

Hopefully this gets you past your issue.

Additionally, if you are doing this as a local test without a Mendix license key, you can leave license-key and license-id empty:

apiVersion: v1
kind: Secret
metadata:
  name: mendix-app-secrets
type: Opaque
data:
  admin-password: SomePasswordBase64Encoded
  db-endpoint: cG9zdGdyZXM6Ly9tZW5kaXg6bWVuZGl4QHBvc3RncmVzLXNlcnZpY2U6NTQzMi9kYjA=
  license-key:
  license-id:

If you do this you’ll need to run the secret creation without validation:

kubectl create -f mendix-app-secrets.yaml --validate=false

 

answered
1

I have never deployed Mendix this way myself, but it seems to me that you should be putting the ip/port of your database in place of YOUR_DATABASE_ENDPOINT. Though it’s not clear to me (from the documentation) where you would get that info from.

answered