furyctl

furyctl documentation

5 minute read

furyctl is the package manager for Kubernetes Fury Distribution. It also enables self-provisioning Fury cluster.

Source Code

You can find the source code in its github repository.

Version

The latest stable furyctl release is v0.5.1.

Install

Install furyctl binary in any Linux/macOS based system.

Github Releases

Every furyctl release is available as github releases in the form of binary file and archive one (.tar.gz).

To install it in any Linux/macOS based system:

$ uname
Darwin
$ curl -Ls https://github.com/sighupio/furyctl/releases/download/v0.5.1/furyctl-darwind-amd64 -o furyctl
$ chmod +x furyctl
$ mv furyctl /usr/local/bin/furyctl
$ furyctl version
INFO[0000] Furyctl version dev
INFO[0000] built unknown from commit none

Homebrew

If you are a macOS (also works in Linux) user, you should be familiar with homebrew. To install furyctl using homebrew follow this simple guide:

$ brew tap sighupio/furyctl
$ brew install furyctl
$ furyctl version
INFO[0000] Furyctl version dev
INFO[0000] built unknown from commit none

Usage

Package Manager

$ furyctl --help

A command line tool to manage cluster deployment with kubernetes

Usage:
  furyctl [command]

Available Commands:
  bootstrap   Creates the required infrastructure to deploy a battle-tested Kubernetes cluster, mostly network components
  cluster     Creates a battle-tested Kubernetes cluster
  help        Help about any command
  init        Initialize the minimum distribution configuration
  vendor      Download dependencies specified in Furyfile.yml
  version     Prints the client version information

Flags:
      --debug   Enables furyctl debug output
  -h, --help    help for furyctl

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

Furyfile

Furyfile.yml is a yaml file where you list which packages (and versions) you want to have.

Structure:

versions: # map of prefixes and versions used to force a specific version for all the matching roles/modules/bases.
  # e.g. will force version v1.15.5-1 if the name matches "aws*".
  aws: v1.15.5-1
  monitoring: v1.3.0

provider: # You can define custom providers to download bases, modules or roles.
  modules: # Map of diferent terraform modules provider
    aws: # Custom name for this provider
      - url: https://github.com/terraform-aws-modules # Where to locate modules
        label: official-modules  # Label

roles: # list of ansible roles to download.
  - name: aws/ # In this case furyctl will download every role inside -> https://github.com/sighupio/fury-kubernetes-aws/tree/v1.15.5-1/roles

modules: # list of terraform modules to download.
  - name: aws/aws-vpc # In this case furyctl will download just the aws-vpc terraform module from -> https://github.com/sighupio/fury-kubernetes-aws/tree/v1.15.5-1/modules/aws-vpc
  - name: terraform-aws-rds # In this case furyctl will download the terraform module from -> https://github.com/terraform-aws-modules/terraform-aws-rds
    version: v2.14.0
    provider: # Map with information related to the provider
      name: aws # Custom name of the provider
      label: official-modules # Label
    registry: true # Indicates to use non SIGHUP modules

bases: # list of kustomize/kubernetes projects to download.
  - name: monitoring # In this case furyctl will download every kustomize/kubernetes project from -> https://github.com/sighupio/fury-kubernetes-monitoring/tree/v1.3.0/katalog
  - name: aws/storageclass # In this case furyctl will download just the storageclass kustomize project from -> https://github.com/sighupio/fury-kubernetes-aws/tree/v1.15.4-6/katalog/storageclass
    version: v1.15.4-6 # versions can be overridden if needed by specifying them for each package.

Commands

init

The init command can be used to download essential files to deploy the Kubernetes Fury Distribution (kustomization.yaml and Furyfile.yml).

$ furyctl init --help
Initialize the current directory with the minimum distribution configuration

Usage:
  furyctl init [flags]

Flags:
  -h, --help             help for init
      --version string   Specify the Kubernetes Fury Distribution version

Example usage:

$ furyctl init --version v1.5.1
2020/02/27 08:24:46 downloading: http::https://github.com/sighupio/fury-distribution/releases/download/v1.5.1/Furyfile.yml -> Furyfile.yml
2020/02/27 08:24:47 downloading: http::https://github.com/sighupio/fury-distribution/releases/download/v1.5.1/kustomization.yaml -> kustomization.yaml
$ ls
Furyfile.yml            kustomization.yaml

You can find available versions in the Kubernetes Fury Distribution github repository.

vendor

This command downloads every package defined in a Furyfile.yml in a new directory named vendor.

$ furyctl vendor --help
Download dependencies specified in Furyfile.yml

Usage:
  furyctl vendor [flags]

Flags:
  -h, --help       help for vendor
  -H, --https      if true downloads using https instead of ssh
  -p, --parallel   if true enables parallel downloads (default true)

Example usage:

$ ls
Furyfile.yml
$ cat Furyfile.yml
bases:
  - name: monitoring
    version: v1.3.0
$ furyctl vendor
2020/02/27 08:36:09 downloading: git@github.com:sighupio/fury-kubernetes-monitoring//katalog?ref=v1.3.0 -> vendor/katalog/monitoring

Cluster self-provisioning

The self-provisioning feature is available with two commands:

  • furyctl bootstrap: Use it to create the required infrastructure to place the cluster. Skip it if you already managed to have passed all the cluster requirements.
  • furyctl cluster: Deploys a Fury cluster.

Both commands provide the following subcommands:

  • furyctl {bootstrap,cluster} template --provisioner {provisioner_name}: Creates a yml configuration file with some default options making easy replacing these with the right values.
  • furyctl {bootstrap,cluster} init: Initializes the project that deploys the infrastructure.
  • furyctl {bootstrap,cluster} apply: Actually creates or updates the infrastructure.
  • furyctl {bootstrap,cluster} destroy: Destroys the infrastructure.

All these three subcommands accept the following options:

-c, --config string:   Configuration file path
-t, --token string:    GitHub token to access enterprise repositories. Contact sales@sighup.io
--reconfigure      Reconfigure the backend, ignoring any saved configuration
-w, --workdir string:  Working directory with all project files

init subcommand also implements the following option:

--reset: Forces the re-initialization of the project. It deletes the content of the workdir recreating everything

apply subcommand also implements the following option:

--dry-run: Dry run execution

Configuration file

The self-provisioning feature uses a different configuration file than the Furyfile.yml. Use the Furyfile.yml file while using package-manager features.

kind: # Cluster or Bootstrap
metadata:
  name: # Name of the deployment. Can be used by the provisioners as unique identifier.
executor: # This is an optional attribute. It defines the terraform executor to use along with the backend configuration
  state: # Optional attribute. It configures the backend configuration file.
    backend: # Optional attribute. It configures the backend to use. Default to local
    config: # Optional attribute. It configures the configuration of the selected backend configuration. It accepts multiple key values.
      # bucket: "my-bucket" # Example
      # key: "terraform.tfvars"
      # region: "eu-home-1" # Example
provisioner: # Defines what provisioner to use.
spec: {} # Input variables of the provisioner. Read each provisioner definition to understand what are the valid values.

Self-Provisioning

Fury Cluster self provisioning

Self-provisioning provisioners

furyctl provisioner documentation