Installation with CLI

Prerequisites

Installation with init flags

Installation with init configuration

karmadactl init allows you to install Karmada by specifying a configuration file, which provides a structured way to define all settings in a YAML file.

Example Configuration File

Here is an example of the configuration file for Karmada deployment:

  1. apiVersion: config.karmada.io/v1alpha1
  2. kind: KarmadaInitConfig
  3. spec:
  4. karmadaCrds: "https://github.com/karmada-io/karmada/releases/download/v1.10.3/crds.tar.gz"
  5. etcd:
  6. local:
  7. imageRepository: "registry.k8s.io/etcd"
  8. imageTag: "3.5.13-0"
  9. initImage:
  10. imageRepository: "docker.io/library/alpine"
  11. imageTag: "3.19.1"
  12. components:
  13. karmadaAPIServer:
  14. imageRepository: "registry.k8s.io/kube-apiserver"
  15. imageTag: "v1.30.0"
  16. karmadaAggregatedAPIServer:
  17. imageRepository: "docker.io/karmada/karmada-aggregated-apiserver"
  18. imageTag: "v1.10.3"
  19. kubeControllerManager:
  20. imageRepository: "registry.k8s.io/kube-controller-manager"
  21. imageTag: "v1.30.0"
  22. karmadaControllerManager:
  23. imageRepository: "docker.io/karmada/karmada-controller-manager"
  24. imageTag: "v1.10.3"
  25. karmadaScheduler:
  26. imageRepository: "docker.io/karmada/karmada-scheduler"
  27. imageTag: "v1.10.3"
  28. karmadaWebhook:
  29. imageRepository: "docker.io/karmada/karmada-webhook"
  30. imageTag: "v1.10.3"

Deploying Karmada with Configuration File

1.Save the example configuration above to a file, e.g., karmada-init-config.yaml.

2.Use the following command to deploy Karmada with the configuration file:

  1. sudo karmadactl init --config /path/to/your/karmada-init-config.yaml

Installation with CLI - 图1note

You need to use sudo for elevated permissions because karmadactl creates a karmada-apiserver.config file at the /etc/karmada/ directory.

3.This configuration file allows you to define essential parameters, including:

  • certificates: Defines certificate paths and validity period.
  • etcd: Configures Etcd settings, including local or external Etcd options.
  • hostCluster: Specifies host cluster API endpoint and kubeconfig.
  • images: Configures image settings for components.
  • components: Sets up replicas for API Server and other core components.
  • karmadaDataPath: Defines the data path for Karmada.

If you need more information about the configuration file, please refer to the karmadactl init API reference.