Kubernetes
Automated provisioning and configuration of Kubernetes clusters with DOB Kubernetes Services (DKS).
Commands: dob dks config
, dob dks attach-node
This feature streamlines the automated provisioning and configuration of Kubernetes clusters (DKS - DOB Kubernetes Services) on cloud infrastructure.
Key Highlights:
-
DKS Configuration Command
- Command:
dob dks config --file-path <yaml-config>
- Functionality:
- Provisions and configures Kubernetes master and worker nodes using the provided YAML configuration.
- Generates Kubernetes join tokens for worker nodes automatically.
- Includes a retry mechanism for transient failures during node setup.
- Error Handling:
- Validates configuration files and handles missing or invalid files.
- Provides detailed error messages for provisioning or Kubernetes setup failures.
- Command:
-
Attach New Worker Nodes
- Command:
dob dks attach-node --file-path <yaml-config>
- Functionality:
- Attaches new worker nodes to an existing Kubernetes master node.
- Uses the master node's join token for worker node setup.
- Error Handling:
- Ensures proper detection of the master node before attaching workers.
- Provides clear error feedback for failures during the join process.
- Command:
-
Default Tasks for Master Nodes
- Disabling SELinux and enabling IP forwarding.
- Installing and configuring Docker and Containerd.
- Installing Kubernetes components (kubelet, kubeadm, kubectl) and initializing the master node.
- Deploying Calico as the default network plugin.
-
Default Tasks for Worker Nodes
- Disabling SELinux and enabling IP forwarding.
- Installing Docker, Containerd, and Kubernetes components.
- Automatically joining the worker nodes to the cluster using the join token.
-
Error Handling and Logging
- Comprehensive error handling with retry logic for transient issues.
- Real-time logging of task execution for better visibility and debugging.
Example YAML Configuration:
master:
name: k8s-master
instance_type: t2.medium
key_name: my-ssh-key
security_group: my-security-group
workers:
name: k8s-worker
instance_type: t2.small
key_name: my-ssh-key
security_group: my-security-group
count: 3
Example Usage:
dob dks config --file-path /path/to/config.yaml
dob dks attach-node --file-path /path/to/new-workers-config.yaml