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

Problem with validating admission webhook #888

Closed
Adiqq opened this issue Feb 20, 2018 · 11 comments
Closed

Problem with validating admission webhook #888

Adiqq opened this issue Feb 20, 2018 · 11 comments
Assignees
Labels
Milestone

Comments

@Adiqq
Copy link

Adiqq commented Feb 20, 2018

Hi, does admission webhook, requires some additional configuration?
I'm using Voyager 6.0.0-rc.0 and k8s 1.9.3 and after adding --enable-admission-webhook to voyager.sh install script, I receive error:

cat ingress-https-test.yaml

apiVersion: voyager.appscode.com/v1beta1
kind: Ingress
metadata:
  name: test-https-ingress
  namespace: default
  annotations:
    ingress.appscode.com/type: NodePort
    ingress.appscode.com/hsts: "false"
spec:
  tls:
  - secretName: tls-secret
    hosts:
    - "*.a"
  rules:
  - host: "*.a"
    http:
      port: '32100'
      nodePort: '32100'
      paths:
      - backend:
          serviceName: httpbin
          servicePort: '8000'
  - host: "*.a"
    http:
      port: '32101'
      nodePort: '32101'
      paths:
      - backend:
          serviceName: httpbin2
          servicePort: '8000'

❯ kubectl apply -f ingress-https-test.yaml
Error from server (InternalError): error when creating "ingress-https-test.yaml": Internal error occurred: failed calling admission webhook "admission.voyager.appscode.com": Unauthorized```
@tamalsaha
Copy link
Contributor

Do you have RBAC enabled in your cluster? If yes, did you also pass --rbac flag ?

@tamalsaha tamalsaha self-assigned this Feb 20, 2018
@Adiqq
Copy link
Author

Adiqq commented Feb 20, 2018

Yes, I just tested it to be sure,
voyager.sh --provider=baremetal --rbac works fine. Problem exists with voyager.sh --provider=baremetal --rbac --enable-admission-webhook

@tamalsaha
Copy link
Contributor

ok. I will take a look and update this issue.

@tamalsaha tamalsaha added this to the 6.0.0 milestone Feb 21, 2018
@tamalsaha
Copy link
Contributor

tamalsaha commented Feb 27, 2018

@Adiqq, sorry for slow response. Here are few things to you can do to debug the issue:

  • First uninstall using the --uninstall flag.
  • Then reinstall with the --rbac flag.
  • Check that your cluster has aggregate api server enabled. Test that the configmap extension-apiserver-authentication-reader in kube-system namespace has key requestheader-client-ca-file.
kubectl describe configmap -n kube-system extension-apiserver-authentication
  • After installation check,
kubectl get apiservice v1beta1.admission.voyager.appscode.com -o yaml

The status section looks like:

status:
  conditions:
  - lastTransitionTime: 2018-02-27T07:59:50Z
    message: all checks passed
    reason: Passed
    status: "True"
    type: Available

@Adiqq
Copy link
Author

Adiqq commented Feb 27, 2018

Hi, for now I modified script to not force validating webhook on k8s >= 1.9 and it works fine, maybe there should be flag --disable-admission-webhook, so it can be easily disabled in case of problems. I'll try to debug it later.

@tamalsaha
Copy link
Contributor

You can set --enable-admission-webhook=false to disable it.

@Adiqq
Copy link
Author

Adiqq commented Feb 27, 2018

Are you sure?
I just glanced at script and found two lines,
if k8s >= 1.9, export VOYAGER_ENABLE_ADMISSION_WEBHOOK=true
https://github.com/appscode/voyager/blob/6.0.0-rc.0/hack/deploy/voyager.sh#L53
if --enable-admission-webhook , export VOYAGER_ENABLE_ADMISSION_WEBHOOK=true
https://github.com/appscode/voyager/blob/6.0.0-rc.0/hack/deploy/voyager.sh#L120

I might be wrong, but won't --enable-admission-webhook=false work equally to --enable-admission-webhook ?

@tamalsaha
Copy link
Contributor

You are right . I misspoke. Need to fix that.

@tamalsaha
Copy link
Contributor

Fixed here #900

@Adiqq
Copy link
Author

Adiqq commented Mar 19, 2018

@tamalsaha
Ok, I finally fixed it.
https://kubernetes.io/docs/admin/kubelet-authentication-authorization/
I set --anonymous-auth=false and that lead to 401 for anonymous user, setting --anonymous-auth=true fixed it.

@tamalsaha
Copy link
Contributor

Great! Thank you!

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

No branches or pull requests

2 participants