Clustermangement on PLCnext?


A standard in IT for years, it has not yet made much of an impact in industry. Often such technologies are seen as
too complex and unnecessary. The question that arises is, do they bring us advantages?

A vision for PLCnext using the example of Kubernetes.




Kubernete is an orchestrator (management system, master) which uses, among other things, containers and thus forms a network via various devices. The system is used to provide applications in a slightly different way.

Classically applications would be distributed and maintained on devices. It is known on which computer the application runs. If an application should run on another computer this must be done by a person. If one of the computers fails, all applications of the computer are no longer available.

With Kubernetes, the master is given a state description of the application, and the master takes care of the rest. It ensures that the requested state is maintained at all times. However, it is not known on which node the application is currently running, but it is accessible in principle.


Questions and answers


What deplores condition description

How to install the cluster

How to perform updates of applications

What happens if a node fails

What happens if the master fails

Certain applications need to run on certain nodes because access to the hardware is needed.

 Kubernetes architecture



Example of a state description of an application that consists of three containers (frontend, backend, database).





# Kind of the Deployment
kind: Deployment
apiVersion: apps/v1
  name: MyApplicationName
    app: MyApplication
    MyApplication: MyApplicationName
    namespace: default

## Container specs

## Container spec for Frontend
## Name for the Container
      - name: MyContainer-frontend

## Container Image to use      
        image: MyApplicationImage_frontend

## Ports for the frontend, http        
        - containerPort: 80

## Container spec for Backend      
      - name: MyContainerName-backend
        image: MyApplicationImage_backend
        - containerPort: 3000

## Container spec for mongodb          
      - name: MyContainerName-mongo
        image: mongo:3.4

## Startup commands for Mongo DB
        - "mongod"
        - "--bind_ip"
        - ""
        - containerPort: 27017    
## Service declaration, expose Ports to the kubernetes api (only internal rechable)

apiVersion: v1
kind: Service
  name: MyApplicationName
  - name: frontend
    targetPort: 80
    port: 80
  - name: backend
    targetPort: 3000
    port: 3000
    app: MyApplication
    task: MyApplicationName     

## Ingress declaration, bind proxy to fronted and backend

kind: Ingress

## Bind ingress to traefik service proxy

  annotations: traefik

## Ingress class for frontend, map dns ingress to service port 80 
  - host:
      - path: /
          servicePort: frontend

## Ingress class for backend, map dns ingress to service port 3000          
  - host:
      - path: /api
          servicePort: backend

Take a look