Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] use admissionregistration.k8s.io/v1 #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iwilltry42
Copy link
Contributor

@iwilltry42 iwilltry42 commented Feb 9, 2021

What and why?

  • admissionregistration.k8s.io/v1beta1 was deprecated in k8s v1.16
  • changeset includes fetching the APIVersion and Kind from the
    admissionReviewRequest to avoid related errors

Testing Steps

Please provide adequate testing steps (including screenshots if necessary).
Include any test fixtures or sample configurations in your commit.

  • existing tests pass
  • deployed and verified to be working on a k8s v1.19 cluster with the following (templated) config:
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: "tumblr-sidecar-injector-webhook"
  labels:
    app: k8s-sidecar-injector
    team: "MPOPS"
webhooks:
- name: "injector.tumblr.com"
  failurePolicy: "Ignore" # we fail "open" if the webhook is down hard
  rules:
  - operations: [ "CREATE" ]
    apiGroups: [""]
    apiVersions: ["v1"]
    resources: ["pods"]
  clientConfig:
    # https://github.com/kubernetes/kubernetes/blob/v1.10.0-beta.1/staging/src/k8s.io/api/admissionregistration/v1beta1/types.go#L218
    # note: k8s is smart enough to use 443 or the only exposed port on the service
    # note: this requires the service to serve TLS directly (not thru ingress)
    service:
      name: "k8s-sidecar-injector"
      namespace: "{{ .Release.Namespace }}"
      path: "/mutate"   # what /url/slug to send requests at
    # See README.md for how this was generated!
    caBundle: {{ required $caCertRequiredWarning (.Files.Get $caCert) | b64enc }}
  admissionReviewVersions: ["v1", "v1beta1"]
  sideEffects: None

Reviewers

Required reviewers: @byxorna
Request reviews from other people you want to review this PR in the "Reviewers" section on the right.

⚠️ this PR must have at least 2 thumbs from the MAINTAINERS.md of the project before merging!

- admissionregistration.k8s.io/v1beta1 was deprecated in k8s v1.16
- changeset includes fetching the APIVersion and Kind from the
admissionReviewRequest to avoid related errors
@hemals24
Copy link

@iwilltry42 Any plans to merge this?

@iwilltry42
Copy link
Contributor Author

@hemals24 , sure, but I'm not a maintainer, so waiting for review + merge 🤷‍♂️

@hemals24
Copy link

@byxorna The injector fails on the newer versions of k8s. This PR would fix the issue. Do you have plans to merge this?

@hemals24
Copy link

@iwilltry42 Add people as reviewers, that should help speed things up

@iwilltry42
Copy link
Contributor Author

Screenshot 2022-01-28 at 20-08-12  Enhancement  use admissionregistration k8s io v1 by iwilltry42 · Pull Request #57 · tumb

Unfortunately, that option is disabled and I cannot assign reviewers 🤔

@hemals24
Copy link

Strange !!! I used your code and modified it a little bit to pass the build. #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants