squadron

package module
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 24 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

View Source
const (
	TagMap    = "!!map"
	TagString = "!!str"
)

Variables

View Source
var ErrOnePasswordNotSignedIn = errors.New("not signed in")

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(ctx context.Context) (string, error)

Build ...

func (*Build) Push

func (b *Build) Push(ctx context.Context) (string, 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"`
}

func (*Configuration) UnmarshalYAML added in v1.3.3

func (c *Configuration) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML ...

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(ctx context.Context, units map[string]*Unit, helmArgs []string) (string, error)

func (*Squadron) Down

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

func (*Squadron) FilterConfig added in v1.3.1

func (sq *Squadron) FilterConfig(units []string) error

func (*Squadron) Generate

func (sq *Squadron) Generate(ctx context.Context, 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) Name added in v1.5.0

func (sq *Squadron) Name() string

func (*Squadron) Package

func (sq *Squadron) Package(ctx context.Context) error

func (*Squadron) RenderConfig

func (sq *Squadron) RenderConfig(ctx context.Context) error

func (*Squadron) Status added in v1.3.1

func (sq *Squadron) Status(ctx context.Context, units map[string]*Unit, helmArgs []string) error

func (*Squadron) Template

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

func (*Squadron) Up

func (sq *Squadron) Up(ctx context.Context, units map[string]*Unit, helmArgs []string, username, version, commit 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(ctx context.Context, squadron, unit string) (string, error)

Build ...

func (*Unit) Push

func (u *Unit) Push(ctx context.Context, squadron, unit string) (string, 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