Documentation ¶
Index ¶
- func CheckForCertExpiry()
- func CheckPodExists(client k8s.Interface, namespace string, labelSelector map[string]string, ...) (bool, string)
- func Client() (*k8s.Clientset, error)
- func DaprClient() (scheme.Interface, error)
- func Expiry() (*time.Time, error)
- func ExportTrustChain(outputDir string) error
- func GenerateNewCertificates(validUntil time.Duration, privateKeyFile string) ([]byte, []byte, []byte, error)
- func GetDaprControlPlaneCurrentConfig() (*v1alpha1.Configuration, error)
- func GetDaprHelmChartName(helmConf *helm.Configuration) (string, error)
- func GetDaprNamespace() (string, error)
- func GetDaprVersion(status []StatusOutput) string
- func GetDefaultConfiguration() v1alpha1.Configuration
- func GetImageRegistry() (string, error)
- func GetKubeConfigClient() (*rest.Config, *k8s.Clientset, error)
- func Init(config InitConfiguration) error
- func IsDashboardIncluded(runtimeVersion string) (bool, error)
- func IsMTLSEnabled() (bool, error)
- func ListPods(client *k8s.Clientset, namespace string, labelSelector map[string]string) (*corev1.PodList, error)
- func ListPodsInterface(client k8s.Interface, labelSelector map[string]string) (*corev1.PodList, error)
- func Logs(appID, podName, namespace string) error
- func PrintComponents(name, namespace, outputFormat string) error
- func PrintConfigurations(name, namespace, outputFormat string) error
- func RenewCertificate(conf RenewCertificateParams) error
- func Run(runFilePath string, config runfileconfig.RunFileConfig) (bool, error)
- func Stop(runFilePath string, config runfileconfig.RunFileConfig) error
- func Uninstall(namespace string, uninstallAll bool, uninstallDev bool, timeout uint) error
- func Upgrade(conf UpgradeConfig) error
- type AnnotateOptions
- type Annotator
- type AnnoteOption
- func WithAPITokenSecret(apiTokenSecret string) AnnoteOption
- func WithAppID(appID string) AnnoteOption
- func WithAppMaxConcurrency(maxConcurrency int) AnnoteOption
- func WithAppPort(port int) AnnoteOption
- func WithAppProtocol(protocol string) AnnoteOption
- func WithAppSSL() AnnoteOption
- func WithAppTokenSecret(appTokenSecret string) AnnoteOption
- func WithCPULimit(cpuLimit string) AnnoteOption
- func WithCPURequest(cpuRequest string) AnnoteOption
- func WithConfig(cfg string) AnnoteOption
- func WithDaprImage(image string) AnnoteOption
- func WithDebugEnabled() AnnoteOption
- func WithDebugPort(debugPort int) AnnoteOption
- func WithDisableBuiltinK8sSecretStore() AnnoteOption
- func WithEnableAPILogging() AnnoteOption
- func WithEnv(env string) AnnoteOption
- func WithGracefulShutdownSeconds(gracefulShutdownSeconds int) AnnoteOption
- func WithHTTPStreamRequestBody() AnnoteOption
- func WithListenAddresses(listenAddresses string) AnnoteOption
- func WithLivenessProbeDelay(livenessProbeDelay int) AnnoteOption
- func WithLivenessProbePeriod(livenessProbePeriod int) AnnoteOption
- func WithLivenessProbeThreshold(livenessProbeThreshold int) AnnoteOption
- func WithLivenessProbeTimeout(livenessProbeTimeout int) AnnoteOption
- func WithLogAsJSON() AnnoteOption
- func WithLogLevel(logLevel string) AnnoteOption
- func WithMaxRequestBodySize(maxRequestBodySize int) AnnoteOption
- func WithMemoryLimit(memoryLimit string) AnnoteOption
- func WithMemoryRequest(memoryRequest string) AnnoteOption
- func WithMetricsEnabled() AnnoteOption
- func WithMetricsPort(port int) AnnoteOption
- func WithPlacementHostAddress(placementHostAddress string) AnnoteOption
- func WithProfileEnabled() AnnoteOption
- func WithReadBufferSize(readBufferSize int) AnnoteOption
- func WithReadinessProbeDelay(readinessProbeDelay int) AnnoteOption
- func WithReadinessProbePeriod(readinessProbePeriod int) AnnoteOption
- func WithReadinessProbeThreshold(readinessProbeThreshold int) AnnoteOption
- func WithReadinessProbeTimeout(readinessProbeTimeout int) AnnoteOption
- func WithUnixDomainSocketPath(unixDomainSocketPath string) AnnoteOption
- func WithVolumeMountsReadOnly(volumeMountsReadOnly string) AnnoteOption
- func WithVolumeMountsReadWrite(volumeMountsReadWrite string) AnnoteOption
- type ComponentsOutput
- type InitConfiguration
- type K8sAnnotator
- type K8sAnnotatorConfig
- type ListOutput
- type NamespacedObject
- type PortForward
- type RenewCertificateParams
- type StatusClient
- type StatusOutput
- type UpgradeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForCertExpiry ¶ added in v1.7.0
func CheckForCertExpiry()
Check and warn if cert expiry is less than `warningDaysForCertExpiry` days.
func CheckPodExists ¶ added in v0.9.0
func CheckPodExists(client k8s.Interface, namespace string, labelSelector map[string]string, deployName string) (bool, string)
CheckPodExists returns a boolean representing the pod's existence and the namespace that the given pod resides in, or empty if not present in the given namespace.
func DaprClient ¶ added in v0.4.0
DaprClient returns a new Kubernetes Dapr client.
func ExportTrustChain ¶ added in v0.10.0
ExportTrustChain takes the root cert, issuer cert and issuer key from a k8s cluster and saves them in a given directory.
func GenerateNewCertificates ¶ added in v1.7.0
func GetDaprControlPlaneCurrentConfig ¶ added in v1.8.0
func GetDaprControlPlaneCurrentConfig() (*v1alpha1.Configuration, error)
func GetDaprHelmChartName ¶ added in v1.7.0
func GetDaprHelmChartName(helmConf *helm.Configuration) (string, error)
func GetDaprNamespace ¶ added in v1.8.0
func GetDaprVersion ¶ added in v1.7.0
func GetDaprVersion(status []StatusOutput) string
func GetDefaultConfiguration ¶ added in v0.4.1
func GetDefaultConfiguration() v1alpha1.Configuration
func GetImageRegistry ¶ added in v1.8.0
func GetKubeConfigClient ¶ added in v0.9.0
GetKubeConfigClient returns the kubeconfig and the client created from the kubeconfig.
func Init ¶
func Init(config InitConfiguration) error
Init deploys the Dapr operator using the supplied runtime version.
func IsDashboardIncluded ¶ added in v1.11.0
IsDashboardIncluded returns true if dashboard is included in Helm chart version for Dapr.
func IsMTLSEnabled ¶ added in v0.4.0
func ListPodsInterface ¶ added in v0.11.0
func PrintComponents ¶ added in v1.0.0
PrintComponents prints all Dapr components.
func PrintConfigurations ¶ added in v1.0.0
PrintConfigurations prints all Dapr configurations.
func RenewCertificate ¶ added in v1.7.0
func RenewCertificate(conf RenewCertificateParams) error
func Run ¶
func Run(runFilePath string, config runfileconfig.RunFileConfig) (bool, error)
Run executes the application based on the run file configuration. Run creates a temporary `deploy` folder within the app/.dapr directory and then applies that to the context pointed to kubectl client.
func Stop ¶ added in v1.12.0
func Stop(runFilePath string, config runfileconfig.RunFileConfig) error
func Upgrade ¶ added in v1.0.0
func Upgrade(conf UpgradeConfig) error
Types ¶
type AnnotateOptions ¶ added in v1.8.0
type AnnotateOptions struct {
// contains filtered or unexported fields
}
AnnotateOptions configure the injection behavior.
func NewAnnotateOptions ¶ added in v1.8.0
func NewAnnotateOptions(opts ...AnnoteOption) AnnotateOptions
type AnnoteOption ¶ added in v1.8.0
type AnnoteOption func(*AnnotateOptions)
func WithAPITokenSecret ¶ added in v1.8.0
func WithAPITokenSecret(apiTokenSecret string) AnnoteOption
func WithAppID ¶ added in v1.8.0
func WithAppID(appID string) AnnoteOption
func WithAppMaxConcurrency ¶ added in v1.8.0
func WithAppMaxConcurrency(maxConcurrency int) AnnoteOption
func WithAppPort ¶ added in v1.8.0
func WithAppPort(port int) AnnoteOption
func WithAppProtocol ¶ added in v1.8.0
func WithAppProtocol(protocol string) AnnoteOption
func WithAppSSL ¶ added in v1.8.0
func WithAppSSL() AnnoteOption
func WithAppTokenSecret ¶ added in v1.8.0
func WithAppTokenSecret(appTokenSecret string) AnnoteOption
func WithCPULimit ¶ added in v1.8.0
func WithCPULimit(cpuLimit string) AnnoteOption
func WithCPURequest ¶ added in v1.8.0
func WithCPURequest(cpuRequest string) AnnoteOption
func WithConfig ¶ added in v1.8.0
func WithConfig(cfg string) AnnoteOption
func WithDaprImage ¶ added in v1.8.0
func WithDaprImage(image string) AnnoteOption
func WithDebugEnabled ¶ added in v1.8.0
func WithDebugEnabled() AnnoteOption
func WithDebugPort ¶ added in v1.8.0
func WithDebugPort(debugPort int) AnnoteOption
func WithDisableBuiltinK8sSecretStore ¶ added in v1.8.0
func WithDisableBuiltinK8sSecretStore() AnnoteOption
func WithEnableAPILogging ¶ added in v1.8.0
func WithEnableAPILogging() AnnoteOption
func WithEnv ¶ added in v1.8.0
func WithEnv(env string) AnnoteOption
func WithGracefulShutdownSeconds ¶ added in v1.8.0
func WithGracefulShutdownSeconds(gracefulShutdownSeconds int) AnnoteOption
func WithHTTPStreamRequestBody ¶ added in v1.8.0
func WithHTTPStreamRequestBody() AnnoteOption
func WithListenAddresses ¶ added in v1.8.0
func WithListenAddresses(listenAddresses string) AnnoteOption
func WithLivenessProbeDelay ¶ added in v1.8.0
func WithLivenessProbeDelay(livenessProbeDelay int) AnnoteOption
func WithLivenessProbePeriod ¶ added in v1.8.0
func WithLivenessProbePeriod(livenessProbePeriod int) AnnoteOption
func WithLivenessProbeThreshold ¶ added in v1.8.0
func WithLivenessProbeThreshold(livenessProbeThreshold int) AnnoteOption
func WithLivenessProbeTimeout ¶ added in v1.8.0
func WithLivenessProbeTimeout(livenessProbeTimeout int) AnnoteOption
func WithLogAsJSON ¶ added in v1.8.0
func WithLogAsJSON() AnnoteOption
func WithLogLevel ¶ added in v1.8.0
func WithLogLevel(logLevel string) AnnoteOption
func WithMaxRequestBodySize ¶ added in v1.8.0
func WithMaxRequestBodySize(maxRequestBodySize int) AnnoteOption
func WithMemoryLimit ¶ added in v1.8.0
func WithMemoryLimit(memoryLimit string) AnnoteOption
func WithMemoryRequest ¶ added in v1.8.0
func WithMemoryRequest(memoryRequest string) AnnoteOption
func WithMetricsEnabled ¶ added in v1.8.0
func WithMetricsEnabled() AnnoteOption
func WithMetricsPort ¶ added in v1.8.0
func WithMetricsPort(port int) AnnoteOption
func WithPlacementHostAddress ¶ added in v1.8.0
func WithPlacementHostAddress(placementHostAddress string) AnnoteOption
func WithProfileEnabled ¶ added in v1.8.0
func WithProfileEnabled() AnnoteOption
func WithReadBufferSize ¶ added in v1.8.0
func WithReadBufferSize(readBufferSize int) AnnoteOption
func WithReadinessProbeDelay ¶ added in v1.8.0
func WithReadinessProbeDelay(readinessProbeDelay int) AnnoteOption
func WithReadinessProbePeriod ¶ added in v1.8.0
func WithReadinessProbePeriod(readinessProbePeriod int) AnnoteOption
func WithReadinessProbeThreshold ¶ added in v1.8.0
func WithReadinessProbeThreshold(readinessProbeThreshold int) AnnoteOption
func WithReadinessProbeTimeout ¶ added in v1.8.0
func WithReadinessProbeTimeout(readinessProbeTimeout int) AnnoteOption
func WithUnixDomainSocketPath ¶ added in v1.8.0
func WithUnixDomainSocketPath(unixDomainSocketPath string) AnnoteOption
func WithVolumeMountsReadOnly ¶ added in v1.8.0
func WithVolumeMountsReadOnly(volumeMountsReadOnly string) AnnoteOption
func WithVolumeMountsReadWrite ¶ added in v1.8.0
func WithVolumeMountsReadWrite(volumeMountsReadWrite string) AnnoteOption
type ComponentsOutput ¶ added in v0.4.0
type ComponentsOutput struct { Namespace string `csv:"Namespace"` Name string `csv:"Name"` Type string `csv:"Type"` Version string `csv:"VERSION"` Scopes string `csv:"SCOPES"` Created string `csv:"CREATED"` Age string `csv:"AGE"` }
ComponentsOutput represent a Dapr component.
type InitConfiguration ¶ added in v0.10.0
type InitConfiguration struct { Version string DashboardVersion string Namespace string EnableMTLS bool EnableHA bool EnableDev bool Args []string Wait bool Timeout uint ImageRegistryURI string ImageVariant string RootCertificateFilePath string IssuerCertificateFilePath string IssuerPrivateKeyFilePath string }
type K8sAnnotator ¶ added in v1.8.0
type K8sAnnotator struct {
// contains filtered or unexported fields
}
func NewK8sAnnotator ¶ added in v1.8.0
func NewK8sAnnotator(config K8sAnnotatorConfig) *K8sAnnotator
func (*K8sAnnotator) Annotate ¶ added in v1.8.0
func (p *K8sAnnotator) Annotate(inputs []io.Reader, out io.Writer, opts AnnotateOptions) error
Annotate injects dapr annotations into the kubernetes resource.
type K8sAnnotatorConfig ¶ added in v1.8.0
type K8sAnnotatorConfig struct { // If TargetResource is set, we will search for it and then inject // annotations on that target resource. If it is not set, we will // update the first appropriate resource we find. TargetResource *string // If TargetNamespace is set, we will search for the target resource // in the provided target namespace. If it is not set, we will // just search for the first occurrence of the target resource. TargetNamespace *string }
type ListOutput ¶
type ListOutput struct { Namespace string `csv:"NAMESPACE" json:"namespace" yaml:"namespace"` AppID string `csv:"APP ID" json:"appId" yaml:"appId"` AppPort string `csv:"APP PORT" json:"appPort" yaml:"appPort"` Age string `csv:"AGE" json:"age" yaml:"age"` Created string `csv:"CREATED" json:"created" yaml:"created"` }
ListOutput represents the application ID, application port and creation time.
type NamespacedObject ¶ added in v1.8.0
type NamespacedObject interface {
GetNamespace() string
}
type PortForward ¶ added in v0.9.0
type PortForward struct { Config *rest.Config Method string URL *url.URL Host string LocalPort int RemotePort int EmitLogs bool StopCh chan struct{} ReadyCh chan struct{} }
PortForward provides a port-forward connection in a kubernetes cluster.
func NewPortForward ¶ added in v0.9.0
func NewPortForward( config *rest.Config, namespace, deployName string, host string, localPort, remotePort int, emitLogs bool, ) (*PortForward, error)
NewPortForward returns an instance of PortForward struct that can be used for establishing port-forwarding connection to a pod in kubernetes cluster, specified by namespace and deployName.
func (*PortForward) GetStop ¶ added in v0.9.0
func (pf *PortForward) GetStop() <-chan struct{}
GetStop returns StopCh for a PortForward instance. Receiving on StopCh will block until the port forwarding stops.
func (*PortForward) Init ¶ added in v0.9.0
func (pf *PortForward) Init() error
Init creates and runs a port-forward connection. This function blocks until connection is established. Note: Caller should call Stop() to finish the connection.
func (*PortForward) Stop ¶ added in v0.9.0
func (pf *PortForward) Stop()
Stop terminates port-forwarding connection.
type RenewCertificateParams ¶ added in v1.7.0
type StatusClient ¶ added in v0.11.0
type StatusClient struct {
// contains filtered or unexported fields
}
func NewStatusClient ¶ added in v0.11.0
func NewStatusClient() (*StatusClient, error)
Create a new k8s client for status commands.
func (*StatusClient) Status ¶ added in v0.11.0
func (s *StatusClient) Status() ([]StatusOutput, error)
List status for Dapr resources.
type StatusOutput ¶ added in v0.7.0
type StatusOutput struct { Name string `csv:"NAME"` Namespace string `csv:"NAMESPACE"` Healthy string `csv:"HEALTHY"` Status string `csv:"STATUS"` Replicas int `csv:"REPLICAS"` Version string `csv:"VERSION"` Age string `csv:"AGE"` Created string `csv:"CREATED"` }
StatusOutput represents the status of a named Dapr resource.
func GetDaprResourcesStatus ¶ added in v1.7.0
func GetDaprResourcesStatus() ([]StatusOutput, error)