squadron

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 17 Imported by: 0

README

Squadron

Go Report Card godoc goreleaser

Application for managing kubernetes microservice environments.

Use it, if a helm chart is not enough in order to organize multiple services into an effective squadron.

Another way to think of it would be helm-compose, because it makes k8s and helm way more approachable, not matter if it is development or production (where it just becomes another helm chart)

Quickstart

Configure your squadron

# squadron.yaml
version: "1.0"

squadron:
  frontend:
    chart:
      name: mychart
      version: 0.1.0
      repository: http://helm.mycompany.com/repository
    builds:
      service:
        tag: latest
        dockerfile: Dockerfile
        image: docker.mycompany.com/mycomapny/frontend
        args:
          - "foo=foo"
          - "bar=bar"
    values:
      image: docker.mycompany.com/mycomapny/frontend:latest

Install the squadron squadron and namespace:

$ squadron up --build --push --namespace default

Uninstall the squadron again:

$ squadron down

Commands

# See:
$ squadron help

Docker Buildx

To use docker buildx command define your platforms through the SQUADRON_DOCKER_BUILDX env var:

$ export SQUADRON_DOCKER_BUILDX=linux/amd64

See also

Sometimes as a sailor or a pirate you might need to get a grapple : go get github.com/foomo/gograpple/...

How to Contribute

Make a pull request...

License

Distributed under MIT License, please see license file within the code for more details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	Image      string   `yaml:"image,omitempty"`
	Tag        string   `yaml:"tag,omitempty"`
	Context    string   `yaml:"context,omitempty"`
	Dockerfile string   `yaml:"dockerfile,omitempty"`
	Args       []string `yaml:"args,omitempty"`
	Secrets    []string `yaml:"secrets,omitempty"`
	Labels     []string `yaml:"labels,omitempty"`
	CacheFrom  []string `yaml:"cache_from,omitempty"`
	Network    string   `yaml:"network,omitempty"`
	Target     string   `yaml:"target,omitempty"`
	ShmSize    string   `yaml:"shm_size,omitempty"`
	ExtraHosts []string `yaml:"extra_hosts,omitempty"`
	Isolation  string   `yaml:"isolation,omitempty"`
}

func (*Build) Build

func (b *Build) Build() error

Build ...

func (*Build) Push

func (b *Build) Push() error

Push ...

func (*Build) UnmarshalYAML

func (b *Build) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML ...

type Chart

type Chart struct {
	APIVersion   string            `yaml:"apiVersion"`
	Name         string            `yaml:"name,omitempty"`
	Description  string            `yaml:"description,omitempty"`
	Type         string            `yaml:"type,omitempty"`
	Version      string            `yaml:"version,omitempty"`
	Dependencies []ChartDependency `yaml:"dependencies,omitempty"`
}

type ChartDependency

type ChartDependency struct {
	Name       string `yaml:"name,omitempty"`
	Repository string `yaml:"repository,omitempty"`
	Version    string `yaml:"version,omitempty"`
	Alias      string `yaml:"alias,omitempty"`
}

func (*ChartDependency) UnmarshalYAML

func (cd *ChartDependency) UnmarshalYAML(value *yaml.Node) error

type Configuration

type Configuration struct {
	Name    string                 `yaml:"name,omitempty"`
	Version string                 `yaml:"version,omitempty"`
	Prefix  string                 `yaml:"prefix,omitempty"`
	Unite   bool                   `yaml:"unite,omitempty"`
	Global  map[string]interface{} `yaml:"global,omitempty"`
	Units   map[string]Unit        `yaml:"squadron,omitempty"`
}

type Squadron

type Squadron struct {
	// contains filtered or unexported fields
}

func New

func New(basePath, namespace string, files []string) *Squadron

func (*Squadron) Diff

func (sq *Squadron) Diff(units map[string]Unit, helmArgs []string) (string, error)

func (*Squadron) Down

func (sq *Squadron) Down(units map[string]Unit, helmArgs []string) error

func (*Squadron) Generate

func (sq *Squadron) Generate(units map[string]Unit) error

func (*Squadron) GetConfig

func (sq *Squadron) GetConfig() Configuration

func (*Squadron) GetConfigYAML

func (sq *Squadron) GetConfigYAML() string

func (*Squadron) MergeConfigFiles

func (sq *Squadron) MergeConfigFiles() error

func (*Squadron) Package

func (sq *Squadron) Package() error

func (*Squadron) RenderConfig

func (sq *Squadron) RenderConfig() error

func (*Squadron) Template

func (sq *Squadron) Template(units map[string]Unit, helmArgs []string) error

func (*Squadron) Up

func (sq *Squadron) Up(units map[string]Unit, helmArgs []string) error

type TemplateVars

type TemplateVars map[string]interface{}

type Unit

type Unit struct {
	Chart  ChartDependency        `yaml:"chart,omitempty"`
	Builds map[string]Build       `yaml:"builds,omitempty"`
	Values map[string]interface{} `yaml:"values,omitempty"`
}

func (*Unit) Build

func (u *Unit) Build() error

Build ...

func (*Unit) Push

func (u *Unit) Push() error

Push ...

Directories

Path Synopsis
cmd
example
helloworld/app command
tests

Jump to

Keyboard shortcuts

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