Documentation ¶
Index ¶
- Constants
- Variables
- func CommandAnnotationsSet(appName string, processType string, resourceType string, key string, ...) error
- func CommandAutoscalingAuthReport(appName string, format string, global bool, includeMetadata bool) error
- func CommandAutoscalingAuthSet(appName string, trigger string, metadata map[string]string, global bool) error
- func CommandClusterAdd(role string, remoteHost string, serverIP string, allowUknownHosts bool, ...) error
- func CommandClusterList(format string) error
- func CommandClusterRemove(nodeName string) error
- func CommandInitialize(ingressClass string, serverIP string, taintScheduling bool) error
- func CommandLabelsSet(appName string, processType string, resourceType string, key string, ...) error
- func CommandReport(appName string, format string, infoFlag string) error
- func CommandSet(appName string, property string, value string) error
- func CommandShowKubeconfig() error
- func CommandUninstall() error
- func KubernetesClientConfig(kubeconfigPath string, kubecontext string) clientcmd.ClientConfig
- func ReportAutoscalingAuthSingleApp(appName string, format string, includeMetadata bool) error
- func ReportSingleApp(appName string, format string, infoFlag string) error
- func TriggerInstall() error
- func TriggerPostAppCloneSetup(oldAppName string, newAppName string) error
- func TriggerPostAppRenameSetup(oldAppName string, newAppName string) error
- func TriggerPostDelete(appName string) error
- func TriggerSchedulerAppStatus(scheduler string, appName string) error
- func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) error
- func TriggerSchedulerEnter(scheduler string, appName string, processType string, podName string, ...) error
- func TriggerSchedulerLogs(scheduler string, appName string, processType string, tail bool, quiet bool, ...) error
- func TriggerSchedulerPostDelete(scheduler string, appName string) error
- func TriggerSchedulerRun(scheduler string, appName string, envCount int, args []string) error
- func TriggerSchedulerRunList(scheduler string, appName string, format string) error
- func TriggerSchedulerStop(scheduler string, appName string) error
- type AddRepositoryInput
- type AnnotateNodeInput
- type AppValues
- type ApplyKubernetesManifestInput
- type Chart
- type ChartInput
- type ClusterIssuer
- type ClusterIssuerValues
- type ClusterKedaValues
- type CreateJobInput
- type CreateNamespaceInput
- type DebugRenderer
- type DeleteIngressInput
- type DeleteJobInput
- type DeleteNodeInput
- type DeleteSecretInput
- type EnterPodInput
- type ExecHealthcheck
- type GetAutoscalingInput
- type GetNodeInput
- type GetPodInput
- type GlobalImage
- type GlobalKedaValues
- type GlobalNetwork
- type GlobalValues
- type HTTPHeader
- type HTTPHealthcheck
- type HelmAgent
- func (h *HelmAgent) AddRepository(ctx context.Context, helmRepo AddRepositoryInput) error
- func (h *HelmAgent) ChartExists(releaseName string) (bool, error)
- func (h *HelmAgent) DeleteRevision(ctx context.Context, releaseName string, revision int) error
- func (h *HelmAgent) GetValues(releaseName string) (map[string]interface{}, error)
- func (h *HelmAgent) InstallChart(ctx context.Context, input ChartInput) error
- func (h *HelmAgent) InstallOrUpgradeChart(ctx context.Context, input ChartInput) error
- func (h *HelmAgent) ListRevisions(ctx context.Context, releaseName string) ([]Release, error)
- func (h *HelmAgent) UninstallChart(releaseName string) error
- func (h *HelmAgent) UpgradeChart(ctx context.Context, input ChartInput) error
- type HelmChart
- type HelmRepository
- type Job
- type KedaAuthentication
- type KedaAuthenticationKind
- type KubernetesClient
- func (k KubernetesClient) AnnotateNode(ctx context.Context, input AnnotateNodeInput) error
- func (k KubernetesClient) ApplyKubernetesManifest(ctx context.Context, input ApplyKubernetesManifestInput) error
- func (k KubernetesClient) CreateJob(ctx context.Context, input CreateJobInput) (batchv1.Job, error)
- func (k KubernetesClient) CreateNamespace(ctx context.Context, input CreateNamespaceInput) (v1.Namespace, error)
- func (k KubernetesClient) DeleteIngress(ctx context.Context, input DeleteIngressInput) error
- func (k KubernetesClient) DeleteJob(ctx context.Context, input DeleteJobInput) error
- func (k KubernetesClient) DeleteNode(ctx context.Context, input DeleteNodeInput) error
- func (k KubernetesClient) DeleteSecret(ctx context.Context, input DeleteSecretInput) error
- func (k KubernetesClient) GetNode(ctx context.Context, input GetNodeInput) (Node, error)
- func (k KubernetesClient) GetPod(ctx context.Context, input GetPodInput) (v1.Pod, error)
- func (k KubernetesClient) LabelNode(ctx context.Context, input LabelNodeInput) error
- func (k KubernetesClient) ListClusterTriggerAuthentications(ctx context.Context, input ListClusterTriggerAuthenticationsInput) ([]kedav1alpha1.ClusterTriggerAuthentication, error)
- func (k KubernetesClient) ListCronJobs(ctx context.Context, input ListCronJobsInput) ([]batchv1.CronJob, error)
- func (k KubernetesClient) ListDeployments(ctx context.Context, input ListDeploymentsInput) ([]appsv1.Deployment, error)
- func (k KubernetesClient) ListIngresses(ctx context.Context, input ListIngressesInput) ([]networkingv1.Ingress, error)
- func (k KubernetesClient) ListNamespaces(ctx context.Context) ([]v1.Namespace, error)
- func (k KubernetesClient) ListNodes(ctx context.Context, input ListNodesInput) ([]v1.Node, error)
- func (k KubernetesClient) ListPods(ctx context.Context, input ListPodsInput) ([]v1.Pod, error)
- func (k KubernetesClient) ListTriggerAuthentications(ctx context.Context, input ListTriggerAuthenticationsInput) ([]kedav1alpha1.TriggerAuthentication, error)
- func (k KubernetesClient) Ping() error
- func (k KubernetesClient) ScaleDeployment(ctx context.Context, input ScaleDeploymentInput) error
- type LabelNodeInput
- type ListClusterTriggerAuthenticationsInput
- type ListCronJobsInput
- type ListDeploymentsInput
- type ListIngressesInput
- type ListNodesInput
- type ListPodsInput
- type ListTriggerAuthenticationsInput
- type Manifest
- type NameSorter
- type Node
- type PortMap
- type PortmapProtocol
- type ProcessAnnotations
- type ProcessAutoscaling
- type ProcessAutoscalingTrigger
- type ProcessAutoscalingTriggerAuthenticationRef
- type ProcessCron
- type ProcessDomains
- type ProcessHealthcheck
- type ProcessHealthchecks
- type ProcessLabels
- type ProcessPortMap
- type ProcessResources
- type ProcessResourcesMap
- type ProcessTls
- type ProcessType
- type ProcessValues
- type ProcessWeb
- type Release
- type ScaleDeploymentInput
- type StartCommandInput
- type StartCommandOutput
- type TCPHealthcheck
- type URIScheme
- type WaitForNodeToExistInput
- type WaitForPodBySelectorRunningInput
- type WaitForPodToExistInput
- type WriteYamlInput
Constants ¶
const DefaultIngressClass = "nginx"
const DefaultKubeContext = ""
const GlobalProcessType = "--global"
const KubeConfigPath = "/etc/rancher/k3s/k3s.yaml"
const TriggerAuthPropertyPrefix = "trigger-auth."
Variables ¶
var ( // DefaultProperties is a map of all valid k3s properties with corresponding default property values DefaultProperties = map[string]string{ "deploy-timeout": "", "letsencrypt-server": "", "image-pull-secrets": "", "namespace": "", "rollback-on-failure": "", } // GlobalProperties is a map of all valid global k3s properties GlobalProperties = map[string]bool{ "deploy-timeout": true, "image-pull-secrets": true, "ingress-class": true, "kube-context": true, "kubeconfig-path": true, "letsencrypt-server": true, "letsencrypt-email-prod": true, "letsencrypt-email-stag": true, "namespace": true, "network-interface": true, "rollback-on-failure": true, "token": true, } )
var DeployLogPrinter = func(format string, v ...interface{}) { message := strings.TrimSpace(fmt.Sprintf(format, v...)) if message == "" { return } r := []rune(message) r[0] = unicode.ToUpper(r[0]) s := string(r) if strings.HasPrefix(s, "Beginning wait") { common.LogExclaim(s) } else if strings.HasPrefix(s, "Warning:") { common.LogExclaim(s) } else { common.LogVerboseQuiet(s) } }
var DevNullPrinter = func(format string, v ...interface{}) {}
var HelmCharts = []HelmChart{ { ChartPath: "cert-manager", CreateNamespace: true, Namespace: "cert-manager", ReleaseName: "cert-manager", RepoURL: "https://charts.jetstack.io", Version: "v1.13.3", }, { ChartPath: "longhorn", CreateNamespace: true, Namespace: "longhorn-system", ReleaseName: "longhorn", RepoURL: "https://charts.longhorn.io", Version: "1.5.3", }, { ChartPath: "traefik", CreateNamespace: true, Namespace: "traefik", ReleaseName: "traefik", RepoURL: "https://helm.traefik.io/traefik", Version: "26.0.0", }, { ChartPath: "ingress-nginx", CreateNamespace: true, Namespace: "ingress-nginx", ReleaseName: "ingress-nginx", RepoURL: "https://kubernetes.github.io/ingress-nginx", Version: "4.10.0", }, { ChartPath: "keda", CreateNamespace: true, Namespace: "keda", ReleaseName: "keda", RepoURL: "https://kedacore.github.io/charts", Version: "2.13.1", }, }
var HelmRepositories = []HelmRepository{
{
Name: "jetstack",
URL: "https://charts.jetstack.io",
},
{
Name: "longhorn",
URL: "https://charts.longhorn.io",
},
{
Name: "traefik",
URL: "https://helm.traefik.io/traefik",
},
}
var KubernetesManifests = []Manifest{
{
Name: "system-upgrader",
Version: "0.13.2",
Path: "https://github.com/rancher/system-upgrade-controller/releases/download/v0.13.2/system-upgrade-controller.yaml",
},
}
var ServerLabels = map[string]string{
"svccontroller.k3s.cattle.io/enablelb": "true",
}
var WorkerLabels = map[string]string{
"node-role.kubernetes.io/worker": "worker",
}
Functions ¶
func CommandAnnotationsSet ¶
func CommandAnnotationsSet(appName string, processType string, resourceType string, key string, value string) error
CommandAnnotationsSet set or clear a scheduler-k3s annotation for an app
func CommandAutoscalingAuthReport ¶
func CommandAutoscalingAuthReport(appName string, format string, global bool, includeMetadata bool) error
CommandAutoscalingAuthReport displays a scheduler-k3s autoscaling keda trigger authentication report for one or more apps
func CommandAutoscalingAuthSet ¶
func CommandAutoscalingAuthSet(appName string, trigger string, metadata map[string]string, global bool) error
CommandAutoscalingAuthSet set or clear a scheduler-k3s autoscaling keda trigger authentication object for an app
func CommandClusterAdd ¶
func CommandClusterAdd(role string, remoteHost string, serverIP string, allowUknownHosts bool, taintScheduling bool) error
CommandClusterAdd adds a server to the k3s cluster
func CommandClusterList ¶
CommandClusterList lists the nodes in the k3s cluster
func CommandClusterRemove ¶
CommandClusterRemove removes a node from the k3s cluster
func CommandInitialize ¶
CommandInitialize initializes a k3s cluster on the local server
func CommandLabelsSet ¶
func CommandLabelsSet(appName string, processType string, resourceType string, key string, value string) error
CommandLabelsSet set or clear a scheduler-k3s label for an app
func CommandReport ¶
CommandReport displays a scheduler-k3s report for one or more apps
func CommandSet ¶
CommandSet set or clear a scheduler-k3s property for an app
func CommandShowKubeconfig ¶
func CommandShowKubeconfig() error
CommandShowKubeconfig displays the kubeconfig file contents
func CommandUninstall ¶
func CommandUninstall() error
func KubernetesClientConfig ¶
func KubernetesClientConfig(kubeconfigPath string, kubecontext string) clientcmd.ClientConfig
KubernetesClientConfig returns a Kubernetes client config
func ReportAutoscalingAuthSingleApp ¶
ReportAutoscalingAuthSingleApp is an internal function that displays the scheduler-k3s autoscaling-auth report for one app
func ReportSingleApp ¶
ReportSingleApp is an internal function that displays the scheduler-k3s report for one or more apps
func TriggerInstall ¶
func TriggerInstall() error
TriggerInstall runs the install step for the scheduler-k3s plugin
func TriggerPostAppCloneSetup ¶
TriggerPostAppCloneSetup creates new scheduler-k3s files
func TriggerPostAppRenameSetup ¶
TriggerPostAppRenameSetup renames scheduler-k3s files
func TriggerPostDelete ¶
TriggerPostDelete destroys the scheduler-k3s data for a given app container
func TriggerSchedulerAppStatus ¶
TriggerSchedulerAppStatus returns the status of an app on the scheduler
func TriggerSchedulerDeploy ¶
TriggerSchedulerDeploy deploys an image tag for a given application
func TriggerSchedulerEnter ¶
func TriggerSchedulerEnter(scheduler string, appName string, processType string, podName string, args []string) error
TriggerSchedulerEnter enters a container for a given application
func TriggerSchedulerLogs ¶
func TriggerSchedulerLogs(scheduler string, appName string, processType string, tail bool, quiet bool, numLines int64) error
TriggerSchedulerLogs displays logs for a given application
func TriggerSchedulerPostDelete ¶
TriggerSchedulerPostDelete destroys the scheduler-k3s data for a given app container
func TriggerSchedulerRun ¶
TriggerSchedulerRun runs a command in an ephemeral container
func TriggerSchedulerRunList ¶
TriggerSchedulerRunList lists one-off run pods for a given application
func TriggerSchedulerStop ¶
TriggerSchedulerStop stops an application
Types ¶
type AddRepositoryInput ¶
type AnnotateNodeInput ¶
type AnnotateNodeInput struct { // Name is the Kubernetes node name Name string // Key is the annotation key Key string // Value is the annotation value Value string }
AnnotateNodeInput contains all the information needed to annotates a Kubernetes node
type AppValues ¶
type AppValues struct { Global GlobalValues `yaml:"global"` Processes map[string]ProcessValues `yaml:"processes"` }
type ApplyKubernetesManifestInput ¶
type ApplyKubernetesManifestInput struct { // Manifest is the path to the Kubernetes manifest Manifest string }
type ChartInput ¶
type ClusterIssuer ¶
type ClusterIssuerValues ¶
type ClusterIssuerValues struct {
ClusterIssuers map[string]ClusterIssuer `yaml:"cluster_issuers"`
}
type ClusterKedaValues ¶
type ClusterKedaValues struct { Global struct { Annotations ProcessAnnotations `yaml:"annotations,omitempty"` } `yaml:"global"` Secrets map[string]string `yaml:"secrets"` Type string `yaml:"type"` }
type CreateJobInput ¶
type CreateJobInput struct { // Job is the Kubernetes job Job batchv1.Job // Namespace is the Kubernetes namespace Namespace string }
CreateJobInput contains all the information needed to create a Kubernetes job
type CreateNamespaceInput ¶
type CreateNamespaceInput struct { // Name is the name of the Kubernetes namespace Name v1.Namespace }
CreateNamespaceInput contains all the information needed to create a Kubernetes namespace
type DebugRenderer ¶
type DebugRenderer struct { }
type DeleteIngressInput ¶
type DeleteIngressInput struct { // Name is the Kubernetes ingress name Name string // Namespace is the Kubernetes namespace Namespace string }
DeleteIngressInput contains all the information needed to delete a Kubernetes ingress
type DeleteJobInput ¶
type DeleteJobInput struct { // Name is the Kubernetes job name Name string // Namespace is the Kubernetes namespace Namespace string }
DeleteJobInput contains all the information needed to delete a Kubernetes job
type DeleteNodeInput ¶
type DeleteNodeInput struct { // Name is the Kubernetes node name Name string }
DeleteNodeInput contains all the information needed to delete a Kubernetes node
type DeleteSecretInput ¶
type DeleteSecretInput struct { // Name is the Kubernetes secret name Name string // Namespace is the Kubernetes namespace Namespace string }
DeleteSecretInput contains all the information needed to delete a Kubernetes secret
type EnterPodInput ¶
type EnterPodInput struct { // Clientset is the kubernetes clientset Clientset KubernetesClient // Command is the command to run Command []string // Entrypoint is the entrypoint to run Entrypoint string // SelectedContainerName is the container name to enter SelectedContainerName string // SelectedPod is the pod to enter SelectedPod v1.Pod // WaitTimeout is the timeout to wait for the pod to be ready WaitTimeout int }
EnterPodInput contains all the information needed to enter a pod
type ExecHealthcheck ¶
type ExecHealthcheck struct {
Command []string `yaml:"command,omitempty"`
}
type GetAutoscalingInput ¶
type GetAutoscalingInput struct { // AppName is the name of the app AppName string // ProcessType is the process type ProcessType string // Replicas is the number of replicas Replicas int // KedaValues is the keda values KedaValues GlobalKedaValues }
GetAutoscalingInput contains all the information needed to get autoscaling config
type GetNodeInput ¶
type GetNodeInput struct { // Name is the Kubernetes node name Name string }
GetNodeInput contains all the information needed to get a Kubernetes node
type GetPodInput ¶
type GetPodInput struct { // Name is the Kubernetes pod name Name string // Namespace is the Kubernetes namespace Namespace string }
GetJobInput contains all the information needed to get a Kubernetes job
type GlobalImage ¶
type GlobalKedaValues ¶
type GlobalKedaValues struct { // Authentications is a map of authentication objects to use for keda Authentications map[string]KedaAuthentication `yaml:"authentications"` // GlobalAuthentications is a map of global authentication objects to use for keda GlobalAuthentications map[string]KedaAuthentication `yaml:"global_authentications"` }
GlobalKedaValues contains the global keda configuration
type GlobalNetwork ¶
type GlobalValues ¶
type GlobalValues struct { Annotations ProcessAnnotations `yaml:"annotations,omitempty"` AppName string `yaml:"app_name"` DeploymentID string `yaml:"deploment_id"` Image GlobalImage `yaml:"image"` Labels ProcessLabels `yaml:"labels,omitempty"` Keda GlobalKedaValues `yaml:"keda"` Namespace string `yaml:"namespace"` Network GlobalNetwork `yaml:"network"` Secrets map[string]string `yaml:"secrets,omitempty"` }
type HTTPHeader ¶
type HTTPHealthcheck ¶
type HTTPHealthcheck struct { Path string `yaml:"path,omitempty"` Port int32 `yaml:"port,omitempty"` Host string `yaml:"host,omitempty"` Scheme URIScheme `yaml:"scheme,omitempty"` HTTPHeaders []HTTPHeader `yaml:"httpHeaders,omitempty"` }
type HelmAgent ¶
type HelmAgent struct { Configuration *action.Configuration Namespace string Logger action.DebugLog }
func (*HelmAgent) AddRepository ¶
func (h *HelmAgent) AddRepository(ctx context.Context, helmRepo AddRepositoryInput) error
func (*HelmAgent) DeleteRevision ¶
func (*HelmAgent) InstallChart ¶
func (h *HelmAgent) InstallChart(ctx context.Context, input ChartInput) error
func (*HelmAgent) InstallOrUpgradeChart ¶
func (h *HelmAgent) InstallOrUpgradeChart(ctx context.Context, input ChartInput) error
func (*HelmAgent) ListRevisions ¶
func (*HelmAgent) UninstallChart ¶
func (*HelmAgent) UpgradeChart ¶
func (h *HelmAgent) UpgradeChart(ctx context.Context, input ChartInput) error
type HelmRepository ¶
type Job ¶
type Job struct { AppName string Command []string DeploymentID int64 Entrypoint string Env map[string]string ID string Image string ImagePullSecrets string ImageSourceType string Interactive bool Labels map[string]string Namespace string ProcessType string Schedule string Suffix string RemoveContainer bool WorkingDir string }
type KedaAuthentication ¶
type KedaAuthentication struct { // Name is the name of the authentication object Name string `yaml:"name"` // Kind is the kind of authentication object Kind KedaAuthenticationKind `yaml:"kind,omitempty"` // Type is the type of authentication to use Type string `yaml:"type"` // Secrets is a map of secrets to use for authentication Secrets map[string]string `yaml:"secrets,omitempty"` }
KedaAuthentication contains the authentication configuration for keda
type KedaAuthenticationKind ¶
type KedaAuthenticationKind string
const ( KedaAuthenticationKind_ClusterTriggerAuthentication KedaAuthenticationKind = "ClusterTriggerAuthentication" KedaAuthenticationKind_TriggerAuthentication KedaAuthenticationKind = "TriggerAuthentication" )
type KubernetesClient ¶
type KubernetesClient struct { // Client is the Kubernetes client Client kubernetes.Clientset // DynamicClient is the Kubernetes dynamic client DynamicClient dynamic.Interface // KubeConfigPath is the path to the Kubernetes config KubeConfigPath string // RestClient is the Kubernetes REST client RestClient rest.Interface // RestConfig is the Kubernetes REST config RestConfig rest.Config }
KubernetesClient is a wrapper around the Kubernetes client
func NewKubernetesClient ¶
func NewKubernetesClient() (KubernetesClient, error)
NewKubernetesClient creates a new Kubernetes client
func (KubernetesClient) AnnotateNode ¶
func (k KubernetesClient) AnnotateNode(ctx context.Context, input AnnotateNodeInput) error
AnnotateNode annotates a Kubernetes node
func (KubernetesClient) ApplyKubernetesManifest ¶
func (k KubernetesClient) ApplyKubernetesManifest(ctx context.Context, input ApplyKubernetesManifestInput) error
func (KubernetesClient) CreateJob ¶
func (k KubernetesClient) CreateJob(ctx context.Context, input CreateJobInput) (batchv1.Job, error)
CreateJob creates a Kubernetes job
func (KubernetesClient) CreateNamespace ¶
func (k KubernetesClient) CreateNamespace(ctx context.Context, input CreateNamespaceInput) (v1.Namespace, error)
CreateNamespace creates a Kubernetes namespace
func (KubernetesClient) DeleteIngress ¶
func (k KubernetesClient) DeleteIngress(ctx context.Context, input DeleteIngressInput) error
DeleteIngress deletes a Kubernetes ingress
func (KubernetesClient) DeleteJob ¶
func (k KubernetesClient) DeleteJob(ctx context.Context, input DeleteJobInput) error
DeleteJob deletes a Kubernetes job
func (KubernetesClient) DeleteNode ¶
func (k KubernetesClient) DeleteNode(ctx context.Context, input DeleteNodeInput) error
DeleteNode deletes a Kubernetes node
func (KubernetesClient) DeleteSecret ¶
func (k KubernetesClient) DeleteSecret(ctx context.Context, input DeleteSecretInput) error
DeleteSecret deletes a Kubernetes secret
func (KubernetesClient) GetNode ¶
func (k KubernetesClient) GetNode(ctx context.Context, input GetNodeInput) (Node, error)
GetNode gets a Kubernetes node
func (KubernetesClient) GetPod ¶
func (k KubernetesClient) GetPod(ctx context.Context, input GetPodInput) (v1.Pod, error)
GetJob gets a Kubernetes job
func (KubernetesClient) LabelNode ¶
func (k KubernetesClient) LabelNode(ctx context.Context, input LabelNodeInput) error
LabelNode labels a Kubernetes node
func (KubernetesClient) ListClusterTriggerAuthentications ¶
func (k KubernetesClient) ListClusterTriggerAuthentications(ctx context.Context, input ListClusterTriggerAuthenticationsInput) ([]kedav1alpha1.ClusterTriggerAuthentication, error)
ListClusterTriggerAuthentications lists Kubernetes trigger authentications
func (KubernetesClient) ListCronJobs ¶
func (k KubernetesClient) ListCronJobs(ctx context.Context, input ListCronJobsInput) ([]batchv1.CronJob, error)
ListCronJobs lists Kubernetes cron jobs
func (KubernetesClient) ListDeployments ¶
func (k KubernetesClient) ListDeployments(ctx context.Context, input ListDeploymentsInput) ([]appsv1.Deployment, error)
ListDeployments lists Kubernetes deployments
func (KubernetesClient) ListIngresses ¶
func (k KubernetesClient) ListIngresses(ctx context.Context, input ListIngressesInput) ([]networkingv1.Ingress, error)
ListIngresses lists Kubernetes ingresses
func (KubernetesClient) ListNamespaces ¶
ListNamespaces lists Kubernetes namespaces
func (KubernetesClient) ListNodes ¶
func (k KubernetesClient) ListNodes(ctx context.Context, input ListNodesInput) ([]v1.Node, error)
ListNodes lists Kubernetes nodes
func (KubernetesClient) ListPods ¶
func (k KubernetesClient) ListPods(ctx context.Context, input ListPodsInput) ([]v1.Pod, error)
ListPods lists Kubernetes pods
func (KubernetesClient) ListTriggerAuthentications ¶
func (k KubernetesClient) ListTriggerAuthentications(ctx context.Context, input ListTriggerAuthenticationsInput) ([]kedav1alpha1.TriggerAuthentication, error)
ListTriggerAuthentications lists Kubernetes trigger authentications
func (KubernetesClient) Ping ¶
func (k KubernetesClient) Ping() error
func (KubernetesClient) ScaleDeployment ¶
func (k KubernetesClient) ScaleDeployment(ctx context.Context, input ScaleDeploymentInput) error
ScaleDeployment scales a Kubernetes deployment
type LabelNodeInput ¶
type LabelNodeInput struct { // Name is the Kubernetes node name Name string // Key is the label key Key string // Value is the label value Value string }
LabelNodeInput contains all the information needed to label a Kubernetes node
type ListClusterTriggerAuthenticationsInput ¶
type ListClusterTriggerAuthenticationsInput struct { // Namespace is the Kubernetes namespace Namespace string // LabelSelector is the Kubernetes label selector LabelSelector string }
ListClusterTriggerAuthenticationsInput contains all the information needed to list Kubernetes trigger authentications
type ListCronJobsInput ¶
type ListCronJobsInput struct { // LabelSelector is the Kubernetes label selector LabelSelector string // Namespace is the Kubernetes namespace Namespace string }
ListCronJobsInput contains all the information needed to list Kubernetes cron jobs
type ListDeploymentsInput ¶
type ListDeploymentsInput struct { // Namespace is the Kubernetes namespace Namespace string // LabelSelector is the Kubernetes label selector LabelSelector string }
ListDeploymentsInput contains all the information needed to list Kubernetes deployments
type ListIngressesInput ¶
type ListIngressesInput struct { // Namespace is the Kubernetes namespace Namespace string // LabelSelector is the Kubernetes label selector LabelSelector string }
ListIngressesInput contains all the information needed to list Kubernetes ingresses
type ListNodesInput ¶
type ListNodesInput struct { // LabelSelector is the Kubernetes label selector LabelSelector string }
ListNodesInput contains all the information needed to list Kubernetes nodes
type ListPodsInput ¶
type ListPodsInput struct { // Namespace is the Kubernetes namespace Namespace string // LabelSelector is the Kubernetes label selector LabelSelector string }
ListPodsInput contains all the information needed to list Kubernetes pods
type ListTriggerAuthenticationsInput ¶
type ListTriggerAuthenticationsInput struct { // Namespace is the Kubernetes namespace Namespace string // LabelSelector is the Kubernetes label selector LabelSelector string }
ListTriggerAuthenticationsInput contains all the information needed to list Kubernetes trigger authentications
type NameSorter ¶
type NameSorter []ProcessPortMap
func (NameSorter) Len ¶
func (a NameSorter) Len() int
func (NameSorter) Less ¶
func (a NameSorter) Less(i, j int) bool
func (NameSorter) Swap ¶
func (a NameSorter) Swap(i, j int)
type Node ¶
type Node struct { // Name is the name of the node Name string // Roles is the roles of the node Roles []string // Ready is whether the node is ready Ready bool // RemoteHost is the remote host RemoteHost string // Version is the version of the node Version string }
Node contains information about a node
type PortMap ¶
type PortMap struct { ContainerPort int32 `json:"container_port"` HostPort int32 `json:"host_port"` Scheme string `json:"scheme"` }
func (PortMap) IsAllowedHttp ¶
func (PortMap) IsAllowedHttps ¶
type PortmapProtocol ¶
type PortmapProtocol string
const ( PortmapProtocol_TCP PortmapProtocol = "TCP" PortmapProtocol_UDP PortmapProtocol = "UDP" )
type ProcessAnnotations ¶
type ProcessAnnotations struct { CertificateAnnotations map[string]string `yaml:"certificate,omitempty"` CronJobAnnotations map[string]string `yaml:"cronjob,omitempty"` DeploymentAnnotations map[string]string `yaml:"deployment,omitempty"` IngressAnnotations map[string]string `yaml:"ingress,omitempty"` JobAnnotations map[string]string `yaml:"job,omitempty"` KedaScalingObjectAnnotations map[string]string `yaml:"keda_scaled_object,omitempty"` KedaSecretAnnotations map[string]string `yaml:"keda_secret,omitempty"` KedaTriggerAuthenticationAnnotations map[string]string `yaml:"keda_trigger_authentication,omitempty"` PodAnnotations map[string]string `yaml:"pod,omitempty"` SecretAnnotations map[string]string `yaml:"secret,omitempty"` ServiceAccountAnnotations map[string]string `yaml:"serviceaccount,omitempty"` ServiceAnnotations map[string]string `yaml:"service,omitempty"` TraefikIngressRouteAnnotations map[string]string `yaml:"traefik_ingressroute,omitempty"` TraefikMiddlewareAnnotations map[string]string `yaml:"traefik_middleware,omitempty"` }
type ProcessAutoscaling ¶
type ProcessAutoscaling struct { // CooldownPeriodSeconds is the number of seconds after a scaling event before another can be triggered CooldownPeriodSeconds int `yaml:"cooldown_period_seconds,omitempty"` // Enabled is a flag to enable autoscaling Enabled bool `yaml:"enabled"` // MaxReplicas is the maximum number of replicas to scale to MaxReplicas int `yaml:"max_replicas,omitempty"` // MinReplicas is the minimum number of replicas to scale to MinReplicas int `yaml:"min_replicas,omitempty"` // PollingIntervalSeconds is the number of seconds between polling for new metrics PollingIntervalSeconds int `yaml:"polling_interval_seconds,omitempty"` // Triggers is a list of triggers to use for autoscaling Triggers []ProcessAutoscalingTrigger `yaml:"triggers,omitempty"` // Type is the type of autoscaling to use Type string `yaml:"type"` }
ProcessAutoscaling contains the autoscaling configuration for a process
type ProcessAutoscalingTrigger ¶
type ProcessAutoscalingTrigger struct { // Name is the name of the trigger Name string `yaml:"name"` // Type is the type of trigger to use Type string `yaml:"type"` // Metadata is a map of key-value pairs that can be used to store arbitrary trigger data Metadata map[string]string `yaml:"metadata,omitempty"` // AuthenticationRef is a reference to an authentication object AuthenticationRef *ProcessAutoscalingTriggerAuthenticationRef `yaml:"authenticationRef,omitempty"` }
ProcessAutoscalingTrigger is a trigger to use for autoscaling
type ProcessAutoscalingTriggerAuthenticationRef ¶
type ProcessAutoscalingTriggerAuthenticationRef struct { // Name is the name of the authentication object Name string `yaml:"name"` // Kind is the kind of authentication object Kind string `yaml:"kind,omitempty"` }
ProcessAutoscalingTriggerAuthenticationRef is a reference to an authentication object
type ProcessCron ¶
type ProcessDomains ¶
type ProcessHealthcheck ¶
type ProcessHealthcheck struct { Exec *ExecHealthcheck `yaml:"exec,omitempty"` HTTPGet *HTTPHealthcheck `yaml:"httpGet,omitempty"` TCPSocket *TCPHealthcheck `yaml:"tcpSocket,omitempty"` InitialDelaySeconds int32 `yaml:"initialDelaySeconds,omitempty"` TimeoutSeconds int32 `yaml:"timeoutSeconds,omitempty"` PeriodSeconds int32 `yaml:"periodSeconds,omitempty"` SuccessThreshold int32 `yaml:"successThreshold,omitempty"` FailureThreshold int32 `yaml:"failureThreshold,omitempty"` TerminationGracePeriodSeconds *int64 `yaml:"terminationGracePeriodSeconds,omitempty"` }
type ProcessHealthchecks ¶
type ProcessHealthchecks struct { Liveness ProcessHealthcheck `yaml:"liveness,omitempty"` Readiness ProcessHealthcheck `yaml:"readiness,omitempty"` Startup ProcessHealthcheck `yaml:"startup,omitempty"` MinReadySeconds int32 `yaml:"min_ready_seconds,omitempty"` }
type ProcessLabels ¶
type ProcessLabels struct { CertificateLabels map[string]string `yaml:"certificate,omitempty"` CronJobLabels map[string]string `yaml:"cronjob,omitempty"` DeploymentLabels map[string]string `yaml:"deployment,omitempty"` IngressLabels map[string]string `yaml:"ingress,omitempty"` JobLabels map[string]string `yaml:"job,omitempty"` PodLabels map[string]string `yaml:"pod,omitempty"` SecretLabels map[string]string `yaml:"secret,omitempty"` ServiceAccountLabels map[string]string `yaml:"serviceaccount,omitempty"` ServiceLabels map[string]string `yaml:"service,omitempty"` TraefikIngressRouteLabels map[string]string `yaml:"traefik_ingressroute,omitempty"` TraefikMiddlewareLabels map[string]string `yaml:"traefik_middleware,omitempty"` }
type ProcessPortMap ¶
type ProcessPortMap struct { ContainerPort int32 `yaml:"container_port"` HostPort int32 `yaml:"host_port"` Scheme string `yaml:"scheme"` Protocol PortmapProtocol `yaml:"protocol"` Name string `yaml:"name"` }
type ProcessResources ¶
type ProcessResourcesMap ¶
type ProcessResourcesMap struct { Limits ProcessResources `yaml:"limits,omitempty"` Requests ProcessResources `yaml:"requests,omitempty"` }
type ProcessTls ¶
type ProcessType ¶
type ProcessType string
const ( ProcessType_Cron ProcessType = "cron" ProcessType_Job ProcessType = "job" ProcessType_Web ProcessType = "web" ProcessType_Worker ProcessType = "worker" )
type ProcessValues ¶
type ProcessValues struct { Annotations ProcessAnnotations `yaml:"annotations,omitempty"` Args []string `yaml:"args,omitempty"` Autoscaling ProcessAutoscaling `yaml:"autoscaling,omitempty"` Cron ProcessCron `yaml:"cron,omitempty"` Healthchecks ProcessHealthchecks `yaml:"healthchecks,omitempty"` Labels ProcessLabels `yaml:"labels,omitempty"` ProcessType ProcessType `yaml:"process_type"` Replicas int32 `yaml:"replicas"` Resources ProcessResourcesMap `yaml:"resources,omitempty"` Web ProcessWeb `yaml:"web,omitempty"` }
type ProcessWeb ¶
type ProcessWeb struct { Domains []ProcessDomains `yaml:"domains,omitempty"` PortMaps []ProcessPortMap `yaml:"port_maps,omitempty"` TLS ProcessTls `yaml:"tls"` }
type ScaleDeploymentInput ¶
type ScaleDeploymentInput struct { // Name is the Kubernetes deployment name Name string // Namespace is the Kubernetes namespace Namespace string // Replicas is the number of replicas to scale to Replicas int32 }
ScaleDeploymentInput contains all the information needed to scale a Kubernetes deployment
type StartCommandInput ¶
type StartCommandInput struct { // AppName is the name of the app AppName string // ProcessType is the process type ProcessType string // ImageSourceType is the image source type ImageSourceType string // Port is the port Port int32 // Env is the environment variables Env map[string]string }
StartCommandInput contains all the information needed to get the start command
type StartCommandOutput ¶
type StartCommandOutput struct { // Command is the start command Command []string }
StartCommandOutput contains the start command
type TCPHealthcheck ¶
type WaitForNodeToExistInput ¶
type WaitForNodeToExistInput struct { Clientset KubernetesClient Namespace string RetryCount int NodeName string }
type WaitForPodBySelectorRunningInput ¶
type WaitForPodBySelectorRunningInput struct { Clientset KubernetesClient Namespace string LabelSelector string PodName string Timeout int Waiter func(ctx context.Context, clientset KubernetesClient, podName, namespace string) wait.ConditionWithContextFunc }
type WaitForPodToExistInput ¶
type WaitForPodToExistInput struct { Clientset KubernetesClient Namespace string RetryCount int PodName string LabelSelector string }
type WriteYamlInput ¶
type WriteYamlInput struct { Object interface{} Path string }