Kubernetes and container orchestration
Advantages of Kubernetes
Using Kubernetes offers numerous advantages for deploying and managing the OPC Router:
- Scalability: Kubernetes makes it possible to scale the number of OPC Router instances based on current requirements.
- Flexibility: By using containers, different versions and configurations of the OPC Router can be easily managed and deployed.
- Automation: Kubernetes automates many administrative tasks, including deployments, rollbacks, and scaling, which simplifies management and reduces errors.
Helm Chart for OPC Router
The Helm Chart for the OPC Router facilitates the deployment and management of the OPC Router in a Kubernetes cluster. Here are the main features and configuration options:
Deployment:
- Helm Chart: Enables the deployment of the OPC Router on any Kubernetes cluster.
- Multiple configurations: Support for various configuration options to meet specific requirements.
Configuration:
- Global Parameters: Settings such as global Docker image registry and StorageClass.
- Common Parameters: Parameters for customizing the name and service account settings.
- OPC Router Parameters: Configurations for the OPC Router image, environment variables, and project repository.
- MongoDB Parameters: Settings for MongoDB integration, including authentication and redundancy.
Redundancy:
- OPC Router Redundancy: Support for redundancy mode to run a second pod with an OPC Router runtime that becomes active in case of failure of the main pod.
- MongoDB Redundancy: Ability to run multiple MongoDB pods to make the database redundant and increase resilience.
Best Practices
To take full advantage of Kubernetes and Helm Charts, the following best practices should be observed:
Private Repositories:
- Ensure that Git repositories are private to prevent unauthorized access.
- Connect the OPC Router's internal Git system to hosted Git servers such as GitHub, Bitbucket, or Microsoft Azure DevOps.
Secrets Management:
- Secrets and passwords should never be stored in the Git repository.
- The OPC Router always stores secrets in a separate local vault to ensure that they are not versioned.
Regular Updates and Monitoring:
- Regularly update the Kubernetes cluster and Helm charts.
- Monitor the cluster to ensure that all components are functioning and scaling properly.
Practical Implementation
Deployment with Helm Chart:
- Preparation: Ensure that Kubernetes and Helm are installed and configured.
- Add Helm repository: Add the OPC Router Helm repository and update it:
helm repo add opc-router https://opc-router.github.io/helm-charts
helm repo update
- Install OPC Router: Use the following command to install OPC Router:
helm install my-opcrouter opc-router/opc-router --set I_do_accept_the_EULA=true
- Security configuration: Add authentication and security parameters to secure the installation:
helm install my-opcrouter opc-router/opc-router \
--set webManagement.auth.disable=false \
--set webManagement.auth.initialUser.name=<nutzername f??r="" den="" initialen="" web="" management="" nutzer=""> \
--set webManagement.auth.initialUser.password=<passwort f??r="" den="" initialen="" web="" management="" nutzer=""> \
--set mongodb.auth.enabled=true \
--set mongodb.auth.rootPassword=<mongodb root="" passwort=""> \
--set mongodb.auth.replicaSetKey=<mongodb replicaset="" key=""> \
--set I_do_accept_the_EULA=true
Redundancy and scaling:
-
Enable OPC Router redundancy: Configure the OPC Router redundancy mode in the Helm Chart as soon as it is available.
-
MongoDB redundancy: Ensure that MongoDB is running in redundancy mode by increasing the number of pods:
--set mongodb.replicaCount=2
Load project from Git repository:
- Reference the project repository and path in the Helm Chart to load an OPC Router project from a Git repository:
--set project.projectRepo=<url zum="" git="" repository=""> \
--set project.projectPath=<pfad zur="" .rpe="" projektdatei=""> \
--set project.configPath=<pfad zur="" konfigurationsdatei="" des="" projektes=""> \
--set project.auth.ssh_key=<privater ssh="" schl??ssel="">
Summary
Using Kubernetes and Helm Charts provides a powerful and flexible way to run OPC Router in a scalable and manageable environment. By implementing best practices and utilizing configuration options, organizations can maximize the reliability and efficiency of their OPC Router installations.