kubernetes: k8s.io/kubernetes/plugin/pkg/admission/alwayspullimages Index | Files

package alwayspullimages

import "k8s.io/kubernetes/plugin/pkg/admission/alwayspullimages"

Package alwayspullimages contains an admission controller that modifies every new Pod to force the image pull policy to Always. This is useful in a multitenant cluster so that users can be assured that their private images can only be used by those who have the credentials to pull them. Without this admission controller, once an image has been pulled to a node, any pod from any user can use it simply by knowing the image's name (assuming the Pod is scheduled onto the right node), without any authorization check against the image. With this admission controller enabled, images are always pulled prior to starting containers, which means valid credentials are required.

Index

Package Files

admission.go

Constants

const PluginName = "AlwaysPullImages"

PluginName indicates name of admission plugin.

func Register Uses

func Register(plugins *admission.Plugins)

Register registers a plugin

type AlwaysPullImages Uses

type AlwaysPullImages struct {
    *admission.Handler
}

AlwaysPullImages is an implementation of admission.Interface. It looks at all new pods and overrides each container's image pull policy to Always.

func NewAlwaysPullImages Uses

func NewAlwaysPullImages() *AlwaysPullImages

NewAlwaysPullImages creates a new always pull images admission control handler

func (*AlwaysPullImages) Admit Uses

func (a *AlwaysPullImages) Admit(ctx context.Context, attributes admission.Attributes, o admission.ObjectInterfaces) (err error)

Admit makes an admission decision based on the request attributes

func (*AlwaysPullImages) Validate Uses

func (*AlwaysPullImages) Validate(ctx context.Context, attributes admission.Attributes, o admission.ObjectInterfaces) (err error)

Validate makes sure that all containers are set to always pull images

Package alwayspullimages imports 8 packages (graph) and is imported by 47 packages. Updated 2019-08-30. Refresh now. Tools for package owners.