diff --git a/README.md b/README.md index 6dbf605..712bf52 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ A powerful and user-friendly Command Line Interface (CLI) for [Kubero](https://g - [Linode](#linode) - [DigitalOcean](#digitalocean) - [Google GKE](#google-gke) + - [OVH](#ovh) - [Development Guide](#development-guide) - [Contributing](#contributing) - [License](#license) @@ -147,6 +148,7 @@ Kubero CLI currently supports the following cloud providers: - **Linode** - **DigitalOcean** - **Google GKE** +- **OVH** (Managed Kubernetes) - **Kind** (local clusters) ### Coming Soon @@ -255,6 +257,12 @@ export DIGITALOCEAN_ACCESS_TOKEN=your_access_token export GOOGLE_API_KEY=your_api_key ``` +### OVH + +No credentials required. Create your Managed Kubernetes cluster in the +[OVH control panel](https://www.ovh.com/manager/#/public-cloud/), download +the kubeconfig file and provide its path during `kubero install`. + --- ## Development Guide diff --git a/cmd/kuberoCli/install.go b/cmd/kuberoCli/install.go index bc7a16b..8d10aff 100644 --- a/cmd/kuberoCli/install.go +++ b/cmd/kuberoCli/install.go @@ -97,7 +97,7 @@ var monitoringInstalled bool var ingressControllerVersion = "v1.10.0" // https://github.com/kubernetes/ingress-nginx/tags -> controller-v1.5.1 // var clusterTypeSelection = "[scaleway,linode,gke,digitalocean,kind]" -var clusterTypeList = []string{"kind", "linode", "scaleway", "gke", "digitalocean"} +var clusterTypeList = []string{"kind", "linode", "scaleway", "gke", "digitalocean", "ovh"} func init() { installCmd.Flags().StringVarP(&argComponent, "component", "c", "", "install component (kubernetes,olm,ingress,metrics,certManager,kubero-operator,monitoring,kubero-ui)") @@ -172,6 +172,8 @@ func installKubernetes() { installGKE() case "digitalocean": installDigitalOcean() + case "ovh": + installOVH() case "kind": installKind() default: @@ -373,6 +375,8 @@ func installIngress() { prefill = "scw" case "digitalocean": prefill = "do" + case "ovh": + prefill = "cloud" } ingressProviderList := []string{"kind", "aws", "baremetal", "cloud", "do", "exoscale", "scw"} @@ -705,7 +709,8 @@ func installKuberoUi() { if clusterType == "linode" || clusterType == "digitalocean" || clusterType == "scaleway" || - clusterType == "gke" { + clusterType == "gke" || + clusterType == "ovh" { kuberoUIConfig.Spec.Ingress.ClassName = "nginx" } diff --git a/cmd/kuberoCli/install_ovh.go b/cmd/kuberoCli/install_ovh.go new file mode 100644 index 0000000..02ee552 --- /dev/null +++ b/cmd/kuberoCli/install_ovh.go @@ -0,0 +1,33 @@ +package kuberoCli + +import ( + "log" + "os" + + "github.com/i582/cfmt/cmd/cfmt" +) + +// ponytail: OVH provides the kubeconfig for its managed clusters directly. +// No OVH API integration (request signing, app keys) needed — create the +// cluster in the OVH control panel, download the kubeconfig and merge it. +func installOVH() { + + _, _ = cfmt.Println("{{ OVH Managed Kubernetes clusters are created via the OVH control panel:}}::gray") + _, _ = cfmt.Println("{{ https://www.ovh.com/manager/#/public-cloud/ -> Managed Kubernetes Service}}::gray") + _, _ = cfmt.Println("{{ Download the kubeconfig file of your cluster to continue.}}::gray") + + kubeconfigPath := promptLine("Path to the OVH kubeconfig file", "", "kubeconfig.yml") + + kubeconfig, err := os.ReadFile(kubeconfigPath) + if err != nil { + _, _ = cfmt.Println("{{✗ Failed to read kubeconfig file " + kubeconfigPath + "}}::red") + log.Fatal(err) + } + + err = mergeKubeconfig(kubeconfig) + if err != nil { + _, _ = cfmt.Println("{{✗ Failed to merge kubeconfig}}::red") + log.Fatal(err) + } + _, _ = cfmt.Println("{{✓ Kubeconfig merged}}::lightGreen") +}