{"id":20809694,"url":"https://github.com/smartxworks/cluster-api-provider-virtink","last_synced_at":"2025-05-07T08:11:42.251Z","repository":{"id":40692565,"uuid":"498249671","full_name":"smartxworks/cluster-api-provider-virtink","owner":"smartxworks","description":"Kubernetes Cluster API Provider Virtink","archived":false,"fork":false,"pushed_at":"2023-05-23T10:18:08.000Z","size":262,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-31T08:01:43.773Z","etag":null,"topics":["cloud-hypervisor","cluster-api","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartxworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-31T08:27:21.000Z","updated_at":"2024-11-04T05:42:26.000Z","dependencies_parsed_at":"2024-06-19T06:12:47.562Z","dependency_job_id":"11ca0fc0-371f-47e2-ac6f-adb28ba9a3ef","html_url":"https://github.com/smartxworks/cluster-api-provider-virtink","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartxworks%2Fcluster-api-provider-virtink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartxworks%2Fcluster-api-provider-virtink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartxworks%2Fcluster-api-provider-virtink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartxworks%2Fcluster-api-provider-virtink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartxworks","download_url":"https://codeload.github.com/smartxworks/cluster-api-provider-virtink/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252839294,"owners_count":21812090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-hypervisor","cluster-api","kubernetes"],"created_at":"2024-11-17T20:16:19.286Z","updated_at":"2025-05-07T08:11:42.228Z","avatar_url":"https://github.com/smartxworks.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes Cluster API Provider Virtink\n\n[![build](https://github.com/smartxworks/cluster-api-provider-virtink/actions/workflows/build.yml/badge.svg)](https://github.com/smartxworks/cluster-api-provider-virtink/actions/workflows/build.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/smartxworks/cluster-api-provider-virtink)](https://goreportcard.com/report/github.com/smartxworks/cluster-api-provider-virtink)\n\nKubernetes-native declarative infrastructure for [Virtink](https://github.com/smartxworks/virtink).\n\n## What is the Cluster API Provider Virtink\n\nThe [Cluster API](https://github.com/kubernetes-sigs/cluster-api) brings declarative, Kubernetes-style APIs to cluster creation, configuration and management. Cluster API Provider Virtink is a concrete implementation of Cluster API for Virtink.\n\nThe API itself is shared across multiple cloud providers allowing for true Virtink hybrid deployments of Kubernetes. It is built atop the lessons learned from previous cluster managers such as [kops](https://github.com/kubernetes/kops) and [kubicorn](http://kubicorn.io/).\n\n## Launching a Kubernetes cluster on Virtink\n\nCheck out the [getting started guide](https://cluster-api.sigs.k8s.io/user/quick-start.html) for launching a cluster on Virtink.\n\n\u003e **Note**: For `clusterctl` versions prior to v1.2.1, you'll need to add this provider manually to the `clusterctl` configuration file (`$HOME/.cluster-api/clusterctl.yaml`), as shown below:\n\u003e\n\u003e ```yaml\n\u003e providers:\n\u003e   - name: \"virtink\"\n\u003e     url: \"https://github.com/smartxworks/cluster-api-provider-virtink/releases/latest/infrastructure-components.yaml\"\n\u003e     type: \"InfrastructureProvider\"\n\u003e ```\n\nAn external Virtink cluster is recommended for infrastructure, further details can be found in the [external cluster documentation](docs/external-cluster.md). For an internal Virtink cluster, use `clusterctl generate cluster --infrastructure virtink --flavor internal capi-quickstart` to generate workload cluster configuration.\n\n## Environment Variables\n\nExcept for the [common variables](https://cluster-api.sigs.k8s.io/clusterctl/provider-contract.html#common-variables) provided by Cluster API, you can further customize your workload cluster on Virtink with following environment variables:\n\n| Variable name                              | Note                                                                                                                  |\n| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |\n| KUBERNETES_VERSION                         | Only support Kubernetes versions that corresponding rootfs image `smartxworks/capch-rootfs-$KUBERNETES_VERSION` exists|\n| VIRTINK_INFRA_CLUSTER_SECRET_NAME          | The name of secret in the management cluster that contains the kubeconfig of the Virtink infrastructure cluster       |\n| VIRTINK_INFRA_CLUSTER_SECRET_NAMESPACE     | The namespace of secret in the management cluster that contains the kubeconfig of the Virtink infrastructure cluster  |\n| VIRTINK_INFRA_CLUSTER_RESOURCES_NAMESPACE  | The namespace of resources(such as VM, DataVolume) to be created in the infrastructural cluster, make sure it exists before create the workload cluster (default `$NAMESPACE`)                                                                                                                                       |\n| POD_NETWORK_CIDR                           | Range of IP addresses for the pod network (default `192.168.0.0/16`)                                                  |\n| SERVICE_CIDR                               | Range of IP address for service VIPs (default `10.96.0.0/12`)                                                         |\n| VIRTINK_CONTROL_PLANE_SERVICE_TYPE         | The type of control plane service (default `NodePort`)                                                                |\n| VIRTINK_CONTROL_PLANE_MACHINE_CPU_CORES    | The CPU cores of each control plane machine (default `2`)                                                             |\n| VIRTINK_CONTROL_PLANE_MACHINE_MEMORY_SIZE  | The memory size of each control plane machine (default `4Gi`)                                                         |\n| VIRTINK_CONTROL_PLANE_MACHINE_KERNEL_IMAGE | The kernel image of control plane machine (default `smartxworks/capch-kernel-5.15.12`)                                |\n| VIRTINK_CONTROL_PLANE_MACHINE_ROOTFS_IMAGE | The rootfs image of control plane machine (default `smartxworks/capch-rootfs-1.24.0`)                                 |\n| VIRTINK_CONTROL_PLANE_MACHINE_ROOTFS_SIZE  | The rootfs size of each control plane machine (default `4Gi`)                                                         |\n| VIRTINK_WORKER_MACHINE_CPU_CORES           | The CPU cores of each worker machine (default `2`)                                                                    |\n| VIRTINK_WORKER_MACHINE_MEMORY_SIZE         | The memory size of each worker machine (default `4Gi`)                                                                |\n| VIRTINK_WORKER_MACHINE_KERNEL_IMAGE        | The kernel image of worker machine (default `smartxworks/capch-kernel-5.15.12`)                                       |\n| VIRTINK_WORKER_MACHINE_ROOTFS_IMAGE        | The rootfs image of worker machine (default `smartxworks/capch-rootfs-1.24.0`)                                        |\n| VIRTINK_WORKER_MACHINE_ROOTFS_SIZE         | The rootfs size of each worker machine (default `4Gi`)                                                                |\n\n## Launching a Kubernetes cluster on Virtink with persistent storage\n\nBy default cluster-api-provider-virtink created Kubernetes Node is a Virtink VirtualMachine with [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) as storage, that means when a Virtink VirtualMachine failed all data on it will lose and the Node can't be recovered. cluster-api-provider-virtink can provide Node with persistent storage by Virtink [dataVolume](https://github.com/smartxworks/virtink/blob/main/docs/disks_and_volumes.md#datavolume-volume) volume and CNI that support specify IP and MAC address for Pod.\n\n| Variable name                                  | Note                                                                                                                 |\n| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |\n| VIRTINK_CONTROL_PLANE_MACHINE_ROOTFS_CDI_IMAGE | The rootfs image for CDI of control plane machine (default `smartxworks/capch-rootfs-cdi-1.24.0`)                    |\n| VIRTINK_WORKER_MACHINE_ROOTFS_CDI_IMAGE        | The rootfs image for CDI of worker machine (default `smartxworks/capch-rootfs-cdi-1.24.0`)                           |\n| VIRTINK_IP_POOL_NAME                           | The IPPool for machines to get IP address from                                                                       |\n\nThis is an example to generate workload cluster configuration with persistent storage for an internal Virtink cluster that use Calico as CNI. You should be familiar with Calico [IP reservation](https://projectcalico.docs.tigera.io/reference/resources/ipreservation), Calico [use-specific-ip](https://projectcalico.docs.tigera.io/networking/use-specific-ip) for pod, and Calico [use-specific-mac-address](https://github.com/projectcalico/calico/blob/master/calico/networking/pod-mac-address.md) for pod.\n\nDownload [cluster-template-cdi-internal.yaml](templates/cluster-template-cdi-internal.yaml) and update `VirtinkMachineTemplate.spec.template.metadata.annotations` as below, `$IP_ADDRESS` and `$MAC_ADDRESS` are placeholders which will be replaced by allocated IP and MAC.\n\n```yaml\nspec:\n  template:\n    metadata:\n      annotations:\n        cni.projectcalico.org/hwAddr: $MAC_ADDRESS\n        cni.projectcalico.org/ipAddrs: '[\"$IP_ADDRESS\"]'\n```\n\nWe use [ip-address-manager](https://github.com/metal3-io/ip-address-manager) to manage the allocattion of IP addresses, so you need to create an [IPPool](https://github.com/metal3-io/ip-address-manager/blob/main/docs/api.md#ippool) resource.\n\n```shell\n# replace to created IPPool name.\nexport VIRTINK_IP_POOL_NAME='capi-quickstart'\nclusterctl generate cluster --infrastructure virtink --flavor cdi-internal capi-quickstart\n```\n\n## License\n\nThis project is distributed under the [Apache License, Version 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartxworks%2Fcluster-api-provider-virtink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartxworks%2Fcluster-api-provider-virtink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartxworks%2Fcluster-api-provider-virtink/lists"}