Documentation ¶
Index ¶
- Constants
- func GetHelmTemplateHelpers() []helm.Node
- func MakeBasicValues() *helm.Mapping
- func MakeBoshDeploymentManifestSecret(settings ExportSettings) (helm.Node, error)
- func MakeRegistryCredentials(settings ExportSettings) (helm.Node, error)
- func MakeSecrets(secrets model.CVMap, settings ExportSettings) (helm.Node, error)
- func MakeValues(settings ExportSettings) helm.Node
- func NewDeployment(instanceGroup *model.InstanceGroup, settings ExportSettings, ...) (helm.Node, helm.Node, error)
- func NewJob(instanceGroup *model.InstanceGroup, settings ExportSettings, ...) (helm.Node, error)
- func NewPod(role *model.InstanceGroup, settings ExportSettings, grapher util.ModelGrapher) (helm.Node, error)
- func NewPodTemplate(role *model.InstanceGroup, settings ExportSettings, grapher util.ModelGrapher) (helm.Node, error)
- func NewRBACAccount(accountName string, config *model.Configuration, settings ExportSettings) ([]helm.Node, error)
- func NewRBACPSP(name string, psp *model.PodSecurityPolicy, settings ExportSettings) (helm.Node, error)
- func NewRBACRole(name string, kind RBACRoleKind, authRole model.AuthRole, ...) (helm.Node, error)
- func NewServiceList(role *model.InstanceGroup, clustering bool, settings ExportSettings) (helm.Node, error)
- func NewStatefulSet(role *model.InstanceGroup, settings ExportSettings, grapher util.ModelGrapher) (helm.Node, helm.Node, error)
- type ConfigBuilder
- func (b *ConfigBuilder) AddModifier(modifier helm.NodeModifier) *ConfigBuilder
- func (b *ConfigBuilder) Build() (*helm.Mapping, error)
- func (b *ConfigBuilder) SetAPIVersion(apiVersion string) *ConfigBuilder
- func (b *ConfigBuilder) SetConditionalAPIVersion(apiVersion, fallbackAPIVersion string) *ConfigBuilder
- func (b *ConfigBuilder) SetKind(kind string) *ConfigBuilder
- func (b *ConfigBuilder) SetName(name string) *ConfigBuilder
- func (b *ConfigBuilder) SetNameHelmExpression(name string) *ConfigBuilder
- func (b *ConfigBuilder) SetSettings(settings *ExportSettings) *ConfigBuilder
- type ExportSettings
- type RBACRoleKind
Constants ¶
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 ¶
GetHelmTemplateHelpers returns the helm templates needed throughout the code.
func MakeBasicValues ¶
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 ¶
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" )