Documentation
¶
Index ¶
- Variables
- func CreatePatchForDeployment(tpl *corev1.PodTemplateSpec, namespace string, gpuRequired *resource.Quantity, ...) ([]byte, error)
- type EnvKeyValue
- type Webhook
- func (wh *Webhook) AdmissionError(uid types.UID, err error) *admissionv1.AdmissionResponse
- func (wh *Webhook) CreateOrUpdateAppLabelMutatingWebhook() error
- func (wh *Webhook) CreateOrUpdateAppNamespaceValidatingWebhook() error
- func (wh *Webhook) CreateOrUpdateApplicationManagerMutatingWebhook() error
- func (wh *Webhook) CreateOrUpdateApplicationManagerValidatingWebhook() error
- func (wh *Webhook) CreateOrUpdateArgoResourceValidatingWebhook() error
- func (wh *Webhook) CreateOrUpdateCronWorkflowMutatingWebhook() error
- func (wh *Webhook) CreateOrUpdateGpuLimitMutatingWebhook() error
- func (wh *Webhook) CreateOrUpdateProviderRegistryValidatingWebhook() error
- func (wh *Webhook) CreateOrUpdateRunAsUserMutatingWebhook() error
- func (wh *Webhook) CreateOrUpdateSandboxMutatingWebhook() error
- func (wh *Webhook) CreateOrUpdateUserValidatingWebhook() error
- func (wh *Webhook) CreatePatch(ctx context.Context, pod *corev1.Pod, req *admissionv1.AdmissionRequest, ...) ([]byte, error)
- func (wh *Webhook) DeleteKubeletEvictionValidatingWebhook() error
- func (wh *Webhook) GetAdmissionRequestBody(req *restful.Request, resp *restful.Response) ([]byte, bool)
- func (wh *Webhook) GetAppConfig(namespace string) (appMgr *v1alpha1.ApplicationManager, appCfg *appcfg_mod.ApplicationConfig, ...)
- func (wh *Webhook) MustInject(ctx context.Context, pod *corev1.Pod, namespace string) (injectPolicy, injectWs, injectUpload bool, injectSharedPod *bool, ...)
- func (wh *Webhook) PatchAdmissionResponse(resp *admissionv1.AdmissionResponse, patchBytes []byte)
Constants ¶
This section is empty.
Variables ¶
var ( // Deserializer is used to decode the admission request body. Deserializer = codecs.UniversalDeserializer() // UUIDAnnotation uuid key for annotation. UUIDAnnotation = "sidecar.bytetrade.io/proxy-uuid" )
Functions ¶
func CreatePatchForDeployment ¶
func CreatePatchForDeployment(tpl *corev1.PodTemplateSpec, namespace string, gpuRequired *resource.Quantity, typeKey string, envKeyValues []EnvKeyValue) ([]byte, error)
CreatePatchForDeployment add gpu env for deployment and returns patch bytes.
Types ¶
type EnvKeyValue ¶
type Webhook ¶
type Webhook struct {
// contains filtered or unexported fields
}
Webhook used to implement a webhook.
func (*Webhook) AdmissionError ¶
func (wh *Webhook) AdmissionError(uid types.UID, err error) *admissionv1.AdmissionResponse
AdmissionError wraps error as AdmissionResponse
func (*Webhook) CreateOrUpdateAppLabelMutatingWebhook ¶
CreateOrUpdateAppLabelMutatingWebhook creates or updates app mutating webhook.
func (*Webhook) CreateOrUpdateAppNamespaceValidatingWebhook ¶
CreateOrUpdateAppNamespaceValidatingWebhook creates or updates app namespace validating webhook.
func (*Webhook) CreateOrUpdateApplicationManagerMutatingWebhook ¶
CreateOrUpdateApplicationManagerMutatingWebhook creates or updates the ApplicationManager mutating webhook.
func (*Webhook) CreateOrUpdateApplicationManagerValidatingWebhook ¶
CreateOrUpdateApplicationManagerValidatingWebhook creates or updates the ApplicationManager validating webhook.
func (*Webhook) CreateOrUpdateArgoResourceValidatingWebhook ¶
CreateOrUpdateArgoResourceValidatingWebhook creates or updates the argo resource validating webhook.
func (*Webhook) CreateOrUpdateCronWorkflowMutatingWebhook ¶
func (*Webhook) CreateOrUpdateGpuLimitMutatingWebhook ¶
CreateOrUpdateGpuLimitMutatingWebhook creates or updates gpu limit mutating webhook.
func (*Webhook) CreateOrUpdateProviderRegistryValidatingWebhook ¶
func (*Webhook) CreateOrUpdateRunAsUserMutatingWebhook ¶
CreateOrUpdateRunAsUserMutatingWebhook creates or updates gpu limit mutating webhook.
func (*Webhook) CreateOrUpdateSandboxMutatingWebhook ¶
CreateOrUpdateSandboxMutatingWebhook creates or updates the sandbox mutating webhook.
func (*Webhook) CreateOrUpdateUserValidatingWebhook ¶
CreateOrUpdateUserValidatingWebhook creates or updates user validating webhook.
func (*Webhook) CreatePatch ¶
func (wh *Webhook) CreatePatch( ctx context.Context, pod *corev1.Pod, req *admissionv1.AdmissionRequest, proxyUUID uuid.UUID, injectPolicy, injectWs, injectUpload bool, injectSharedPod *bool, appmgr *v1alpha1.ApplicationManager, appcfg *appcfg_mod.ApplicationConfig, perms []appcfg.ProviderPermission, ) ([]byte, error)
CreatePatch create a patch for a pod.
func (*Webhook) DeleteKubeletEvictionValidatingWebhook ¶
func (*Webhook) GetAdmissionRequestBody ¶
func (wh *Webhook) GetAdmissionRequestBody(req *restful.Request, resp *restful.Response) ([]byte, bool)
GetAdmissionRequestBody returns admission request body.
func (*Webhook) GetAppConfig ¶
func (wh *Webhook) GetAppConfig(namespace string) (appMgr *v1alpha1.ApplicationManager, appCfg *appcfg_mod.ApplicationConfig, isShared bool, err error)
GetAppConfig get app config by namespace.
func (*Webhook) MustInject ¶
func (wh *Webhook) MustInject(ctx context.Context, pod *corev1.Pod, namespace string) ( injectPolicy, injectWs, injectUpload bool, injectSharedPod *bool, perms []appcfg.ProviderPermission, appCfg *appcfg_mod.ApplicationConfig, appMgr *v1alpha1.ApplicationManager, err error)
MustInject checks which inject operation should do for a pod.
func (*Webhook) PatchAdmissionResponse ¶
func (wh *Webhook) PatchAdmissionResponse(resp *admissionv1.AdmissionResponse, patchBytes []byte)
PatchAdmissionResponse returns an admission response with patch data.