### Main Controller Entry Point (Go) Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt The main application entry point for initializing and starting the Gardener extension controller manager for Hetzner Cloud. It sets up structured logging, creates the controller manager command with signal handling, and executes it. Errors during execution are logged and result in a non-zero exit code. ```go package main import ( "os" "github.com/gardener/gardener/pkg/logger" "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager/signals" "github.com/23technologies/gardener-extension-provider-hcloud/pkg/cmd/controller" ) func main() { // Setup structured logging log.SetLogger(logger.MustNewZapLogger(logger.InfoLevel, logger.FormatJSON)) // Create controller manager command with signal handling ctx := signals.SetupSignalHandler() cmdDefinition := controller.NewControllerManagerCommand(ctx) // Execute controller manager if err := cmdDefinition.Execute(); err != nil { log.Log.Error(err, "Error executing command") os.Exit(1) } } // Start controller with configuration // Command line example: // gardener-extension-provider-hcloud \ // --config=/etc/config/componentconfig.yaml \ // --kubeconfig=/var/run/secrets/gardener.cloud/shoot/generic-kubeconfig/kubeconfig \ // --gardener-cluster-id=prod-garden-1 \ // --leader-election=true \ // --leader-election-namespace=garden ``` -------------------------------- ### Setup Infrastructure Controller in Go Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Configures and registers the infrastructure actuator for Hetzner Cloud within the Gardener extension framework. It manages infrastructure resources by reconciling networks, SSH keys, and placement groups. Dependencies include Gardener extension libraries and Hetzner Cloud specific configurations. ```go package main import ( "context" extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller" "github.com/gardener/gardener/extensions/pkg/controller/infrastructure" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/manager" ) // Create infrastructure actuator func SetupInfrastructureController(mgr manager.Manager, gardenID string) error { actuator := NewActuator(mgr, gardenID) // Register actuator with infrastructure controller return infrastructure.Add(mgr, infrastructure.AddArgs{ Actuator: actuator, ControllerOptions: infrastructure.DefaultAddOptions, Predicates: infrastructure.DefaultPredicates(nil), Type: "hcloud", }) } // Example reconciliation flow func ReconcileInfrastructure(ctx context.Context, infra *extensionsv1alpha1.Infrastructure, cluster *extensionscontroller.Cluster) error { // 1. Extract infrastructure configuration infraConfig, err := transcoder.DecodeInfrastructureConfigFromInfrastructure(infra) if err != nil { return err } // 2. Get Hetzner Cloud credentials credentials, err := hcloud.GetCredentials(ctx, client, infra.Spec.SecretRef) if err != nil { return err } // 3. Create or update infrastructure resources // - Private networks for worker nodes // - SSH keys for cluster access // - Placement groups for HA distribution // 4. Update infrastructure status infraStatus := &InfrastructureStatus{ SSHFingerprint: "aa:bb:cc:dd:ee:ff", PlacementGroupIDs: map[string]string{ "worker-pool-1": "12345678", }, NetworkIDs: &InfrastructureConfigNetworkIDs{ Workers: "1234567", }, } return updateProviderStatus(ctx, infra, infraStatus) } ``` -------------------------------- ### Setup Worker Controller in Go Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Initializes and registers the worker actuator for Hetzner Cloud, enabling the management of worker node pools and machine deployments through Gardener's Machine Controller Manager. It requires Gardener extension libraries and cluster-related configurations. ```go package main import ( "context" "github.com/gardener/gardener/extensions/pkg/controller/worker" "github.com/gardener/gardener/extensions/pkg/controller/worker/genericactuator" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" ) // Setup worker controller func SetupWorkerController(mgr manager.Manager, gardenCluster cluster.Cluster) error { actuator, err := NewActuator(mgr, gardenCluster) if err != nil { return err } return worker.Add(mgr, worker.AddArgs{ Actuator: actuator, ControllerOptions: worker.DefaultAddOptions, Predicates: worker.DefaultPredicates(nil), Type: "hcloud", }) } // Worker delegate implementation type workerDelegate struct { client client.Client cloudProfileConfig *CloudProfileConfig cluster *Cluster worker *extensionsv1alpha1.Worker hclient *hcloud.Client } // Generate machine deployments func (w *workerDelegate) GenerateMachineDeployments(ctx context.Context) (worker.MachineDeployments, error) { deployments := worker.MachineDeployments{} for _, pool := range w.worker.Spec.Pools { machineClass := map[string]interface{}{ "apiVersion": "machine.sapcloud.io/v1alpha1", "kind": "MachineClass", "serverType": pool.MachineType, "image": "ubuntu-22.04", "location": w.worker.Spec.Region, "sshKeys": []string{"cluster-ssh-key"}, "networks": []string{"worker-network-id"}, } deployment := worker.MachineDeployment{ Name: pool.Name, ClassName: pool.Name, Replicas: pool.Maximum, MachineClass: machineClass, } deployments = append(deployments, deployment) } return deployments, nil } ``` -------------------------------- ### Kubeconfig for Projected Service Account Token (YAML) Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/docs/deployment.md Example kubeconfig file to be used when authenticating against a target cluster using projected service account tokens from a runtime cluster. This configuration specifies the token file path for authentication. ```yaml apiVersion: v1 kind: Config clusters: - cluster: certificate-authority-data: server: https://virtual-garden.api name: virtual-garden contexts: - context: cluster: virtual-garden user: virtual-garden name: virtual-garden current-context: virtual-garden users: - name: virtual-garden user: tokenFile: /var/run/secrets/projected/serviceaccount/token ``` -------------------------------- ### Generate Control Plane Chart Values (Go) Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Provides Helm chart values for deploying the cloud controller manager and CSI driver components for the Hetzner Cloud provider. It requires context, control plane configuration, cluster details, secrets reader, checksums, and a scaled-down flag. Outputs a map of interface values for Helm templating or an error. ```go package main import ( "context" "github.com/gardener/gardener/extensions/pkg/controller/controlplane/genericactuator" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" ) type valuesProvider struct { client client.Client gardenID string } // Get control plane chart values func (vp *valuesProvider) GetControlPlaneChartValues( ctx context.Context, cp *extensionsv1alpha1.ControlPlane, cluster *Cluster, secretsReader secretsmanager.Reader, checksums map[string]string, scaledDown bool, ) (map[string]interface{}, error) { // Decode control plane configuration cpConfig, err := transcoder.DecodeControlPlaneConfigFromControllerCluster(cluster) if err != nil { return nil, err } // Get Hetzner Cloud credentials credentials, err := hcloud.GetCredentials(ctx, vp.client, cp.Spec.SecretRef) if err != nil { return nil, err } // Build chart values values := map[string]interface{}{ "global": map[string]interface{}{ "genericTokenKubeconfigSecretName": "generic-token-kubeconfig", }, "cloud-controller-manager": map[string]interface{}{ "replicas": 1, "clusterName": cp.Namespace + "-" + vp.gardenID, "kubernetesVersion": cluster.Shoot.Spec.Kubernetes.Version, "podRegion": cp.Spec.Region, "featureGates": map[string]bool{ "CSIMigration": true, }, }, "csi-controller": map[string]interface{}{ "replicas": 1, "token": credentials.CSI().Token, "kubernetesVersion": cluster.Shoot.Spec.Kubernetes.Version, }, } return values, nil } // Get storage class chart values func (vp *valuesProvider) GetStorageClassesChartValues( ctx context.Context, cp *extensionsv1alpha1.ControlPlane, cluster *Cluster, ) (map[string]interface{}, error) { cloudProfileConfig, err := transcoder.DecodeCloudProfileConfigFromControllerCluster(cluster) if err != nil { return nil, err } return map[string]interface{}{ "fsType": cloudProfileConfig.DefaultStorageFsType, "volumeBindingMode": "Immediate", "allowVolumeExpansion": true, }, nil } ``` -------------------------------- ### Define Infrastructure Configuration (Go) Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Defines the `InfrastructureConfig` structure in Go for a shoot cluster. This configuration includes settings for floating IP pools and network configurations, such as CIDR blocks and zones, used by the infrastructure actuator to set up private networks and worker node networking. ```go package main import ( "github.com/hetznercloud/hcloud-go/v2/hcloud" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Define infrastructure configuration for a shoot cluster config := &InfrastructureConfig{ TypeMeta: metav1.TypeMeta{ APIVersion: "hcloud.provider.extensions.gardener.cloud/v1alpha1", Kind: "InfrastructureConfig", }, FloatingPoolName: "loadbalancer-pool", Networks: &InfrastructureConfigNetworks{ WorkersConfiguration: &InfrastructureConfigNetwork{ Cidr: "10.250.0.0/16", Zone: hcloud.NetworkZoneEUCentral, }, Workers: "10.250.0.0/16", }, } // This configuration will be used by the infrastructure actuator // to create private networks and configure networking for worker nodes ``` -------------------------------- ### Controller Configuration (YAML) Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Defines controller-level configuration for the Hetzner Cloud extension provider. This includes settings for client connections, machine images (e.g., Ubuntu versions), ETCD storage, and health check configurations. It specifies parameters like accepted content types, query per second limits, and storage class names. ```yaml apiVersion: hcloud.provider.extensions.config.gardener.cloud/v1alpha1 kind: ControllerConfiguration clientConnection: acceptContentTypes: application/json contentType: application/json qps: 100 burst: 130 machineImages: - name: ubuntu version: "22.04" id: d61c3912-8422-4daf-835e-854efa0062e4 - name: ubuntu version: "20.04" id: a1b2c3d4-5678-90ab-cdef-1234567890ab etcd: storage: className: gardener.cloud-fast capacity: 25Gi healthCheckConfig: syncPeriod: 30s metricsBindAddress: ":8080" ``` -------------------------------- ### MachineImages Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/api.md Mapping from logical names and versions to provider-specific identifiers. ```APIDOC ## MachineImages ### Description Is a mapping from logical names and versions to provider-specific identifiers. ### Fields - **name** (string) - Name is the logical name of the machine image. - **versions** ([]MachineImageVersion) - Versions contains versions and a provider-specific identifier. ``` -------------------------------- ### Define Worker Configuration and Status (Go) Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Illustrates the `WorkerConfig` and `WorkerStatus` structures in Go. `WorkerConfig` specifies parameters for worker pools, such as the placement group type ('spread' is the only supported type by Hetzner Cloud) and the maximum number of machines per group. `WorkerStatus` tracks machine images and maps worker pool names to their corresponding Hetzner Cloud placement group IDs. ```go package main import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Worker configuration for a node pool workerConfig := &WorkerConfig{ TypeMeta: metav1.TypeMeta{ APIVersion: "hcloud.provider.extensions.gardener.cloud/v1alpha1", Kind: "WorkerConfig", }, // Hetzner Cloud only supports "spread" placement group type // Maximum 10 machines per placement group PlacementGroupType: "spread", } // Worker status tracking machine images and placement groups workerStatus := &WorkerStatus{ TypeMeta: metav1.TypeMeta{ APIVersion: "hcloud.provider.extensions.gardener.cloud/v1alpha1", Kind: "WorkerStatus", }, MachineImages: []MachineImage{ { Name: "ubuntu", Version: "22.04", }, }, PlacementGroupIDs: map[string]int{ "worker-pool-1": 12345678, "worker-pool-2": 87654321, }, } ``` -------------------------------- ### DockerDaemonOptions Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/api.md Contains configuration options for the Docker daemon service. ```APIDOC ## DockerDaemonOptions ### Description Contains configuration options for Docker daemon service. ### Fields - **httpProxyConf** (string) - Optional - HTTPProxyConf contains HTTP/HTTPS proxy configuration for Docker daemon. - **insecureRegistries** ([]string) - Optional - InsecureRegistries adds the given registries to Docker on the worker nodes. ``` -------------------------------- ### ETCD Configuration Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/config.md Defines the ETCD configuration, specifically focusing on storage details. ```APIDOC ## ETCD ### Description ETCD is an etcd configuration. ### Method N/A (This is a nested resource definition) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body - **storage** (ETCDStorage) - Required - The etcd storage configuration. ### Request Example ```json { "storage": { "className": "etcd-storage-class", "capacity": "10Gi" } } ``` ### Response #### Success Response (200) N/A (This is a nested resource definition) #### Response Example N/A ``` -------------------------------- ### CloudControllerManagerConfig Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/api.md Contains configuration settings for the cloud-controller-manager. ```APIDOC ## CloudControllerManagerConfig ### Description Contains configuration settings for the cloud-controller-manager. ### Fields - **featureGates** (map[string]bool) - Optional - FeatureGates contains information about enabled feature gates. ``` -------------------------------- ### InfrastructureConfig API Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Defines the configuration resource for Hetzner Cloud infrastructure settings within a shoot cluster. This includes network configurations and floating IP pool settings. ```APIDOC ## InfrastructureConfig API ### Description Configuration resource defining Hetzner Cloud infrastructure settings for a shoot cluster, including network configuration and floating IP pool settings. ### Method N/A (This is a configuration resource definition, not an API endpoint for direct calls) ### Endpoint N/A ### Parameters N/A ### Request Example ```go package main import ( "github.com/hetznercloud/hcloud-go/v2/hcloud" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Define infrastructure configuration for a shoot cluster config := &InfrastructureConfig{ TypeMeta: metav1.TypeMeta{ APIVersion: "hcloud.provider.extensions.gardener.cloud/v1alpha1", Kind: "InfrastructureConfig", }, FloatingPoolName: "loadbalancer-pool", Networks: &InfrastructureConfigNetworks{ WorkersConfiguration: &InfrastructureConfigNetwork{ Cidr: "10.250.0.0/16", Zone: hcloud.NetworkZoneEUCentral, }, Workers: "10.250.0.0/16", }, } // This configuration will be used by the infrastructure actuator // to create private networks and configure networking for worker nodes ``` ### Response N/A (This is a configuration resource definition) ``` -------------------------------- ### ControllerConfiguration API Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/config.md Defines the configuration for the HCloud provider, including garden ID, client connection settings, ETCD configuration, and health check settings. ```APIDOC ## ControllerConfiguration ### Description ControllerConfiguration defines the configuration for the HCloud provider. ### Method N/A (This is a resource definition, not an endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body - **apiVersion** (string) - Required - `hcloud.provider.extensions.config.gardener.cloud/v1alpha1` - **kind** (string) - Required - `ControllerConfiguration` - **gardenId** (string) - Required - The unique identifier of the Garden - **clientConnection** (Kubernetes v1alpha1.ClientConnectionConfiguration) - Optional - Specifies the kubeconfig file and client connection settings for the proxy server to use when communicating with the apiserver. - **etcd** (ETCD) - Required - The ETCD configuration. - **healthCheckConfig** (github.com/gardener/gardener/extensions/pkg/controller/healthcheck/config/v1alpha1.HealthCheckConfig) - Optional - The config for the health check controller ### Request Example ```json { "apiVersion": "hcloud.provider.extensions.config.gardener.cloud/v1alpha1", "kind": "ControllerConfiguration", "gardenId": "my-garden-id", "etcd": { "storage": { "className": "etcd-storage-class", "capacity": "10Gi" } } } ``` ### Response #### Success Response (200) N/A (This is a resource definition, not an endpoint) #### Response Example N/A ``` -------------------------------- ### MachineTypeOptions Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/api.md Defines additional VM options for a machine type. ```APIDOC ## MachineTypeOptions ### Description Defines additional VM options for an machine type given by name. ### Fields - **name** (string) - Name is the name of the machine type. - **extraConfig** (map[string]string) - Optional - ExtraConfig allows to specify additional VM options. e.g. sched.swap.vmxSwapEnabled=false to disable the VMX process swap file. ``` -------------------------------- ### Manage Hetzner Cloud API Credentials (Go) Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Handles the extraction and management of Hetzner Cloud API tokens from Kubernetes secrets for various components like CCM, CSI, and MCM. It supports both a single common token and component-specific tokens. Requires context, a Kubernetes client, and a secret reference. Returns a Credentials struct or an error if the secret is missing or malformed. ```go package main import ( "context" "fmt" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" ) type Credentials struct { commonToken *Token ccmToken *Token csiToken *Token mcmToken *Token } // Get credentials from Kubernetes secret func GetCredentials(ctx context.Context, c client.Client, secretRef corev1.SecretReference) (*Credentials, error) { secret := &corev1.Secret{} err := c.Get(ctx, client.ObjectKey{ Namespace: secretRef.Namespace, Name: secretRef.Name, }, secret) if err != nil { return nil, err } return ExtractCredentials(secret) } // Extract tokens from secret data func ExtractCredentials(secret *corev1.Secret) (*Credentials, error) { if secret.Data == nil { return nil, fmt.Errorf("secret does not contain any data") } // Try common token commonToken, commonErr := extractToken(secret, "hcloudToken") // Try component-specific tokens ccmToken, ccmErr := extractToken(secret, "hcloudTokenCCM") csiToken, csiErr := extractToken(secret, "hcloudTokenCSI") mcmToken, mcmErr := extractToken(secret, "hcloudTokenMCM") // At least common token or all specific tokens must exist if commonErr != nil && (ccmErr != nil || csiErr != nil || mcmErr != nil) { return nil, fmt.Errorf("missing required credentials") } return &Credentials{ commonToken: commonToken, ccmToken: ccmToken, csiToken: csiToken, mcmToken: mcmToken, }, nil } // Example secret structure func CreateCredentialsSecret() *corev1.Secret { return &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: "hcloud-credentials", Namespace: "garden-dev", }, Type: corev1.SecretTypeOpaque, Data: map[string][]byte{ // Option 1: Single common token for all components "hcloudToken": []byte("your-hetzner-cloud-api-token"), // Option 2: Separate tokens per component (more secure) "hcloudTokenCCM": []byte("token-for-cloud-controller-manager"), "hcloudTokenCSI": []byte("token-for-csi-driver"), "hcloudTokenMCM": []byte("token-for-machine-controller"), }, } } ``` -------------------------------- ### ControlPlaneConfig API Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Specifies the configuration for the control plane, including the zone, cloud controller manager settings, and load balancer configuration. ```APIDOC ## ControlPlaneConfig API ### Description Control plane configuration specifying zone, cloud controller manager settings, and load balancer configuration. ### Method N/A (This is a configuration resource definition, not an API endpoint for direct calls) ### Endpoint N/A ### Parameters N/A ### Request Example ```yaml apiVersion: hcloud.provider.extensions.gardener.cloud/v1alpha1 kind: ControlPlaneConfig zone: eu-central cloudControllerManager: featureGates: CSIMigration: true CSIMigrationHetzner: true loadBalancerClasses: - name: default ipPoolName: production-pool tcpAppProfileName: tcp-profile udpAppProfileName: udp-profile loadBalancerSize: MEDIUM ``` ### Response N/A (This is a configuration resource definition) ``` -------------------------------- ### ETCDStorage Configuration Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/config.md Defines the storage configuration for ETCD, including storage class name and capacity. ```APIDOC ## ETCDStorage ### Description ETCDStorage is an etcd storage configuration. ### Method N/A (This is a nested resource definition) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body - **className** (string) - Optional - The name of the storage class used in etcd-main volume claims. - **capacity** (k8s.io/apimachinery/pkg/api/resource.Quantity) - Optional - The storage capacity used in etcd-main volume claims. ### Request Example ```json { "className": "etcd-storage-class", "capacity": "10Gi" } ``` ### Response #### Success Response (200) N/A (This is a nested resource definition) #### Response Example N/A ``` -------------------------------- ### WorkerConfig and WorkerStatus APIs Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Defines the configuration and status tracking for worker pools, including machine image details and placement group information. ```APIDOC ## WorkerConfig and WorkerStatus APIs ### Description Worker pool configuration and status tracking for machine images and placement groups. ### Method N/A (These are configuration and status resource definitions, not API endpoints for direct calls) ### Endpoint N/A ### Parameters N/A ### Request Example (WorkerConfig) ```go package main import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Worker configuration for a node pool workerConfig := &WorkerConfig{ TypeMeta: metav1.TypeMeta{ APIVersion: "hcloud.provider.extensions.gardener.cloud/v1alpha1", Kind: "WorkerConfig", }, // Hetzner Cloud only supports "spread" placement group type // Maximum 10 machines per placement group PlacementGroupType: "spread", } ``` ### Request Example (WorkerStatus) ```go package main import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Worker status tracking machine images and placement groups workerStatus := &WorkerStatus{ TypeMeta: metav1.TypeMeta{ APIVersion: "hcloud.provider.extensions.gardener.cloud/v1alpha1", Kind: "WorkerStatus", }, MachineImages: []MachineImage{ { Name: "ubuntu", Version: "22.04", }, }, PlacementGroupIDs: map[string]int{ "worker-pool-1": 12345678, "worker-pool-2": 87654321, }, } ``` ### Response N/A (These are configuration and status resource definitions) ``` -------------------------------- ### MachineImageVersion Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/api.md Contains a version and a provider-specific identifier. ```APIDOC ## MachineImageVersion ### Description Contains a version and a provider-specific identifier. ### Fields - **version** (string) - Version is the version of the image. ``` -------------------------------- ### Hetzner Cloud Profile Configuration (YAML) Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Specifies the `CloudProfileConfig` in YAML format, which is embedded within Gardener's CloudProfile resource. It details available regions, machine images with versions and their corresponding image names on Hetzner Cloud, default filesystem types, machine type options including extra configurations like CPU models, and Docker daemon settings such as insecure registries. ```yaml apiVersion: hcloud.provider.extensions.gardener.cloud/v1alpha1 kind: CloudProfileConfig regions: - name: eu-central machineImages: - name: ubuntu versions: - version: "22.04" imageName: ubuntu-22.04 - version: "20.04" imageName: ubuntu-20.04 machineImages: - name: ubuntu versions: - version: "22.04" imageName: ubuntu-22.04 - version: "20.04" imageName: ubuntu-20.04 defaultStorageFsType: ext4 machineTypeOptions: - name: cx21 extraConfig: cpu.model: "host" dockerDaemonOptions: insecureRegistries: - "registry.example.com:5000" ``` -------------------------------- ### CPLoadBalancerClass Resource Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/api.md Defines a load balancer class for use in the ControlPlaneConfig. ```APIDOC ## CPLoadBalancerClass ### Description Provides the name of a load balancer for use in `ControlPlaneConfig`. ### Resource Type `hcloud.provider.extensions.gardener.cloud/v1alpha1.CPLoadBalancerClass` ### Fields - **name** (string) - The name of the load balancer. - **ipPoolName** (string) - (Optional) The name of the NSX-T IP pool. - **tcpAppProfileName** (string) - (Optional) The profile name for TCP load balancers. - **udpAppProfileName** (string) - (Optional) The profile name for UDP load balancers. ``` -------------------------------- ### ControlPlaneConfig Resource Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/api.md Details the configuration settings for the control plane in the HCloud provider extension. ```APIDOC ## ControlPlaneConfig ### Description Contains configuration settings for the control plane within the HCloud provider extension. ### Resource Type `hcloud.provider.extensions.gardener.cloud/v1alpha1.ControlPlaneConfig` ### Fields - **apiVersion** (string) - `hcloud.provider.extensions.gardener.cloud/v1alpha1` - **kind** (string) - `ControlPlaneConfig` - **cloudControllerManager** (CloudControllerManagerConfig) - (Optional) Configuration settings for the cloud-controller-manager. - **loadBalancerClasses** ([]CPLoadBalancerClass) - (Optional) Lists the load balancer classes to be used. - **loadBalancerSize** (string) - (Optional) Overrides the default NSX-T load balancer size ('SMALL', 'MEDIUM', or 'LARGE') defined in the cloud profile. ``` -------------------------------- ### Hetzner Cloud Control Plane Configuration (YAML) Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Defines the `ControlPlaneConfig` in YAML, specifying parameters for the control plane of a Kubernetes cluster on Hetzner Cloud. It includes the desired zone, settings for the cloud controller manager (like feature gates for CSI migration), and load balancer configurations including IP pool names, TCP/UDP profiles, and size. ```yaml apiVersion: hcloud.provider.extensions.gardener.cloud/v1alpha1 kind: ControlPlaneConfig zone: eu-central cloudControllerManager: featureGates: CSIMigration: true CSIMigrationHetzner: true loadBalancerClasses: - name: default ipPoolName: production-pool tcpAppProfileName: tcp-profile udpAppProfileName: udp-profile loadBalancerSize: MEDIUM ``` -------------------------------- ### Kubernetes Config for Service Account Token Volume Projection (YAML) Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/docs/deployment.md This YAML configuration defines a Kubernetes ConfigMap used for Service Account Token Volume Projection. It sets up a kubeconfig that references a token file, enabling automatic rotation of the service account token by the kubelet. ```yaml apiVersion: v1 kind: Config clusters: - cluster: certificate-authority-data: server: https://default.kubernetes.svc.cluster.local name: garden contexts: - context: cluster: garden user: garden name: garden current-context: garden users: - name: garden user: tokenFile: /var/run/secrets/projected/serviceaccount/token ``` -------------------------------- ### CloudProfileConfig API Source: https://context7.com/23technologies/gardener-extension-provider-hcloud/llms.txt Provider-specific configuration embedded into Gardener's CloudProfile resource. It defines available regions, machine images, and other provider-specific options. ```APIDOC ## CloudProfileConfig API ### Description Provider-specific configuration embedded into Gardener's CloudProfile resource, defining regions, machine images, and provider-specific options. ### Method N/A (This is a configuration resource definition, not an API endpoint for direct calls) ### Endpoint N/A ### Parameters N/A ### Request Example ```yaml apiVersion: hcloud.provider.extensions.gardener.cloud/v1alpha1 kind: CloudProfileConfig regions: - name: eu-central machineImages: - name: ubuntu versions: - version: "22.04" imageName: ubuntu-22.04 - version: "20.04" imageName: ubuntu-20.04 machineImages: - name: ubuntu versions: - version: "22.04" imageName: ubuntu-22.04 - version: "20.04" imageName: ubuntu-20.04 defaultStorageFsType: ext4 machineTypeOptions: - name: cx21 extraConfig: cpu.model: "host" dockerDaemonOptions: insecureRegistries: - "registry.example.com:5000" ``` ### Response N/A (This is a configuration resource definition) ``` -------------------------------- ### CloudProfileConfig Resource Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/api.md Defines the structure for HCloud-specific configuration embedded within Gardener's CloudProfile resource. ```APIDOC ## CloudProfileConfig ### Description Represents provider-specific configuration for HCloud, embedded in Gardener's `CloudProfile` resource. ### Resource Type `hcloud.provider.extensions.gardener.cloud/v1alpha1.CloudProfileConfig` ### Fields - **apiVersion** (string) - `hcloud.provider.extensions.gardener.cloud/v1alpha1` - **kind** (string) - `CloudProfileConfig` - **regions** ([]RegionSpec) - Specification of regions and zones topology. - **machineImages** ([]MachineImages) - List of machine images understood by the controller, mapping logical names to provider-specific identifiers. - **defaultClassStoragePolicyName** (string) - Name of the HCloud storage policy for the 'default-class' storage class. - **machineTypeOptions** ([]MachineTypeOptions) - (Optional) Additional options for individual machine types. - **dockerDaemonOptions** (DockerDaemonOptions) - (Optional) Configuration options for the docker daemon service. ``` -------------------------------- ### RegionSpec Source: https://github.com/23technologies/gardener-extension-provider-hcloud/blob/main/hack/api-reference/api.md Specifies the topology of a region and its zones. ```APIDOC ## RegionSpec ### Description Specifies the topology of a region and its zones. ### Fields - **name** (string) - Name is the name of the region. - **machineImages** ([]MachineImages) - Optional - MachineImages is the list of machine images that are understood by the controller. If provided, it overwrites the global MachineImages of the CloudProfileConfig. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.