kube

package
v7.0.1-0...-b8e8e6a Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// RoleNameLabel is the recommended kube label to specify the rolename
	RoleNameLabel = "app.kubernetes.io/component"
	// AppNameLabel is to add contextual information in distributed tracing for Istio
	AppNameLabel = "app"
	// AppVersionLabel is to indicate the version of app. It is used to add contextual information in
	// distributed tracing and the metric telemetry collected by Istio
	AppVersionLabel = "version"
	// VolumeStorageClassAnnotation is the annotation label for storage/v1beta1/StorageClass
	VolumeStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class"
)

Variables

This section is empty.

Functions

func GetHelmTemplateHelpers

func GetHelmTemplateHelpers() []helm.Node

GetHelmTemplateHelpers returns the helm templates needed throughout the code.

func MakeBasicValues

func MakeBasicValues() *helm.Mapping

MakeBasicValues returns a Mapping with the default values that do not depend on any configuration. This is exported so the tests from other packages can access them.

func MakeBoshDeploymentManifestSecret

func MakeBoshDeploymentManifestSecret(settings ExportSettings) (helm.Node, error)

MakeBoshDeploymentManifestSecret generates a template for a secret that holds the content of a BOSH deployment manifest

func MakeRegistryCredentials

func MakeRegistryCredentials(settings ExportSettings) (helm.Node, error)

MakeRegistryCredentials generates a template that contains Docker Registry credentials

func MakeSecrets

func MakeSecrets(secrets model.CVMap, settings ExportSettings) (helm.Node, error)

MakeSecrets creates Secret KubeConfig filled with the key/value pairs from the specified map.

func MakeValues

func MakeValues(settings ExportSettings) helm.Node

MakeValues returns a Mapping with all default values for the Helm chart.

func NewDeployment

func NewDeployment(instanceGroup *model.InstanceGroup, settings ExportSettings, grapher util.ModelGrapher) (helm.Node, helm.Node, error)

NewDeployment creates a Deployment for the given instance group, and its attached services

func NewJob

func NewJob(instanceGroup *model.InstanceGroup, settings ExportSettings, grapher util.ModelGrapher) (helm.Node, error)

NewJob creates a new Job for the given instance group, as well as any objects it depends on

func NewPod

func NewPod(role *model.InstanceGroup, settings ExportSettings, grapher util.ModelGrapher) (helm.Node, error)

NewPod creates a new Pod for the given role, as well as any objects it depends on

func NewPodTemplate

func NewPodTemplate(role *model.InstanceGroup, settings ExportSettings, grapher util.ModelGrapher) (helm.Node, error)

NewPodTemplate creates a new pod template spec for a given role, as well as any objects it depends on

func NewRBACAccount

func NewRBACAccount(accountName string, config *model.Configuration, settings ExportSettings) ([]helm.Node, error)

NewRBACAccount creates a new (Kubernetes RBAC) service account and associated bindings.

func NewRBACPSP

func NewRBACPSP(name string, psp *model.PodSecurityPolicy, settings ExportSettings) (helm.Node, error)

NewRBACPSP creates a (Kubernetes RBAC) pod security policy

func NewRBACRole

func NewRBACRole(name string, kind RBACRoleKind, authRole model.AuthRole, settings ExportSettings) (helm.Node, error)

NewRBACRole creates a new (Kubernetes RBAC) role / cluster role

func NewServiceList

func NewServiceList(role *model.InstanceGroup, clustering bool, settings ExportSettings) (helm.Node, error)

NewServiceList creates a list of services clustering should be true if a kubernetes headless service should be created (for self-clustering roles, to reach each pod individually)

func NewStatefulSet

func NewStatefulSet(role *model.InstanceGroup, settings ExportSettings, grapher util.ModelGrapher) (helm.Node, helm.Node, error)

NewStatefulSet returns a stateful set and a list of services for the given role

Types

type ConfigBuilder

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

ConfigBuilder sets up a generic Kube resource structure with minimal metadata.

func NewConfigBuilder

func NewConfigBuilder() *ConfigBuilder

NewConfigBuilder constructs a new ConfigBuilder.

func (*ConfigBuilder) AddModifier

func (b *ConfigBuilder) AddModifier(modifier helm.NodeModifier) *ConfigBuilder

AddModifier adds a modifier to be used by the builder.

func (*ConfigBuilder) Build

func (b *ConfigBuilder) Build() (*helm.Mapping, error)

Build the final kube resource.

func (*ConfigBuilder) SetAPIVersion

func (b *ConfigBuilder) SetAPIVersion(apiVersion string) *ConfigBuilder

SetAPIVersion sets the kube API version of the resource to build.

func (*ConfigBuilder) SetConditionalAPIVersion

func (b *ConfigBuilder) SetConditionalAPIVersion(apiVersion, fallbackAPIVersion string) *ConfigBuilder

SetConditionalAPIVersion sets the kube API version of the resource to build; if that API version is not available, use a fallback instead (to be compatible with older releases of kube). If we are not building a helm chart, the desired API version is always used.

func (*ConfigBuilder) SetKind

func (b *ConfigBuilder) SetKind(kind string) *ConfigBuilder

SetKind sets the kubernetes resource kind of the resource to build.

func (*ConfigBuilder) SetName

func (b *ConfigBuilder) SetName(name string) *ConfigBuilder

SetName sets the name of the resource to build.

func (*ConfigBuilder) SetNameHelmExpression

func (b *ConfigBuilder) SetNameHelmExpression(name string) *ConfigBuilder

SetNameHelmExpression sets the name of the resource to build as a Helm template expression.

func (*ConfigBuilder) SetSettings

func (b *ConfigBuilder) SetSettings(settings *ExportSettings) *ConfigBuilder

SetSettings sets the export settings to be used by the builder.

type ExportSettings

type ExportSettings struct {
	OutputDir       string
	Repository      string
	Registry        string
	Username        string
	Password        string
	Organization    string
	UseMemoryLimits bool
	UseCPULimits    bool
	FissileVersion  string
	TagExtra        string
	RoleManifest    *model.RoleManifest
	Opinions        *model.Opinions
	CreateHelmChart bool
	AuthType        string
}

ExportSettings are configuration for creating Kubernetes configs

type RBACRoleKind

type RBACRoleKind string

RBACRoleKind enumerations are for NewRBACRole

const (
	// RBACRoleKindRole are (namespaced) roles
	RBACRoleKindRole RBACRoleKind = "Role"
	// RBACRoleKindClusterRole are cluster roles
	RBACRoleKindClusterRole RBACRoleKind = "ClusterRole"
)

Jump to

Keyboard shortcuts

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