helm

package
v0.0.0-...-7754ea6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchChartValues

func FetchChartValues(actionRunner HelmActionsRunner, namespace, name string, settings *helmCLI.EnvSettings, uiLogger action.DebugLog) (map[string]interface{}, error)

FetchChartValues will attempt to fetch the values from the currently installed Helm chart.

func InitActionConfig

func InitActionConfig(actionConfig *action.Configuration, namespace string, settings *helmCLI.EnvSettings, logger action.DebugLog) (*action.Configuration, error)

InitActionConfig initializes a Helm Go SDK action configuration. This function currently uses a hack to override the namespace field that gets set in the K8s client set up by the SDK.

func InstallDemoApp

func InstallDemoApp(options *InstallOptions) error

InstallDemoApp will perform the following actions - Print out the installation summary. - Setup action configuration for Helm Go SDK function calls. - Setup the installation action. - Load the Helm chart. - Run the install.

func InstallHelmRelease

func InstallHelmRelease(options *InstallOptions) error

InstallHelmRelease handles downloading the embedded helm chart, loading the values and runnning the Helm install command.

func LoadChart

func LoadChart(chart embed.FS, chartDirName string) (*chart.Chart, error)

LoadChart will attempt to load a Helm chart from the embedded file system.

func UpgradeHelmRelease

func UpgradeHelmRelease(options *UpgradeOptions) error

UpgradeHelmRelease handles downloading the embedded helm chart, loading the values, showing the diff between new and installed values, and runnning the Helm install command.

Types

type ACLInjectToken

type ACLInjectToken struct {
	SecretName interface{} `yaml:"secretName"`
	SecretKey  interface{} `yaml:"secretKey"`
}

type ACLSyncToken

type ACLSyncToken struct {
	SecretName interface{} `yaml:"secretName"`
	SecretKey  interface{} `yaml:"secretKey"`
}

type ACLToken

type ACLToken struct {
	SecretName interface{} `yaml:"secretName"`
	SecretKey  interface{} `yaml:"secretKey"`
}

type APIGateway

type APIGateway struct {
	Enabled             bool                 `yaml:"enabled"`
	Image               interface{}          `yaml:"image"`
	LogLevel            string               `yaml:"logLevel"`
	ManagedGatewayClass ManagedGatewayClass  `yaml:"managedGatewayClass"`
	ConsulNamespaces    ConsulNamespaces     `yaml:"consulNamespaces"`
	ServiceAccount      ServiceAccount       `yaml:"serviceAccount"`
	Controller          APIGatewayController `yaml:"controller"`
}

type APIGatewayController

type APIGatewayController struct {
	Replicas          int         `yaml:"replicas"`
	Annotations       interface{} `yaml:"annotations"`
	PriorityClassName string      `yaml:"priorityClassName"`
	NodeSelector      interface{} `yaml:"nodeSelector"`
	Service           Service     `yaml:"service"`
}

type Acls

type Acls struct {
	ManageSystemACLs       bool             `yaml:"manageSystemACLs"`
	BootstrapToken         BootstrapToken   `yaml:"bootstrapToken"`
	CreateReplicationToken bool             `yaml:"createReplicationToken"`
	ReplicationToken       ReplicationToken `yaml:"replicationToken"`
}

type ActionRunner

type ActionRunner struct{}

ActionRunner is the implementation of HelmActionsRunner interface that truly calls Helm sdk functions and requires a real Kubernetes cluster. It is the non-mock implementation of HelmActionsRunner that is used in the CLI.

func (*ActionRunner) CheckForInstallations

func (h *ActionRunner) CheckForInstallations(options *CheckForInstallationsOptions) (bool, string, string, error)

CheckForInstallations uses the helm Go SDK to find helm releases in all namespaces where the chart name is "consul", and returns the release name and namespace if found, or an error if not found.

func (*ActionRunner) GetStatus

func (h *ActionRunner) GetStatus(status *action.Status, name string) (*release.Release, error)

func (*ActionRunner) Install

func (h *ActionRunner) Install(install *action.Install, chrt *chart.Chart, vals map[string]interface{}) (*release.Release, error)

func (*ActionRunner) LoadChart

func (h *ActionRunner) LoadChart(chart embed.FS, chartDirName string) (*chart.Chart, error)

func (*ActionRunner) Uninstall

func (h *ActionRunner) Uninstall(uninstall *action.Uninstall, name string) (*release.UninstallReleaseResponse, error)

func (*ActionRunner) Upgrade

func (h *ActionRunner) Upgrade(upgrade *action.Upgrade, name string, chart *chart.Chart, vals map[string]interface{}) (*release.Release, error)

type AdminPartitions

type AdminPartitions struct {
	Enabled bool                   `yaml:"enabled"`
	Name    string                 `yaml:"name"`
	Service AdminPartitionsService `yaml:"service"`
}

