Giter Club home page Giter Club logo

generic-admission-server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generic-admission-server's Issues

Is there established precedent for handling cert rotation?

We have problems with our webhooks starting to fail when cert rotation happens. We tried file monitoring the mounted certs and terminating the process if we see a change but even this is not working reliably and we end up with pods still stuck.

It does not seem there's any way to inject healthz checks, or to trap this kind of error. Should we look at adding a health check to this library which monitors for cert auth failures?

Or should we look to an external solution outside our apiserver process, (i.e. our operator) which catches the cert change and forces a redeploy?

cc @deads2k @sttts

Supporting conversion webhooks

Is there interest in supporting CRD conversion webhooks as part of this project? They don't quite fit under the term admission in the project name, but they are structured in an extremely similar way so it'd be great if we could use this to create both.

For context, we'd like to start implementing a conversion webhook in cert-manager and currently use this library for our validating webhook.

Add support out of cluster client config

Currently, the admission server is hard coded to load the in-cluster configuration, which restricts the server from be ran easily for development/testing/external to the server.

https://github.com/openshift/generic-admission-server/blob/master/pkg/apiserver/apiserver.go#L126-L129

Would you be open to a new New() method named NewWithClientConfig. This would allow servers using this as an delegated apiserver to pass in the client configuration determined via cli args.

NewCommandStartAdmissionServer hardcoded the server short/long description

// NewCommandStartMaster provides a CLI handler for 'start master' command
func NewCommandStartAdmissionServer(out, errOut io.Writer, stopCh <-chan struct{}, admissionHooks ...apiserver.AdmissionHook) *cobra.Command {
	o := NewAdmissionServerOptions(out, errOut, admissionHooks...)

	cmd := &cobra.Command{
		Short: "Launch a namespace reservation API server",
		Long:  "Launch a namespace reservation API server",
		RunE: func(c *cobra.Command, args []string) error {
			if err := o.Complete(); err != nil {
				return err
			}
			if err := o.Validate(args); err != nil {
				return err
			}
			if err := o.RunAdmissionServer(stopCh); err != nil {
				return err
			}
			return nil
		},
	}

	flags := cmd.Flags()
	o.RecommendedOptions.AddFlags(flags)

	return cmd
}

When create a new admission server using this, the description "Launch a namespace reservation API server" make user confused.

Object in admissionSpec is nil

The Object in admissionReview at here:

func (r *REST) Create(ctx context.Context, obj runtime.Object, _ rest.ValidateObjectFunc, _ bool) (runtime.Object, error) {
admissionReview := obj.(*admissionv1beta1.AdmissionReview)
admissionReview.Response = r.hookFn(admissionReview.Request)
return admissionReview, nil
}

seems always be nil

	pod, ok := admissionSpec.Object.Object.(*corev1.Pod)
	if !ok {
		logger.WithField("object", admissionSpec.Object.Object).Info("received non pod object")
		return util.ToFailAdmissionResponse(ctx, fmt.Errorf("received non pod object"))
	}

Here is the log I see:

$ tail -f /var/log/admission-apiserver.log
time="2019-01-03T05:05:27Z" level=info msg="received non pod object" object="<nil>" requestUID=2f846d0a-0f15-11e9-af8a-74dbd180a266
time="2019-01-03T05:05:27Z" level=info msg="received non pod object" object="<nil>" requestUID=2f8529c1-0f15-11e9-af8a-74dbd180a266
time="2019-01-03T05:05:27Z" level=info msg="received non pod object" object="<nil>" requestUID=2f88d30b-0f15-11e9-af8a-74dbd180a266
time="2019-01-03T05:05:27Z" level=info msg="received non pod object" object="<nil>" requestUID=2f8f88ff-0f15-11e9-af8a-74dbd180a266

Is there any chance that the object can be decoded automatically?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.