Documentation
¶
Overview ¶
Package webhook contains PodMutator. It's a controller-runtime webhook that intercepts Pod Creation events and mutates them. The SecretsMutator injects secret references into pods that have the inject-flyte-secrets label.
Index ¶
- Constants
- func InitCerts(ctx context.Context, kubeClient kubernetes.Interface, ...) error
- func Setup(ctx context.Context, kubeClient kubernetes.Interface, ...) error
- type PodMutator
- func (pm PodMutator) CreateMutationWebhookConfiguration(namespace string) (*admissionregistrationv1.MutatingWebhookConfiguration, error)
- func (pm PodMutator) GetMutatePath() string
- func (pm PodMutator) Handle(ctx context.Context, request admission.Request) admission.Response
- func (pm PodMutator) Register(ctx context.Context, mgr manager.Manager) error
Constants ¶
View Source
const ( PodNameEnvVar = "POD_NAME" PodNamespaceEnvVar = "POD_NAMESPACE" )
View Source
const ( CaCertKey = "ca.crt" ServerCertKey = "tls.crt" ServerCertPrivateKey = "tls.key" )
Variables ¶
This section is empty.
Functions ¶
func InitCerts ¶
func InitCerts(ctx context.Context, kubeClient kubernetes.Interface, cfg *webhookConfig.Config) error
InitCerts generates a self-signed TLS certificate for the webhook and stores it in a k8s Secret.
func Setup ¶
func Setup(ctx context.Context, kubeClient kubernetes.Interface, cfg *webhookConfig.Config, defaultNamespace string, scope promutils.Scope, mgr manager.Manager) error
Setup initializes the webhook: generates certs, registers MutatingWebhookConfiguration, and registers the HTTP handler. It is called before mgr.Start() so that the webhook server is ready to receive requests.
Types ¶
type PodMutator ¶
type PodMutator struct {
// contains filtered or unexported fields
}
PodMutator implements controller-runtime WebHook interface.
func NewPodMutator ¶
func (PodMutator) CreateMutationWebhookConfiguration ¶
func (pm PodMutator) CreateMutationWebhookConfiguration(namespace string) (*admissionregistrationv1.MutatingWebhookConfiguration, error)
func (PodMutator) GetMutatePath ¶
func (pm PodMutator) GetMutatePath() string
Click to show internal directories.
Click to hide internal directories.