type AdminPartitionsService

type AdminPartitionsService struct {
	Type        string      `yaml:"type"`
	NodePort    NodePort    `yaml:"nodePort"`
	Annotations interface{} `yaml:"annotations"`
}

type BootstrapToken

type BootstrapToken struct {
	SecretName interface{} `yaml:"secretName"`
	SecretKey  interface{} `yaml:"secretKey"`
}

type Ca

type Ca struct {
	SecretName string `yaml:"secretName"`
	SecretKey  string `yaml:"secretKey"`
}

type CaCert

type CaCert struct {
	SecretName string `yaml:"secretName"`
	SecretKey  string `yaml:"secretKey"`
}

type CaKey

type CaKey struct {
	SecretName string `yaml:"secretName"`
	SecretKey  string `yaml:"secretKey"`
}

type CheckForInstallationsOptions

type CheckForInstallationsOptions struct {
	Settings              *helmCLI.EnvSettings
	ReleaseName           string
	DebugLog              action.DebugLog
	SkipErrorWhenNotFound bool
}

type Client

type Client struct {
	Enabled                  string                         `yaml:"enabled"`
	Image                    interface{}                    `yaml:"image"`
	Join                     interface{}                    `yaml:"join"`
	DataDirectoryHostPath    interface{}                    `yaml:"dataDirectoryHostPath"`
	Grpc                     bool                           `yaml:"grpc"`
	NodeMeta                 NodeMeta                       `yaml:"nodeMeta"`
	ExposeGossipPorts        bool                           `yaml:"exposeGossipPorts"`
	ServiceAccount           ServiceAccount                 `yaml:"serviceAccount"`
	Resources                Resources                      `yaml:"resources"`
	SecurityContext          SecurityContext                `yaml:"securityContext"`
	ContainerSecurityContext ClientContainerSecurityContext `yaml:"containerSecurityContext"`
	ExtraConfig              string                         `yaml:"extraConfig"`
	ExtraVolumes             []interface{}                  `yaml:"extraVolumes"`
	ExtraContainers          []interface{}                  `yaml:"extraContainers"`
	Tolerations              string                         `yaml:"tolerations"`
	NodeSelector             interface{}                    `yaml:"nodeSelector"`
	Affinity                 interface{}                    `yaml:"affinity"`
	PriorityClassName        string                         `yaml:"priorityClassName"`
	Annotations              interface{}                    `yaml:"annotations"`
	ExtraLabels              interface{}                    `yaml:"extraLabels"`
	ExtraEnvironmentVars     ExtraEnvironmentVars           `yaml:"extraEnvironmentVars"`
	DNSPolicy                interface{}                    `yaml:"dnsPolicy"`
	HostNetwork              bool                           `yaml:"hostNetwork"`
	UpdateStrategy           interface{}                    `yaml:"updateStrategy"`
	SnapshotAgent            SnapshotAgent                  `yaml:"snapshotAgent"`
}

type ClientContainerSecurityContext

type ClientContainerSecurityContext struct {
	Client  interface{} `yaml:"client"`
	ACLInit interface{} `yaml:"aclInit"`
	TLSInit interface{} `yaml:"tlsInit"`
}

type ConfigSecret

type ConfigSecret struct {
	SecretName interface{} `yaml:"secretName"`
	SecretKey  interface{} `yaml:"secretKey"`
}

type ConnectCA

type ConnectCA struct {
	Address             string `yaml:"address"`
	AuthMethodPath      string `yaml:"authMethodPath"`
	RootPKIPath         string `yaml:"rootPKIPath"`
	IntermediatePKIPath string `yaml:"intermediatePKIPath"`
	AdditionalConfig    string `yaml:"additionalConfig"`
}

type ConnectInject

type ConnectInject struct {
	Enabled                bool             `yaml:"enabled"`
	Replicas               int              `yaml:"replicas"`
	Image                  interface{}      `yaml:"image"`
	Default                bool             `yaml:"default"`
	TransparentProxy       TransparentProxy `yaml:"transparentProxy"`
	Metrics                Metrics          `yaml:"metrics"`
	EnvoyExtraArgs         interface{}      `yaml:"envoyExtraArgs"`
	PriorityClassName      string           `yaml:"priorityClassName"`
	ImageConsul            interface{}      `yaml:"imageConsul"`
	LogLevel               string           `yaml:"logLevel"`
	ServiceAccount         ServiceAccount   `yaml:"serviceAccount"`
	Resources              Resources        `yaml:"resources"`
	FailurePolicy          string           `yaml:"failurePolicy"`
	NamespaceSelector      string           `yaml:"namespaceSelector"`
	K8SAllowNamespaces     []string         `yaml:"k8sAllowNamespaces"`
	K8SDenyNamespaces      []interface{}    `yaml:"k8sDenyNamespaces"`
	ConsulNamespaces       ConsulNamespaces `yaml:"consulNamespaces"`
	NodeSelector           interface{}      `yaml:"nodeSelector"`
	Affinity               interface{}      `yaml:"affinity"`
	Tolerations            interface{}      `yaml:"tolerations"`
	ACLBindingRuleSelector string           `yaml:"aclBindingRuleSelector"`
	OverrideAuthMethodName string           `yaml:"overrideAuthMethodName"`
	ACLInjectToken         ACLInjectToken   `yaml:"aclInjectToken"`
	SidecarProxy           SidecarProxy     `yaml:"sidecarProxy"`
	InitContainer          InitContainer    `yaml:"initContainer"`
}

type ConsulNamespaces

type ConsulNamespaces struct {
	ConsulDestinationNamespace string `yaml:"consulDestinationNamespace"`
	MirroringK8S               bool   `yaml:"mirroringK8S"`
	MirroringK8SPrefix         string `yaml:"mirroringK8SPrefix"`
}

type ContainerSecurityContext

type ContainerSecurityContext struct {
	Server interface{} `yaml:"server"`
}

type Controller

type Controller struct {
	Enabled           bool           `yaml:"enabled"`
	Replicas          int            `yaml:"replicas"`
	LogLevel          string         `yaml:"logLevel"`
	ServiceAccount    ServiceAccount `yaml:"serviceAccount"`
	Resources         Resources      `yaml:"resources"`
	NodeSelector      interface{}    `yaml:"nodeSelector"`
	Tolerations       interface{}    `yaml:"tolerations"`
	Affinity          interface{}    `yaml:"affinity"`
	PriorityClassName string         `yaml:"priorityClassName"`
	ACLToken          ACLToken       `yaml:"aclToken"`
}

type CopyAnnotations

type CopyAnnotations struct {
	Service interface{} `yaml:"service"`
}

type DNS

type DNS struct {
	Enabled           string      `yaml:"enabled"`
	EnableRedirection bool        `yaml:"enableRedirection"`
	Type              string      `yaml:"type"`
	ClusterIP         interface{} `yaml:"clusterIP"`
	Annotations       interface{} `yaml:"annotations"`
	AdditionalSpec    interface{} `yaml:"additionalSpec"`
}

type DashboardURLTemplates

type DashboardURLTemplates struct {
	Service string `yaml:"service"`
}

type Defaults

type Defaults struct {
	Replicas          int            `yaml:"replicas"`
	ExtraVolumes      []interface{}  `yaml:"extraVolumes"`
	Resources         Resources      `yaml:"resources"`
	Affinity          string         `yaml:"affinity"`
	Tolerations       interface{}    `yaml:"tolerations"`
	NodeSelector      interface{}    `yaml:"nodeSelector"`
	PriorityClassName string         `yaml:"priorityClassName"`
	Annotations       interface{}    `yaml:"annotations"`
	ServiceAccount    ServiceAccount `yaml:"serviceAccount"`
	ConsulNamespace   string         `yaml:"consulNamespace"`
}

type DefaultsService

type DefaultsService struct {
	Type           string         `yaml:"type"`
	Ports          []ServicePorts `yaml:"ports"`
	Annotations    interface{}    `yaml:"annotations"`
	AdditionalSpec interface{}    `yaml:"additionalSpec"`
}

type DisruptionBudget

type DisruptionBudget struct {
	Enabled        bool        `yaml:"enabled"`
	MaxUnavailable interface{} `yaml:"maxUnavailable"`
}

type EnterpriseLicense

type EnterpriseLicense struct {
	SecretName            string `yaml:"secretName"`
	SecretKey             string `yaml:"secretKey"`
	EnableLicenseAutoload bool   `yaml:"enableLicenseAutoload"`
}

type ExternalServers

type ExternalServers struct {
	Enabled           bool          `yaml:"enabled"`
	Hosts             []interface{} `yaml:"hosts"`
	HTTPSPort         int           `yaml:"httpsPort"`
	TLSServerName     interface{}   `yaml:"tlsServerName"`
	UseSystemRoots    bool          `yaml:"useSystemRoots"`
	K8SAuthMethodHost interface{}   `yaml:"k8sAuthMethodHost"`
}

type ExtraEnvironmentVars

type ExtraEnvironmentVars struct {
}

type Federation

type Federation struct {
	Enabled                bool          `yaml:"enabled"`
	CreateFederationSecret bool          `yaml:"createFederationSecret"`
	PrimaryDatacenter      string        `yaml:"primaryDatacenter"`
	PrimaryGateways        []interface{} `yaml:"primaryGateways"`
}

type Gateways

type Gateways struct {
	Name string `yaml:"name"`
}

type Global

type Global struct {
	Enabled                   bool              `yaml:"enabled"`
	LogLevel                  string            `yaml:"logLevel"`
	LogJSON                   bool              `yaml:"logJSON"`
	Name                      interface{}       `yaml:"name"`
	Domain                    string            `yaml:"domain"`
	AdminPartitions           AdminPartitions   `yaml:"adminPartitions"`
	Image                     string            `yaml:"image"`
	ImagePullSecrets          []interface{}     `yaml:"imagePullSecrets"`
	ImageK8S                  string            `yaml:"imageK8S"`
	Datacenter                string            `yaml:"datacenter"`
	EnablePodSecurityPolicies bool              `yaml:"enablePodSecurityPolicies"`
	SecretsBackend            SecretsBackend    `yaml:"secretsBackend"`
	GossipEncryption          GossipEncryption  `yaml:"gossipEncryption"`
	Recursors                 []interface{}     `yaml:"recursors"`
	TLS                       TLS               `yaml:"tls"`
	EnableConsulNamespaces    bool              `yaml:"enableConsulNamespaces"`
	Acls                      Acls              `yaml:"acls"`
	EnterpriseLicense         EnterpriseLicense `yaml:"enterpriseLicense"`
	Federation                Federation        `yaml:"federation"`
	Metrics                   GlobalMetrics     `yaml:"metrics"`
	ImageEnvoy                string            `yaml:"imageEnvoy"`
	Openshift                 Openshift         `yaml:"openshift"`
}

type GlobalMetrics

type GlobalMetrics struct {
	Enabled                   bool   `yaml:"enabled"`
	EnableAgentMetrics        bool   `yaml:"enableAgentMetrics"`
	AgentMetricsRetentionTime string `yaml:"agentMetricsRetentionTime"`
	EnableGatewayMetrics      bool   `yaml:"enableGatewayMetrics"`
}

type GossipEncryption

type GossipEncryption struct {
	AutoGenerate bool   `yaml:"autoGenerate"`
	SecretName   string `yaml:"secretName"`
	SecretKey    string `yaml:"secretKey"`
}

type HelmActionsRunner

type HelmActionsRunner interface {
	// A thin wrapper around the Helm list function.
	CheckForInstallations(options *CheckForInstallationsOptions) (bool, string, string, error)
	// A thin wrapper around the Helm status function.
	GetStatus(status *action.Status, name string) (*release.Release, error)
	// A thin wrapper around the Helm install function.
	Install(install *action.Install, chrt *chart.Chart, vals map[string]interface{}) (*release.Release, error)
	// A thin wrapper around the LoadChart function in consul-k8s CLI that reads the charts withing the embedded fle system.
	LoadChart(chart embed.FS, chartDirName string) (*chart.Chart, error)
	// A thin wrapper around the Helm uninstall function.
	Uninstall(uninstall *action.Uninstall, name string) (*release.UninstallReleaseResponse, error)
	// A thin wrapper around the Helm upgrade function.
	Upgrade(upgrade *action.Upgrade, name string, chart *chart.Chart, vals map[string]interface{}) (*release.Release, error)
}

HelmActionsRunner is a thin interface over existing Helm actions that normally require a Kubernetes cluster. This interface allows us to mock it in tests and get better coverage of CLI commands.

type Ingress

type Ingress struct {
	Enabled          bool          `yaml:"enabled"`
	IngressClassName string        `yaml:"ingressClassName"`
	PathType         string        `yaml:"pathType"`
	Hosts            []interface{} `yaml:"hosts"`
	TLS              []interface{} `yaml:"tls"`
	Annotations      interface{}   `yaml:"annotations"`
}

type IngressGatewayDefaults

type IngressGatewayDefaults struct {
	Replicas                      int             `yaml:"replicas"`
	Service                       DefaultsService `yaml:"service"`
	ServiceAccount                ServiceAccount  `yaml:"serviceAccount"`
	Resources                     Resources       `yaml:"resources"`
	Affinity                      string          `yaml:"affinity"`
	Tolerations                   interface{}     `yaml:"tolerations"`
	NodeSelector                  interface{}     `yaml:"nodeSelector"`
	PriorityClassName             string          `yaml:"priorityClassName"`
	TerminationGracePeriodSeconds int             `yaml:"terminationGracePeriodSeconds"`
	Annotations                   interface{}     `yaml:"annotations"`
	ConsulNamespace               string          `yaml:"consulNamespace"`
}

type IngressGateways

type IngressGateways struct {
	Enabled  bool                   `yaml:"enabled"`
	Defaults IngressGatewayDefaults `yaml:"defaults"`
	Gateways []Gateways             `yaml:"gateways"`
}

type InitContainer

type InitContainer struct {
	Resources Resources `yaml:"resources"`
}

type InitServiceInitContainer

type InitServiceInitContainer struct {
	Resources Resources `yaml:"resources"`
}

type InstallOptions

type InstallOptions struct {
	// ReleaseName is the name of the Helm release to be installed.
	ReleaseName string
	// ReleaseType is the helm upgrade type - consul vs consul-demo.
	ReleaseType string
	// Namespace is the Kubernetes namespace where the release is to be
	// installed.
	Namespace string
	// Values the Helm chart values in a map form.
	Values map[string]interface{}
	// Settings is the Helm CLI environment settings.
	Settings *helmCLI.EnvSettings
	// Embedded chart specifies the Consul or Consul Demo Helm chart that has
	// been embedded into the consul-k8s CLI.
	EmbeddedChart embed.FS
	// ChartDirName is the top level directory name fo the EmbeddedChart.
	ChartDirName string
	// UILogger is a DebugLog used to return messages from Helm to the UI.
	UILogger action.DebugLog
	// DryRun specifies whether the install/upgrade should actually modify the
	// Kubernetes cluster.
	DryRun bool
	// AutoApprove will bypass any terminal prompts with an automatic yes.
	AutoApprove bool
	// Wait specifies whether the Helm install should wait until all pods
	// are ready.
	Wait bool
	// Timeout is the duration that Helm will wait for the command to complete
	// before it throws an error.
	Timeout time.Duration
	// UI is the terminal output representation that is used to prompt the user
	// and output messages.
	UI terminal.UI
	// HelmActionsRunner is a thin interface around Helm actions for install,
	// upgrade, and uninstall.
	HelmActionsRunner HelmActionsRunner
}

InstallOptions is used when calling InstallHelmRelease.

type Lifecycle

type Lifecycle struct {
	DefaultEnabled                      bool   `yaml:"defaultEnabled"`
	DefaultEnableShutdownDrainListeners bool   `yaml:"defaultEnableShutdownDrainListeners"`
	DefaultShutdownGracePeriodSeconds   int    `yaml:"defaultShutdownGracePeriodSeconds"`
	DefaultGracefulPort                 int    `yaml:"defaultGracefulPort"`
	DefaultGracefulShutdownPath         string `yaml:"defaultGracefulShutdownPath"`
	DefaultStartupGracePeriodSeconds    int    `yaml:"defaultStartupGracePeriodSeconds"`
	DefaultGracefulStartupPath          string `yaml:"defaultGracefulStartupPath"`
}

type Limits

type Limits struct {
	Memory string `yaml:"memory"`
	CPU    string `yaml:"cpu"`
}

type ManagedGatewayClass

type ManagedGatewayClass struct {
	Enabled                     bool            `yaml:"enabled"`
	NodeSelector                interface{}     `yaml:"nodeSelector"`
	ServiceType                 string          `yaml:"serviceType"`
	UseHostPorts                bool            `yaml:"useHostPorts"`
	CopyAnnotations             CopyAnnotations `yaml:"copyAnnotations"`
	OpenshiftSCCName            string          `yaml:"openshiftSCCName"`
	MapPrivilegedContainerPorts int             `yaml:"mapPrivilegedContainerPorts"`
}

type MeshGateway

type MeshGateway struct {
	Enabled                  bool                     `yaml:"enabled"`
	Replicas                 int                      `yaml:"replicas"`
	WanAddress               WanAddress               `yaml:"wanAddress"`
	Service                  Service                  `yaml:"service"`
	HostNetwork              bool                     `yaml:"hostNetwork"`
	DNSPolicy                interface{}              `yaml:"dnsPolicy"`
	ConsulServiceName        string                   `yaml:"consulServiceName"`
	ContainerPort            int                      `yaml:"containerPort"`
	HostPort                 interface{}              `yaml:"hostPort"`
	ServiceAccount           ServiceAccount           `yaml:"serviceAccount"`
	Resources                Resources                `yaml:"resources"`
	InitServiceInitContainer InitServiceInitContainer `yaml:"initServiceInitContainer"`
	Affinity                 string                   `yaml:"affinity"`
	Tolerations              interface{}              `yaml:"tolerations"`
	NodeSelector             interface{}              `yaml:"nodeSelector"`
	PriorityClassName        string                   `yaml:"priorityClassName"`
	Annotations              interface{}              `yaml:"annotations"`
}

type Metrics

type Metrics struct {
	DefaultEnabled              bool   `yaml:"defaultEnabled"`
	DefaultEnableMerging        bool   `yaml:"defaultEnableMerging"`
	DefaultMergedMetricsPort    int    `yaml:"defaultMergedMetricsPort"`
	DefaultPrometheusScrapePort int    `yaml:"defaultPrometheusScrapePort"`
	DefaultPrometheusScrapePath string `yaml:"defaultPrometheusScrapePath"`
}

type MockActionRunner

type MockActionRunner struct {
	CheckForInstallationsFunc         func(options *CheckForInstallationsOptions) (bool, string, string, error)
	GetStatusFunc                     func(status *action.Status, name string) (*release.Release, error)
	InstallFunc                       func(install *action.Install, chrt *chart.Chart, vals map[string]interface{}) (*release.Release, error)
	LoadChartFunc                     func(chrt embed.FS, chartDirName string) (*chart.Chart, error)
	UninstallFunc                     func(uninstall *action.Uninstall, name string) (*release.UninstallReleaseResponse, error)
	UpgradeFunc                       func(upgrade *action.Upgrade, name string, chart *chart.Chart, vals map[string]interface{}) (*release.Release, error)
	CheckedForConsulInstallations     bool
	CheckedForConsulDemoInstallations bool
	GotStatusConsulRelease            bool
	GotStatusConsulDemoRelease        bool
	ConsulInstalled                   bool
	ConsulUninstalled                 bool
	ConsulUpgraded                    bool
	ConsulDemoInstalled               bool
	ConsulDemoUninstalled             bool
	ConsulDemoUpgraded                bool
}

func (*MockActionRunner) CheckForInstallations

func (m *MockActionRunner) CheckForInstallations(options *CheckForInstallationsOptions) (bool, string, string, error)

func (*MockActionRunner) GetStatus

func (m *MockActionRunner) GetStatus(status *action.Status, name string) (*release.Release, error)

func (*MockActionRunner) Install

func (m *MockActionRunner) Install(install *action.Install, chrt *chart.Chart, vals map[string]interface{}) (*release.Release, error)

func (*MockActionRunner) LoadChart

func (m *MockActionRunner) LoadChart(chrt embed.FS, chartDirName string) (*chart.Chart, error)

func (*MockActionRunner) Uninstall

func (m *MockActionRunner) Uninstall(uninstall *action.Uninstall, name string) (*release.UninstallReleaseResponse, error)

func (*MockActionRunner) Upgrade

func (m *MockActionRunner) Upgrade(upgrade *action.Upgrade, name string, chrt *chart.Chart, vals map[string]interface{}) (*release.Release, error)

type NodeMeta

type NodeMeta struct {
	PodName string `yaml:"pod-name"`
	HostIP  string `yaml:"host-ip"`
}

type NodePort

type NodePort struct {
	RPC   interface{} `yaml:"rpc"`
	Serf  interface{} `yaml:"serf"`
	HTTPS interface{} `yaml:"https"`
}

type Openshift

type Openshift struct {
	Enabled bool `yaml:"enabled"`
}

type Port

type Port struct {
	HTTP  int `yaml:"http"`
	HTTPS int `yaml:"https"`
}

type Ports

type Ports struct {
	Serflan Serflan `yaml:"serflan"`
}

type Prometheus

type Prometheus struct {
	Enabled bool `yaml:"enabled"`
}

type ReplicationToken

type ReplicationToken struct {
	SecretName string `yaml:"secretName"`
	SecretKey  string `yaml:"secretKey"`
}

type Requests

type Requests struct {
	Memory string `yaml:"memory"`
	CPU    string `yaml:"cpu"`
}

type Resources

type Resources struct {
	Requests Requests `yaml:"requests"`
	Limits   Limits   `yaml:"limits"`
}

type SecretsBackend

type SecretsBackend struct {
	Vault Vault `yaml:"vault"`
}

type SecurityContext

type SecurityContext struct {
	RunAsNonRoot bool `yaml:"runAsNonRoot"`
	RunAsGroup   int  `yaml:"runAsGroup"`
	RunAsUser    int  `yaml:"runAsUser"`
	FsGroup      int  `yaml:"fsGroup"`
}

type Serflan

type Serflan struct {
	Port int `yaml:"port"`
}

type Server

type Server struct {
	Enabled                   string                   `yaml:"enabled"`
	Image                     interface{}              `yaml:"image"`
	Replicas                  int                      `yaml:"replicas"`
	BootstrapExpect           interface{}              `yaml:"bootstrapExpect"`
	ServerCert                ServerCert               `yaml:"serverCert"`
	ExposeGossipAndRPCPorts   bool                     `yaml:"exposeGossipAndRPCPorts"`
	Ports                     Ports                    `yaml:"ports"`
	Storage                   string                   `yaml:"storage"`
	StorageClass              interface{}              `yaml:"storageClass"`
	Connect                   bool                     `yaml:"connect"`
	ServiceAccount            ServiceAccount           `yaml:"serviceAccount"`
	Resources                 Resources                `yaml:"resources"`
	SecurityContext           SecurityContext          `yaml:"securityContext"`
	ContainerSecurityContext  ContainerSecurityContext `yaml:"containerSecurityContext"`
	UpdatePartition           int                      `yaml:"updatePartition"`
	DisruptionBudget          DisruptionBudget         `yaml:"disruptionBudget"`
	ExtraConfig               string                   `yaml:"extraConfig"`
	ExtraVolumes              []interface{}            `yaml:"extraVolumes"`
	ExtraContainers           []interface{}            `yaml:"extraContainers"`
	Affinity                  string                   `yaml:"affinity"`
	Tolerations               string                   `yaml:"tolerations"`
	TopologySpreadConstraints string                   `yaml:"topologySpreadConstraints"`
	NodeSelector              interface{}              `yaml:"nodeSelector"`
	PriorityClassName         string                   `yaml:"priorityClassName"`
	ExtraLabels               interface{}              `yaml:"extraLabels"`
	Annotations               interface{}              `yaml:"annotations"`
	Service                   ServerService            `yaml:"service"`
	ExtraEnvironmentVars      ExtraEnvironmentVars     `yaml:"extraEnvironmentVars"`
}

type ServerCert

type ServerCert struct {
	SecretName interface{} `yaml:"secretName"`
}

type ServerService

type ServerService struct {
	Annotations interface{} `yaml:"annotations"`
}

type Service

type Service struct {
	Annotations interface{} `yaml:"annotations"`
}

type ServiceAccount

type ServiceAccount struct {
	Annotations interface{} `yaml:"annotations"`
}

type ServiceNodePort

type ServiceNodePort struct {
	HTTP  interface{} `yaml:"http"`
	HTTPS interface{} `yaml:"https"`
}

type ServicePorts

type ServicePorts struct {
	Port     int         `yaml:"port"`
	NodePort interface{} `yaml:"nodePort"`
}

type SidecarProxy

type SidecarProxy struct {
	Resources Resources `yaml:"resources"`
	Lifecycle Lifecycle `yaml:"lifecycle"`
}

type SnapshotAgent

type SnapshotAgent struct {
	Enabled        bool           `yaml:"enabled"`
	Replicas       int            `yaml:"replicas"`
	ConfigSecret   ConfigSecret   `yaml:"configSecret"`
	ServiceAccount ServiceAccount `yaml:"serviceAccount"`
	Resources      Resources      `yaml:"resources"`
	CaCert         interface{}    `yaml:"caCert"`
}

type SyncCatalog

type SyncCatalog struct {
	Enabled               bool             `yaml:"enabled"`
	Image                 interface{}      `yaml:"image"`
	Default               bool             `yaml:"default"`
	PriorityClassName     string           `yaml:"priorityClassName"`
	ToConsul              bool             `yaml:"toConsul"`
	ToK8S                 bool             `yaml:"toK8S"`
	K8SPrefix             interface{}      `yaml:"k8sPrefix"`
	K8SAllowNamespaces    []string         `yaml:"k8sAllowNamespaces"`
	K8SDenyNamespaces     []string         `yaml:"k8sDenyNamespaces"`
	K8SSourceNamespace    interface{}      `yaml:"k8sSourceNamespace"`
	ConsulNamespaces      ConsulNamespaces `yaml:"consulNamespaces"`
	AddK8SNamespaceSuffix bool             `yaml:"addK8SNamespaceSuffix"`
	ConsulPrefix          interface{}      `yaml:"consulPrefix"`
	K8STag                interface{}      `yaml:"k8sTag"`
	ConsulNodeName        string           `yaml:"consulNodeName"`
	SyncClusterIPServices bool             `yaml:"syncClusterIPServices"`
	NodePortSyncType      string           `yaml:"nodePortSyncType"`
	ACLSyncToken          ACLSyncToken     `yaml:"aclSyncToken"`
	NodeSelector          interface{}      `yaml:"nodeSelector"`
	Affinity              interface{}      `yaml:"affinity"`
	Tolerations           interface{}      `yaml:"tolerations"`
	ServiceAccount        ServiceAccount   `yaml:"serviceAccount"`
	Resources             Resources        `yaml:"resources"`
	LogLevel              string           `yaml:"logLevel"`
	ConsulWriteInterval   interface{}      `yaml:"consulWriteInterval"`
	ExtraLabels           interface{}      `yaml:"extraLabels"`
}

type TLS

type TLS struct {
	Enabled                 bool          `yaml:"enabled"`
	EnableAutoEncrypt       bool          `yaml:"enableAutoEncrypt"`
	ServerAdditionalDNSSANs []interface{} `yaml:"serverAdditionalDNSSANs"`
	ServerAdditionalIPSANs  []interface{} `yaml:"serverAdditionalIPSANs"`
	Verify                  bool          `yaml:"verify"`
	HTTPSOnly               bool          `yaml:"httpsOnly"`
	CaCert                  CaCert        `yaml:"caCert"`
	CaKey                   CaKey         `yaml:"caKey"`
}

type TerminatingGateways

type TerminatingGateways struct {
	Enabled  bool       `yaml:"enabled"`
	Defaults Defaults   `yaml:"defaults"`
	Gateways []Gateways `yaml:"gateways"`
}

type Tests

type Tests struct {
	Enabled bool `yaml:"enabled"`
}

type TransparentProxy

type TransparentProxy struct {
	DefaultEnabled         bool `yaml:"defaultEnabled"`
	DefaultOverwriteProbes bool `yaml:"defaultOverwriteProbes"`
}

type UI

type UI struct {
	Enabled               string                `yaml:"enabled"`
	Service               UIService             `yaml:"service"`
	Ingress               Ingress               `yaml:"ingress"`
	Metrics               UIMetrics             `yaml:"metrics"`
	DashboardURLTemplates DashboardURLTemplates `yaml:"dashboardURLTemplates"`
}

type UIMetrics

type UIMetrics struct {
	Enabled  string `yaml:"enabled"`
	Provider string `yaml:"provider"`
	BaseURL  string `yaml:"baseURL"`
}

type UIService

type UIService struct {
	Enabled        bool            `yaml:"enabled"`
	Type           interface{}     `yaml:"type"`
	Port           Port            `yaml:"port"`
	NodePort       ServiceNodePort `yaml:"nodePort"`
	Annotations    interface{}     `yaml:"annotations"`
	AdditionalSpec interface{}     `yaml:"additionalSpec"`
}

type UpgradeOptions

type UpgradeOptions struct {
	// ReleaseName is the name of the installed Helm release to upgrade.
	ReleaseName string
	// ReleaseType is the helm upgrade type - consul vs consul-demo.
	ReleaseType string
	// ReleaseTypeName is a user friendly version of ReleaseType.  The values
	// are consul and consul demo application.
	ReleaseTypeName string
	// Namespace is the Kubernetes namespace where the release is installed.
	Namespace string
	// Values the Helm chart values in a map form.
	Values map[string]interface{}
	// Settings is the Helm CLI environment settings.
	Settings *helmCLI.EnvSettings
	// Embedded chart specifies the Consul or Consul Demo Helm chart that has
	// been embedded into the consul-k8s CLI.
	EmbeddedChart embed.FS
	// ChartDirName is the top level directory name fo the EmbeddedChart.
	ChartDirName string
	// UILogger is a DebugLog used to return messages from Helm to the UI.
	UILogger action.DebugLog
	// DryRun specifies whether the upgrade should actually modify the
	// Kubernetes cluster.
	DryRun bool
	// AutoApprove will bypass any terminal prompts with an automatic yes.
	AutoApprove bool
	// Wait specifies whether the Helm install should wait until all pods
	// are ready.
	Wait bool
	// Timeout is the duration that Helm will wait for the command to complete
	// before it throws an error.
	Timeout time.Duration
	// UI is the terminal output representation that is used to prompt the user
	// and output messages.
	UI terminal.UI
	// HelmActionsRunner is a thin interface around Helm actions for install,
	// upgrade, and uninstall.
	HelmActionsRunner HelmActionsRunner
}

UpgradeOptions is used when calling UpgradeHelmRelease.

type Values

type Values struct {
	Global              Global              `yaml:"global"`
	Server              Server              `yaml:"server"`
	ExternalServers     ExternalServers     `yaml:"externalServers"`
	Client              Client              `yaml:"client"`
	DNS                 DNS                 `yaml:"dns"`
	UI                  UI                  `yaml:"ui"`
	SyncCatalog         SyncCatalog         `yaml:"syncCatalog"`
	ConnectInject       ConnectInject       `yaml:"connectInject"`
	Controller          Controller          `yaml:"controller"`
	MeshGateway         MeshGateway         `yaml:"meshGateway"`
	IngressGateways     IngressGateways     `yaml:"ingressGateways"`
	TerminatingGateways TerminatingGateways `yaml:"terminatingGateways"`
	APIGateway          APIGateway          `yaml:"apiGateway"`
	WebhookCertManager  WebhookCertManager  `yaml:"webhookCertManager"`
	Prometheus          Prometheus          `yaml:"prometheus"`
	Tests               Tests               `yaml:"tests"`
}

Values is the Helm values that may be set for the Consul Helm Chart.

type Vault

type Vault struct {
	Enabled              bool        `yaml:"enabled"`
	ConsulServerRole     string      `yaml:"consulServerRole"`
	ConsulClientRole     string      `yaml:"consulClientRole"`
	ManageSystemACLsRole string      `yaml:"manageSystemACLsRole"`
	AgentAnnotations     interface{} `yaml:"agentAnnotations"`
	ConsulCARole         string      `yaml:"consulCARole"`
	Ca                   Ca          `yaml:"ca"`
	ConnectCA            ConnectCA   `yaml:"connectCA"`
}

type WanAddress

type WanAddress struct {
	Source string `yaml:"source"`
	Port   int    `yaml:"port"`
	Static string `yaml:"static"`
}

type WebhookCertManager

type WebhookCertManager struct {
	Tolerations interface{} `yaml:"tolerations"`
}

Jump to

Keyboard shortcuts

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