Skip to content

ConfigBuilder CLI Tool

Overview

ConfigBuilder is a command-line tool designed to generate YAML configuration files for different environments (Baremetal, EKS, GKE) from predefined templates by prompting users for the necessary inputs. It simplifies the process of configuring Rafay Self-Hosted environments by guiding users through a series of prompts to collect the required information and generate a configuration file.


Installation

Download the ConfigBuilder CLI tool for the required operating system using the following links.


Supported Flags

ConfigBuilder supports the following flags, which can be used with the commands:

  • -u (Optional): Prompts for custom super-user name and password details. If this flag is not provided, the tool uses default super-user name and password values
  • -o (Optional): Specifies a custom directory to save the generated configuration file. The directory path must be provided as an absolute path. If not specified, the file is saved in the current working directory

ConfigBuilder Commands for Controller Configuration

  • Baremetal: Generates a configuration YAML file for an air-gapped controller
  • EKS: Generates a configuration YAML file for an EKS controller
  • GKE: Generates a configuration YAML file for a GKE controller
  • Version: Prints the version number of ConfigBuilder
  • Help: Displays help information for ConfigBuilder or any subcommand

Baremetal ConfigBuilder

  • This command generates a config.yaml file for an air-gapped controller:
$./configbuilder baremetal
  • The tool prompts for necessary inputs, such as High Availability (HA) settings, backup settings, namespace labels, and more. By default, the generated config.yaml file is saved in the current directory, unless the -o flag is used to specify a custom directory. The tool uses the default username and password unless the -u flag is provided to set custom credentials.

Example

Here is an example of executing the ConfigBuilder binary in a Baremetal environment:

  1. Downloading the Binary

    • The wget command is used to download files from the internet. In this example, it fetches the ConfigBuilder binary from the specified URL.
    • The command provided is:
      wget https://dev-rafay-controller.s3.us-west-1.amazonaws.com/configbuilder/linux/configbuilder
      
      This command will download the ConfigBuilder binary to the current directory on the system where the command is executed.
  2. Executing the Binary

    • After downloading, the binary file needs to be made executable. This is typically done using the chmod command:
      chmod +x configbuilder
      
      This command changes the file permissions to allow execution of the binary.
  3. Running the Binary:

    • Once the binary is executable, it can be run by simply typing:
      ./configbuilder
      
      This command executes the ConfigBuilder binary.
  4. Run the 'configbuilder' binary with the 'baremetal' option to start configuring the environment.

    ./configbuilder baremetal
    

  5. Interactive Configuration Steps appears as shown below

    ./configbuilder baremetal
    
    Do you want to create a High-Availability (HA) controller?  (yes/no) : y
    
    Select the size of your controller deployment: (Small/S - Medium/M - Large/L) (default: M): s
    
    Provide a fully qualified domain name (FQDN) for the controller : rafay.dev.rafay-edge.net
    
    Do you want to generate self signed certificates for the provided FQDN?  (yes/no) : y
    
    Would you like to enable advanced configuration  (yes/no) : y
    
    Would you like to configure backup and restore for the controller?  (yes/no) : n
    
    Would you like to configure namespace labels :  (yes/no) : y
    
     How many namespace labels do you want to add :  (default: 1): 1
    Namespace Label 1:
      Provide the namespace label key : environment
      Provide the namespace label value : dev
    
    Would you like to configure pod tolerations :  (yes/no) : n
    
    Configuration YAML file generated successfully at '/home/ubuntu/user1/Configbuilder/config-28-August-2024-06:53:59.yaml'!
    
    After completing the prompts, the configbuilder generates a YAML configuration file based on the provided inputs. Below is an example of the configuration specification:
    apiVersion: radm.k8s.io/v1beta1
    kind: InitConfiguration
    metadata:
      name: RafayAirGapController
    spec:
      blueprintVersion: v2
      deployment:
        type: "airgap"
        ha: true
        size: "S"
      backup_restore:
        enabled: false
        restore: false
        schedule: "0 0 * * *"
        bucketName: ""
        retentionPeriod: "168h0m0s"
        restoreFolderName: ""
        resticEnable: false
        region: ""
      proxy:
        host: ""
        ip: ""
        port:
        no-proxy: ""
      monitoring:
        integrations:
          external_logging:
            enabled: false
            endpoint: ""
            port: ""
            user_name: ""
            user_password: ""
          external_metrics:
            enabled: false
      cert-manager:
        external: false
      metrics-server:
        external: false
      efs-driver:
        external: false
      alb-controller:
        external: false
      namespace_labels:
        Owner: Rafay
        environment: dev
      pod_tolerations:
        enable: false
        tolerations:
        - key: ""
          operator: ""
          value: ""
          effect: ""
      repo:
        archive-directory: /home/ubuntu/user1/Configbuilder
        unarchive-path: /tmp
        rafay-registry:
          type: ""
          registry-subpath: "rafay"
          registry-archive:
            file: rafay-registry.tar.gz
          ecr:
            aws-irsa-role: ""
            aws-region: ""
            aws-ecr-endpoint: ""
          jfrog:
            user_name: ""
            password: ""
            endpoint: ""
            insecure: false
        infra-archive:
          images-file: "rafay-infra-images.tar.gz"
        dep-archive:
        - name: istio-1.16.7
          file: istio-1.16.7-blueprint.tar.gz
          images-file-v2: "rafay-istio-1.16.7-images.tar.gz"
        - name: istio-1.8.1
          file: istio-1.8.1-blueprint.tar.gz
          images-file-v1: "rafay-istio-1.8.1-images.tar.gz"
        - name: rafay-dep
          file: rafay-dep.tar.gz
          images-file-v1: "rafay-dep-images-v1.tar.gz"
          images-file-v2: "rafay-dep-images-v2.tar.gz"
        app-archive:
        - name: rafay-core
          file: rafay-core.tar.gz
          images-file: "rafay-core-images.tar.gz"
        cluster-images-archive:
        - name: rafay-cluster-images
          file: rafay-cluster-images.tar.gz
        cluster-assets-archive:
        - name: rafay-cluster-assets
          file: rafay-cluster-assets.tar.gz
      app-config:
        generate-self-signed-certs: true
        console-certificates:
          certificate: ""
          key: ""
        super-user:
          user: "admin@rafay.co"
          password: "changeplz"
        partner:
          star-domain: "rafay.dev.rafay-edge.net"
          name: "Rafay Airgap"
          product-name: "Rafay SelfHosted Product"
          help-desk-email: "admin@rafay.co"
          notifications-email: "admin@rafay.co"
      override-config:
        global.tsdb_backup.enabled: false
        global.secrets.tsdb.gke.storage_account_key: ""
        global.tsdb_backup.bucket: ""
        global.tsdb_backup.bucket_region: ""
        global.tsdb_backup.role_arn: ""
        global.enable_hosted_dns_server: "false"
        global.external_lb: "false"
        global.use_instance_role: "false"
        global.edge.irsa_role_enabled: "false"
        global.edge.irsa_role_arn: ""
        global.secrets.aws_account_id: "0123456789"
        global.secrets.aws_access_key_id: "ZHVtbXk="
        global.minReplicaCount: 2
        global.secrets.aws_secret_access_key: "ZHVtbXk="
        global.engine_api_blob_provider: "s3"
        global.engine_api_blob_bucket: "engine-objects"
        global.engine_api_region: "us-west-2"
        global.issuer_name: ""
        localprovisioner.basePath: "/data/local2"
        core-registry-path: "/data/registry"
        etcd-path: "/data/etcd"
    

  6. Custom Output Path (Optional): To save the configuration file to a custom path, use the -o option:

    ./configbuilder baremetal -o /home/ubuntu/
    
    This saves the file to /home/ubuntu/

  7. Review the Configuration File: The configuration file, named config-28-August-2024-06:55:34.yaml, will be generated and contain all the settings specified during the configuration process


