Documentation ¶
Index ¶
- Constants
- func GenerateCertificates(ctx context.Context, mgr manager.Manager, ...) ([]byte, error)
- type Webhook
- func (w *Webhook) Handle(ctx context.Context, req admission.Request) admission.Response
- func (w *Webhook) InjectAPIReader(r client.Reader) error
- func (w *Webhook) InjectCache(c cache.Cache) error
- func (w *Webhook) InjectDecoder(d *admission.Decoder) error
- func (w *Webhook) SetupWithManager(mgr ctrl.Manager) error
- func (w *Webhook) Start(ctx context.Context) error
Constants ¶
const ( // ModeService is a constant for the webhook mode indicating that the controller is running inside of the Kubernetes cluster it // is serving. ModeService = "service" // ModeURL is a constant for the webhook mode indicating that the controller is running outside of the Kubernetes cluster it // is serving. If this is set then a URL is required for configuration. ModeURL = "url" // ModeURLWithServiceName is a constant for the webhook mode indicating that the controller is running outside of the Kubernetes cluster it // is serving but in the same cluster like the kube-apiserver. If this is set then a URL is required for configuration. ModeURLWithServiceName = "url-service" )
const WebhookPath = "/webhook"
WebhookPath is the path under which the webhook will be registered.
Variables ¶
This section is empty.
Functions ¶
func GenerateCertificates ¶ added in v0.9.0
func GenerateCertificates(ctx context.Context, mgr manager.Manager, certDir, namespace, name, mode, url string) ([]byte, error)
GenerateCertificates generates the certificates that are required for a webhook. It returns the ca bundle, and it stores the server certificate and key locally on the file system.
Types ¶
type Webhook ¶
type Webhook struct {
// contains filtered or unexported fields
}
Webhook is the implementation for all the webhooks required for kupid.
func NewDefaultWebhook ¶
NewDefaultWebhook creates a Webhook instance with the default eet of processor factories registered.
func NewWebhookWithProcessorFactories ¶
NewWebhookWithProcessorFactories creates a Webhook instance with the supplied processor factories registered.
func (*Webhook) InjectAPIReader ¶ added in v0.1.2
InjectAPIReader injects a direct client.Reader into the webhook.
func (*Webhook) InjectCache ¶
InjectCache injects a cache into the webhook.
func (*Webhook) InjectDecoder ¶
InjectDecoder injects the decoder into a webhook.
func (*Webhook) SetupWithManager ¶
SetupWithManager sets up the webhook to inject applicable podschedulingpolicies and clusterpodschedulingpolicies.
Source Files ¶
- certificates.go
- cluster_pod_scheduling_policy_processor.go
- cronjob_processor.go
- daemonset_processor.go
- deployment_processor.go
- injector.go
- job_processor.go
- pod_processor.go
- pod_scheduling_policy_configuration_processor.go
- pod_scheduling_policy_processor.go
- processor.go
- replicaset_processor.go
- replicationcontroller_processor.go
- statefulset_processor.go
- webhook.go