diff --git a/Scripts/Deploy-Kubernetes-Kubespray.ps1 b/Scripts/Deploy-Kubernetes-Kubespray.ps1 index 07c5182..2f534da 100644 --- a/Scripts/Deploy-Kubernetes-Kubespray.ps1 +++ b/Scripts/Deploy-Kubernetes-Kubespray.ps1 @@ -7,10 +7,6 @@ $joinedServers = $servers -join ' ' clusrun /nodes:$($servers[0]) "git clone https://github.com/Azure/hpcpack.git && cd hpcpack && git checkout tianyiliu/deploy-Kubernetes-script && chmod +x Scripts/Deploy-Kubernetes.sh" clusrun /nodes:$($servers[0]) "hpcpack/Scripts/Deploy-Kubernetes.sh -p '$password' $joinedServers" -try { - New-HpcGroup -Name "Kubernetes" -} catch { - write-host "Group Kubernetes already exists" -} +New-HpcGroup -Name "Kubernetes" -ErrorAction SilentlyContinue Add-HpcGroup -Name "Kubernetes" -NodeName $servers diff --git a/Scripts/Kubernetes-Integration.md b/Scripts/Kubernetes-Integration.md index c04261c..7bb5ea6 100644 --- a/Scripts/Kubernetes-Integration.md +++ b/Scripts/Kubernetes-Integration.md @@ -16,7 +16,7 @@ Replace `{password}` with your password and `{servers}` with your node names sep |------------|---------------------------------|--------------------------------| | **Deployment** | Uses [Kubespray](https://github.com/kubernetes-sigs/kubespray) to deploy a Kubernetes cluster, providing flexibility to modify the script and install plugins. | Uses [kubeadm](https://github.com/kubernetes/kubeadm) to deploy a Kubernetes cluster, which does not support customization. | | **Output** | Runs a shell within a `clusrun` command, so there will be no output until the whole shell script completes. | Provides output as soon as a single `clusrun` command finishes. | -| **Master Node Selection** | Selects the master node or etcl node based on its own algorithm. To configure this selection manually, modify the `inventory/mycluster/hosts.yaml` file. | Selects the first server in `servers` as the master node. | +| **Master Node Selection** | Selects the control-plane nodes based on its own algorithm. To configure this selection manually, modify the `inventory/mycluster/hosts.yaml` file. | Selects the first server in `servers` as the control-plane node. | | **Time** | Takes more time to deploy a cluster of the same scale. | Takes less time to deploy a cluster of the same scale. | ## KubernetesWrapper diff --git a/code/KubernetesWrapper/KubernetesWrapper/Program.cs b/code/KubernetesWrapper/KubernetesWrapper/Program.cs index 463bac2..e5dd977 100644 --- a/code/KubernetesWrapper/KubernetesWrapper/Program.cs +++ b/code/KubernetesWrapper/KubernetesWrapper/Program.cs @@ -35,7 +35,10 @@ namespace KubernetesWrapper string? homeDirectory = Environment.GetEnvironmentVariable("HOME"); homeDirectory ??= "~"; - var config = KubernetesClientConfiguration.BuildConfigFromConfigFile($"~/.kube/config"); + string kubeConfigPath = $"{homeDirectory}/.kube/config"; + Console.WriteLine($"Home directory: {homeDirectory}"); + + var config = KubernetesClientConfiguration.BuildConfigFromConfigFile(kubeConfigPath); IKubernetes client = new Kubernetes(config); var nodes = Environment.GetEnvironmentVariable("CCP_NODES");