Centiloc Service Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Development Setup with kind

Kind (Kubernetes IN Docker) is a tool designed for creating and managing Kubernetes clusters. It is particularly well-suited for development and testing environments but is not suitable for production use. Kind allows you to run Kubernetes clusters as Docker containers on your local machine. Keep in mind that, like other Kubernetes clusters, kind clusters do require a certain amount of system resources, including RAM, to operate effectively.

Installing kind

Installation instructions for kind vary depending on your machine. Please consult the kind documentation for guidance on how to install kind.

Starting your cluster

In order to manage incoming traffic you have to specify a kind configuration file when creating a cluster.

The development setup outlined here exclusively caters to plain TCP incoming traffic. In this context, there is no security concern. This configuration MUST NOT be utilized in a production environment.

You can use the following command kind create cluster --config kind-config.yaml, where kind-config.yaml file content is described below:

## creates a cluster with a worker and a master node
# use: kind create cluster --config kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
  extraPortMappings:
  # this may be useful to reach API and centui in clear
  - containerPort: 30180
    hostPort: 80
    listenAddress: "0.0.0.0"
  # this port allows board simulation to join the cluster in clear
  - containerPort: 30881
    hostPort: 1883
    listenAddress: "0.0.0.0"

Disable Kafka

As mentioned in the Infrastructure Recommandations table, when working in a development setup based on kind, you should consider disabling Kafka. To do so, you need to customize your myvalues.yaml file as follows:

global:
  configuration:
    streamTech: "REDIS"

kafka:
  enabled: false

Disable PostgreSQL Persistency

As mentionned in the Infrastructure Recommandations table, when working in a development setup based on kind, it is advised to disable PostgreSQL persistency. To do, you need to customize your myvalues.yaml file as follows:

postgresql:
  enabled: true
  ## You should define your own strong password for the "postgres" admin user
  auth:
    postgresPassword: "very_strong_password"
  storagePath: ""
  primary:
    user: "custom_user"
    password: "custom_password"
    dbname: "db_geocore"
    persistence:
      enabled: false

This enables PostgreSQL, but:

  • storagePath="" : avoids creating PersistentVolume and PersistentVolumeClaim
  • primary.persistence.enabled=false: allows creating PostgreSQL instance without waiting for PersistentVolumeClaim

Disable NTP

In a development environment, you should disable the NTP server.

If you are using WiFi boards, ensure that the WiFi network has internet access, as it is required for the board to connect to a public NTP server over the internet.

To achieve this, you should customize your myvalues.yaml as follows:

ntp:
  enabled: false

Disable Keycloak

As previously outlined in the Identification section, Geocore relies on Keycloak for authentication and authorization. However, when working in a development environment, it’s recommended to disable Keycloak. To do so, please customize your myvalues.yaml with the following configuration:

global:
  keycloak:
    url: ""
The current Geocore OnPremise version does not include Keycloak.

MQTT NodePort Configuration

For a development setup using kind, configure your Geocore deployment to use the MQTT broker service as a NodePort. To achieve this, you should customize your myvalues.yaml as follows:

emqx:
  enabled: true
  replicaCount: 1
  ## Update the line below and define your own strong password MQTT broker strong password
  allPassword: "very_strong_password"
  service:
    type: NodePort
    nodePorts:
      mqttssl: 30883
      mqtt: 30881
  emqxConfig:
    ## Allow plain TCP communication by default
    EMQX_LISTENERS__TCP__DEFAULT__ENABLE: "true"
    ## If you want to disable plain TCP communication, comment the line above
    ## And uncomment the line below (substitute "X.X.X.X" with the IP address of the k0s single machine)
    #EMQX_SSL_CLIENT_OPTS__SERVER_NAME_INDICATION: "X.X.X.X"

API and Centui Configuration

As mentioned earlier, the development setup described here involves handling plain TCP incoming traffic. To configure this, please update your myvalues.yaml with the following content:

front:
  apiGeo:
    tlsEnabled: false
  centui:
    tlsEnabled: false
    apiURL: "api.local.centiloc.com"        # Update this value as you wish
    centuiURL: "centui.local.centiloc.com"  # Update this value as you wish 

Install Geocore

Now that your myvalues.yaml file is appropriately configured for a development setup, you can proceed with the Geocore installation using the following command:

helm install my-geocore-release centiloc/geocore --namespace geocore --create-namespace -f myvalues.yaml 

Please find below the complete content of myvalues.yaml

global:
  imageCredentials:
    registry: harbor.centiloc.com
    email: <your-email>
    password: <your-password>
    username: <your-usename>    
  configuration:
    streamTech: "REDIS"
  keycloak:
    url: ""

  ## connection to the database
  postgresql:
    primary:
      user: "custom_user"
      password: "custom_password"
      dbname: "db_geocore"

postgresql:
  enabled: true
  ## You should define your own strong password for the "postgres" admin user
  auth:
    postgresPassword: "very_strong_password"
  storagePath: ""
  primary:
    persistence:
      enabled: false

emqx:
  enabled: true
  replicaCount: 1
  ## Update the line below and define your own strong password MQTT broker strong password
  allPassword: "very_strong_password"
  service:
    type: NodePort
    nodePorts:
      mqttssl: 30883
      mqtt: 30881
  emqxConfig:
    ## Allow plain TCP communication by default
    EMQX_LISTENERS__TCP__DEFAULT__ENABLE: "true"
    ## If you want to disable plain TCP communication, comment the line above
    ## And uncomment the line below (substitute "X.X.X.X" with the IP address of the k0s single machine)
    #EMQX_SSL_CLIENT_OPTS__SERVER_NAME_INDICATION: "X.X.X.X"

kafka:
  enabled: false

ntp:
  enabled: false

front:
  apiGeo:
    tlsEnabled: false
  centui:
    tlsEnabled: false
    apiURL: "api.local.centiloc.com"        # Update this value as you wish
    centuiURL: "centui.local.centiloc.com"  # Update this value as you wish

transtream:
  collect:
    extraEnv:
      MOVE_TOPIC_IN_PREFIX: item.move.

parcontrolv3:
  gwagent:
    extraEnv:
      REFRESH_INTERVAL_S: 2

Ingress

As mentionned in Managing Incoming Traffic section, it is crucial to ensure that your chosen Ingress Controller supports Geocore’s specific protocols, including HTTP1.1, HTTP2, UDP, TCP, and the gRPC-Web format. If you have not yet installed an Ingress Controller in your infrastructure, we strongly recommend utilizing the Contour Ingress Controller for a smooth Geocore deployment.

Installing Contour as a NodePort

To install Contour as a NodePort, please refer to the comprehensive instructions in Ingress With Contour section. The following response indicates that contour has been installed properly as a NodePort after executing your command:

NAME: contour
LAST DEPLOYED: Fri Nov 24 13:59:45 2023
NAMESPACE: contour
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: contour
CHART VERSION: 13.1.0
APP VERSION: 1.26.0

** Please be patient while the chart is being deployed **
1. Contour has been started. You can find out the port numbers being used by Contour by running:

          $ kubectl describe svc contour --namespace contour

2. Configure DNS records corresponding to Kubernetes ingress resources to point to the NODE_IP/NODE_HOST

Installing Gecore Ingress Contour

Now that Geocore and Contour are installed, you still need to add Ingress rules to properly route incoming traffic to containerized applications. For this purpose, the Geocore Ingress Contour chart will help you to quickly create ingress rules using Helm.

To create the ingress rules required, please use the following command:

helm install geocore-ingress-contour centiloc/geocore-ingress-contour -n geocore -f kindValues.yaml

Where kindValues.yaml content is:

certmanager:
  enabled: false

tlsEnabled: false

api:
  domain: api.local.centiloc.com

centui:
  domain: centui.local.centiloc.com

The following response indicates that Geocore Ingress Contour has been successfully deployed:

NAME: geocore-ingress-contour
LAST DEPLOYED: Fri Nov 24 14:02:28 2023
NAMESPACE: geocore
STATUS: deployed
REVISION: 1
TEST SUITE: None
It is mandatory to ensure FQDN consistency between the values used for apiURL, and centuiURL when deploying Geocore, and the values used for api.domain and centui.domain when deploying ingress rules.

Add entries in local DNS

To enable incoming traffic routing within the kind cluster, it’s essential to add entries for the FQDNs of the Geocore API and Centui.

In Windows 10 the hosts file is located at C:\Windows\System32\Drivers\etc\hosts. You might need to configure Windows to show your hidden program or System Files. Ensure that you edit the file as Administrator and add a line to the bottom of the file:

# Added entries for Geocore development setup (kind)
127.0.0.1 api.local.centiloc.com
127.0.0.1 centui.local.centiloc.com

Add the following lines in /etc/host:

# Added entries for Geocore development setup (kind)
127.0.0.1 api.local.centiloc.com
127.0.0.1 centui.local.centiloc.com

Add the following lines in /etc/host:

# Added entries for Geocore development setup (kind)
127.0.0.1 api.local.centiloc.com
127.0.0.1 centui.local.centiloc.com

You are now set to enjoy your Geocore development environment !

In case you can’t open Centui in your browser, first check please Troubleshooting page.

Uninstalling kind

To uninstall your kind development setup, you can use the following command:

kind delete cluster