squadron

package module
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 25 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

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 {
	Args         []string `yaml:"args,omitempty"`
	Builder      string   `yaml:"builder,omitempty"`
	CacheFrom    string   `yaml:"cache_from,omitempty"`
	CacheTo      string   `yaml:"cache_to,omitempty"`
	Context      string   `yaml:"context,omitempty"`
	Dockerfile   string   `yaml:"dockerfile,omitempty"`
	ExtraHosts   []string `yaml:"extra_hosts,omitempty"`
	Image        string   `yaml:"image,omitempty"`
	IIDFile      string   `yaml:"iidfile,omitempty"`
	Labels       []string `yaml:"labels,omitempty"`
	Load         bool     `yaml:"load,omitempty"`
	MetadataFile string   `yaml:"metadata_file,omitempty"`
	Network      string   `yaml:"network,omitempty"`
	NoCache      bool     `yaml:"no_cache,omitempty"`
	Output       string   `yaml:"output,omitempty"`
	Platform     string   `yaml:"platform,omitempty"`
	Platforms    []string `yaml:"platforms,omitempty"`
	Secrets      []string `yaml:"secrets,omitempty"`
	ShmSize      string   `yaml:"shm_size,omitempty"`
	SSH          string   `yaml:"ssh,omitempty"`
	Tag          string   `yaml:"tag,omitempty"`
	Target       string   `yaml:"target,omitempty"`
	ULimit       string   `yaml:"ulimit,omitempty"`
}

func (*Build) Build

func (b *Build) Build(ctx context.Context, args []string) (string, error)

Build ...

func (*Build) Push

func (b *Build) Push(ctx context.Context, args []string) (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   Units                  `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 Units, helmArgs []string) (string, error)

func (*Squadron) Down

func (sq *Squadron) Down(ctx context.Context, units Units, 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 Units) 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) Rollback added in v1.8.0

func (sq *Squadron) Rollback(ctx context.Context, units Units, revision string, helmArgs []string) error

func (*Squadron) Status added in v1.3.1

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

func (*Squadron) Template

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

func (*Squadron) Up

func (sq *Squadron) Up(ctx context.Context, units Units, helmArgs []string, username, version, commit, branch string, parallel int) 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, args []string) (string, error)

Build ...

func (*Unit) Push

func (u *Unit) Push(ctx context.Context, squadron, unit string, args []string) (string, error)

Push ...

type Units added in v1.8.1

type Units map[string]*Unit

func (Units) Filter added in v1.8.1

func (u Units) Filter(names []string) (Units, error)

func (Units) Iterate added in v1.8.1

func (u Units) Iterate(i func(name string, unit *Unit) error) error

func (Units) Keys added in v1.8.1

func (u Units) Keys() []string

func (Units) Values added in v1.8.1

func (u Units) Values() []*Unit

Directories

Path Synopsis
cmd
example
tests

Jump to

Keyboard shortcuts

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