Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // InitContainers - inject one or more initContainers into the pod spec. InitContainers []corev1.Container // Containers - inject one or more containers into the pod spec. Containers []corev1.Container // ExistingContainerConfig - configuration for injecting into the pre-existing containers. ExistingContainerConfig }
Config is the struct used to parse injection config items for Simple Sidecar. The InitContainers, Containers, Volumes, and EnvVars fields are arrays of Kubernetes objects that will be added to the pod spec.
type ExistingContainerConfig ¶
type ExistingContainerConfig struct { // Volumes - inject one or more volumes into pre-existing pod specs. Volumes []corev1.Volume // EnvVars - inject one or more environment variables into pre-existing pod specs. EnvVars []corev1.EnvVar // VolumeMounts - inject one or more volume mounts into pre-existing pod specs. // BEFORE sidecar injection. VolumeMounts []corev1.VolumeMount }
ExistingContainerConfig provides configuration for injecting into the pre-existing containers. This is useful for utilizing the functionality of injected containers
type MultiConfig ¶
MultiConfig is a map of Config objects. This allows for multiple named configurations to be loaded from a single configuration file. The name of the configuration is the key, it is used to determine which configuration to use when injecting sidecars.
func LoadConfig ¶
func LoadConfig(configFile string) (cfg MultiConfig, err error)
LoadConfig loads the configuration from the specified file and returns a MultiConfig object.
type WebhookServer ¶
type WebhookServer struct {
// contains filtered or unexported fields
}
WebhookServer contains the configuration for the webhook server. It's used as a receiver for various methods such as Start and Stop.
func NewWebhookServer ¶
func NewWebhookServer(cfg *WebhookServerConfig) *WebhookServer
NewWebhookServer creates a new WebhookServer object with the specified configuration.
func (*WebhookServer) Serve ¶
func (whs *WebhookServer) Serve(w http.ResponseWriter, r *http.Request)
Serve method for webhook server
func (*WebhookServer) Start ¶
func (whs *WebhookServer) Start() error
Start method for webhook server. It blocks until the server is stopped.
func (*WebhookServer) Stop ¶
func (whs *WebhookServer) Stop()
Stop method for webhook server. It stops the server gracefully.
type WebhookServerConfig ¶
type WebhookServerConfig struct { Port int CertPEM string KeyPEM string SidecarConfigs MultiConfig InfoLogger *log.Logger ErrorLogger *log.Logger WarnLogger *log.Logger }
WebhookServerConfig is the configuration for the webhook server. It contains the port to listen on, the path to the certificate and key files, the MultiConfig object containing the sidecar configurations, and the loggers for info, warning, and error messages.