EKS ConfigBuilder

This command generates a config.yaml file for an EKS controller:

$./configbuilder eks

The tool prompts for necessary inputs, such as High Availability (HA) settings, backup settings, namespace labels, and others. By default, the generated config.yaml file is saved in the current directory, unless the -o flag is used to specify a custom directory. The default username and password are used unless the -u flag is provided to set custom credentials.

GKE ConfigBuilder

This command generates a config.yaml file for a GKE controller:

$./configbuilder gke

The tool prompts for necessary inputs, such as High Availability (HA) settings, backup settings, namespace labels, and more. By default, the generated config.yaml file is saved in the current directory unless the -o flag is used to specify a custom directory. The default username and password are applied unless the -u flag is provided to set custom credentials.

Version ConfigBuilder

This command displays the version number of the ConfigBuilder tool:

$ ./configbuilder version
Confibuilder-v2.7

Help ConfigBuilder

This command displays help information for ConfigBuilder commands and flags:

$./configbuilder help
ConfigBuilder is a CLI tool that helps you generate configuration files for Rafay Self Hosted by prompting you for necessary inputs..

Usage:
  configbuilder [command]

Available Commands:
  baremetal   Generates a configuration YAML file for airgapped controller
  eks         Generates a configuration YAML file for EKS
controller
  gke         Generates a configuration YAML file for GKE controller
  help        Help about any command
  version     Print the version number of Confibuilder

Flags:
  -u, --custom-super-user   Provide custom super-user name and password
  -h, --help                help for configbuilder
  -o, --output string       Output path for the YAML file (default "config.yaml")

Use "configbuilder [command] --help" for more information about a command.

The example below displays detailed help and usage instructions for the EKS command.

$./configbuilder help eks
Generate a configuration YAML file based on user input. By default, the file is named 'config.yaml' and located in the current directory. Use the -o/--output flag to specify a different path.

Usage:
  configbuilder eks [flags]

Flags:
  -h, --help              help for eks
  -o, --output string     Output path for the YAML file (default "config.yaml")
      --password string   Super-user password (default "changeplz")
      --username string   Super-user name (default "admin@rafay.co")

Global Flags:
  -u, --custom-super-user   Provide custom super-user name and password