Kubernetes and Container Orchestration
Benefits of Kubernetes
Using Kubernetes offers numerous advantages for deploying and managing the OPC Router:
- Scalability: Kubernetes allows you 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 simplifies the deployment and management of the OPC Router in a Kubernetes cluster. Here are the main features and configuration options:
Deployment:
- Helm Chart: Enables 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 the 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 takes over in the event of a failure of the primary pod.
- **MongoDB Redundancy: Ability to run multiple MongoDB pods to provide database redundancy and increase reliability.
Best Practices
To take full advantage of Kubernetes and Helm Charts, the following best practices should be followed:
Private Repositories:
- Ensure that Git repositories are private to prevent unauthorized access.
- Establishing a connection between the OPC Router’s internal Git system and hosted Git servers such as GitHub, Bitbucket, or Microsoft Azure DevOps.
Secrets Management:
- Secrets and passwords should never be stored in a Git repository.
- The OPC Router always stores secrets in a separate local vault to ensure they are not versioned.
Regular Updates and Monitoring:
- Regularly updating the Kubernetes cluster and Helm charts.
- Monitoring the cluster to ensure that all components are functioning and scaling properly.
Practical Implementation
Deployment with Helm Chart:
-
Prerequisites: Ensure that Kubernetes and Helm are installed and configured
-
Add the 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 -
Installing the OPC Router: Use the following command to install the 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=<initial-web-management-user> \
--set webManagement.auth.initialUser.password=<initial-web-management-password> \
--set mongodb.auth.enabled=true \
--set mongodb.auth.rootPassword=<mongodb-root-password> \
--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 becomes available.
-
MongoDB Redundancy: Ensure that MongoDB is running in redundancy mode by increasing the number of pods:
--set mongodb.replicaCount=2
Load the project from the Git repository:
-
Reference the project repository and the path in the Helm chart to load an OPC Router project from a Git repository:
--set project.projectRepo=<git-repository-url> \
--set project.projectPath=<path-to-rpe-project-file> \
--set project.configPath=<path-to-project-config-file> \
--set project.auth.ssh_key=<private-ssh-key>
Summary
Using Kubernetes and Helm Charts provides a powerful and flexible way to run the OPC Router in a scalable and manageable environment. By implementing best practices and taking advantage of the configuration options, organizations can maximize the reliability and efficiency of their OPC Router installations.