Skip to content

Deploy multiple repositories containing Kubernetes configs with one command.

Notifications You must be signed in to change notification settings

Brickchain/k8s-deployer

Repository files navigation

k8s-deployer

Deploy multiple repositories containing Kubernetes configs with one command.

Download binary

https://s3.eu-central-1.amazonaws.com/brickchain-artifacts/k8s-deployer

Dependencies

kubectl needs to be installed and configured to connect to the cluster you want to deploy to.

Namespaces

If the namespace you specify does not exist, it will create it.

Environment variable substitution

It will run all Kubernetes configs through a template renderer before applying them,
so you can use Golang template format variables in your Kubernetes configs.

someParam: "{{ .SOME_ENV_VARIABLE }}"

Config file format

---

namespace: "{{ .CI_BUILD_REF_NAME }}"
defaultBranch: master
kubernetesFolder: "k8s/"

updateRepoVar: "CI_UPSTREAM_PROJECT_NAME"
updateRefVar: "CI_UPSTREAM_BUILD_REF"


repositories:
    - name: someservice
      uri: "git@gitlab.com:group/someservice.git"
    - name: otherservice
      uri: "git@gitlab.com:group/otherservice.git"

Usage

$ k8s-deployer -h
Usage of k8s-deployer:
  -artifact string
        Create YAML with what was deployed
  -clear-state
        Clear the state for this namespace
  -config string
        Config file
  -namespace string
        Namespace
  -redis string
        Redis state DB. Ex: localhost:6379

# deploy repos specified in config.yml and record state in redis and also write an artifact file
$ k8s-deployer -config config.yml -redis localhost:6379 -artifact state.yml

# deploy a previously recorded state to a temporary namespace
$ k8s-deployer -namespace debugging -config state.yml

About

Deploy multiple repositories containing Kubernetes configs with one command.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages