mkactl

command module
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

goreportcard CI License


mkactl

A command line interface for controlling "MetaKube Accelerator" deployments. Think "MKA on steroids".

Have a look at the reference documentation or at the changelog for the latest release.

For the impatient: there is a Quickstart Guide further below.



Install Binary


Grab a pre-built binary for your platform and architecture from the latest release.

Homebrew Tap
# add the tap to homebrew
$ brew tap syseleven/mkactl https://code.syseleven.de/syseleven/building-blocks/mkactl.git
# install
$ brew install mkactl


Install from Source


Prerequisites

  • install golang >= 1.18 for your platform, e.g.:

    • using asdf

      $ asdf plugin add golang
      $ asdf install golang 1.18.6
      $ asdf global golang 1.18.6
      

Install Procedure

# download, build and install to $GOPATH/bin
$ go install code.syseleven.de/syseleven/building-blocks/mkactl@v0.8.0
# verify installation success 
$ ${GOPATH:-$HOME/go}/bin/mkactl --version
# optional: copy the binary to your path, eg:
$ sudo cp ${GOPATH:-$HOME/go}/bin/mkactl /usr/local/bin/
# or add to global PATH variable in your shell .rc
$ echo "PATH=${GOPATH:-$HOME/go}/bin:${PATH} >> ~/.zshrc && exec zsh


Quickstart


  • You need a personal access token to be able to invoke gitlab functionality.

    # this will open a window of the default browser
    $ mkactl config add-account
    

    This in turn will open a browser window for you to create a token and paste the result back to mkactl to persist it in the configuration file:

    mkactl config add-account

  • Now you'd add a so-called control-repository which controls the actual building block deployments. In order to allow CI pipelines in that repository to access an actual kubernetes cluster, provide a kubectl config (via --kubeconfig) or have it at its default location (whatever $KUBECONFIG points at or $HOME/.kube/config) and provide --find-kubeconfig.

    # add a new control repository with default kubeconfig
    $ mkactl repo add -k
    

    If the just added repository is the sole one, it is automatically selected for further operations. To see which repository is currently selected, issue a repo list:

    # list all previously added repositories
    $ mkactl repo list
    existing control repositories:
    
     NAME                   GROUP  STATUS          SELECTED  PATH
     another-fancy-repo     ~      clean             *       /local/path/to/repo...
     mka-control-815767138  ~      clean                     /local/path/to/repo...
    
    # optional: select another repository
    $ mkactl repo select mka-control-815767138
    # list again to see the effect
    $ mkactl repo list
    existing control repositories:
    
     NAME                   GROUP  STATUS          SELECTED  PATH
     another-fancy-repo     ~      clean                     /local/path/to/repo...
     mka-control-815767138  ~      clean             *       /local/path/to/repo...
    

    mkactl repo add

  • Now you're ready to actually deploy some building blocks. This is done via the block subcommand.

    # list all available building blocks
    $ mkactl block list-all
    existing building blocks:
    
     NAME                    LATEST      INSTALLED
     velero                  1.4.2
     local-path-provisioner  1.24.0
     ...
    
    # lets immediately deploy the latest elasticsearch building block
    $ mkactl block add elasticsearch -p
    

    mkactl block add

    It will take a couple minutes for the control repository's pipeline to finish but you should see those deployments appearing in your kubernetes cluster eventually.



Configuration

Have a look at the application configuration reference documentation.

If you provide configuration values via environment variables, make sure to base64 encode values for GITLAB_DEFAULTS_PASSWORD and GITLAB_DEFAULTS_TOKEN (for configurations >= v1) or GITLAB_TOKEN (for configurations with version v0).



Working with multiple gitlab accounts

Add accounts first:

# provide credentials, user and password or a token (preferred)
$ mkactl config add-account --token $TOKEN
# if you're a gitlab administrator, this would work as well
$ mkactl config new-token --user $USER --password $PASSWORD
# or edit the configuration directly, be sure to base64 encode
# passwords or tokens

Provide an account for gitlab targeting commands:

# list existing accounts
$ mkactl config list-accounts
NAME              SELECTED GITLAB-USER
account-default      *     user@org.com
account-23                 anotheruser@org.com
...
# provide account name via flag, eg
$ mkactl block add $BLOCK --account account-23
# or persistently select an account for further use
$ mkactl config select-account account-23



Roadmap

These topics are loosely planned and sketched so far. The order in which those will (if ever) be implemented might effectively turn out to be different. More input for desired functionality will possibly arrive in the coming months with the advent of MKO™.

Nevertheless, any input, feature or change request is appreciated by the MKA™ team at Syseleven GmbH


Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
git
k8s

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL