Documentation ¶
Index ¶
- Constants
- func NewClientFromKubeConfig(kubeConfig []byte) (kubernetes.Interface, error)
- func ServiceStateFromReplicas(ready, total int32) envtypes.ServiceState
- type Config
- type ConfigOptFn
- type ContainerImages
- type ContextKeyType
- type KubernetesEnv
- func (e *KubernetesEnv) Context(ctx context.Context) (context.Context, error)
- func (e *KubernetesEnv) Endpoints(_ context.Context) (*envtypes.Endpoints, error)
- func (e *KubernetesEnv) ServiceLogs(ctx context.Context, services []string, startTime time.Time, ...) error
- func (e *KubernetesEnv) Services(ctx context.Context) (envtypes.Services, error)
- func (e *KubernetesEnv) ServicesReady(ctx context.Context) (bool, error)
- func (e *KubernetesEnv) SetUp(ctx context.Context) error
- type Service
Constants ¶
View Source
const ( DefaultProvider = types.ProviderTypeKind DefaultInstaller = types.InstallerTypeHelm DefaultClusterCreationTimeout = 30 * time.Minute DefaultKubernetesVersion = "1.28" DefaultNamespace = "default" )
View Source
const ( GatewayHostPort = 30080 ListOperationTimeout = 30 )
View Source
const ( AppComponentLabel = "app.kubernetes.io/component" AppNameLabel = "app.kubernetes.io/name" )
https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
Variables ¶
This section is empty.
Functions ¶
func NewClientFromKubeConfig ¶
func NewClientFromKubeConfig(kubeConfig []byte) (kubernetes.Interface, error)
func ServiceStateFromReplicas ¶
func ServiceStateFromReplicas(ready, total int32) envtypes.ServiceState
Types ¶
type Config ¶
type Config struct { // EnvName the name of the environment to be created EnvName string `mapstructure:"env_name"` // Namespace where to deploy Namespace string `mapstructure:"namespace"` // Provider defines the infrastructure/platform provider Provider types.ProviderType `mapstructure:"provider"` // Installer defines the installer to be used for deployment Installer types.InstallerType `mapstructure:"installer"` // HelmConfig defines the Helm specific configuration HelmConfig *helm.Config `mapstructure:"helm,omitempty"` // Images contains the list of container images to be used for deployment Images ContainerImages `mapstructure:",squash"` // WorkDir absolute path to the directory where the deployment files prior performing actions WorkDir string `mapstructure:"work_dir"` // SkipAssetInstall defines whether to deploy test assets to environment or not SkipAssetInstall bool `mapstructure:"skip_asset_install"` // ProviderConfig contains the configuration for the Kubernetes provider. // NOTE(chrisgacsal): mapstructure does not support *squash* for ptr types types.ProviderConfig `mapstructure:",squash"` // contains filtered or unexported fields }
type ConfigOptFn ¶
ConfigOptFn defines transformer function for Config.
func WithLogger ¶
func WithLogger(logger *logrus.Entry) ConfigOptFn
type ContainerImages ¶
type ContainerImages = envtypes.ContainerImages[envtypes.ImageRef]
type ContextKeyType ¶
type ContextKeyType string
const KubeClientContextKey ContextKeyType = "KubeClient"
type KubernetesEnv ¶
type KubernetesEnv struct { // Provider used for deploying Kubernetes cluster types.Provider // Installer used for deploying applications to Kubernetes cluster types.Installer // Config stores all the configuration for Kubernetes environment *Config // contains filtered or unexported fields }
func New ¶
func New(config *Config, opts ...ConfigOptFn) (*KubernetesEnv, error)
func (*KubernetesEnv) ServiceLogs ¶
func (*KubernetesEnv) ServicesReady ¶
func (e *KubernetesEnv) ServicesReady(ctx context.Context) (bool, error)
type Service ¶
type Service struct { ID string Namespace string Application string Component string State envtypes.ServiceState }
func ServiceFromDaemonSet ¶
func ServiceFromDeployment ¶
func ServiceFromDeployment(d *appsv1.Deployment) *Service
func ServiceFromMeta ¶
func ServiceFromMeta(m *metav1.ObjectMeta) *Service
func ServiceFromStatefulSet ¶
func ServiceFromStatefulSet(d *appsv1.StatefulSet) *Service
func (*Service) GetApplicationName ¶
func (*Service) GetComponentName ¶
func (*Service) GetNamespace ¶
func (*Service) GetState ¶
func (s *Service) GetState() envtypes.ServiceState
Click to show internal directories.
Click to hide internal directories.