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

Helm chart seldon-manager role missing permissions for createResources: true #1885

Closed
wongelz opened this issue May 28, 2020 · 5 comments
Closed
Labels
bug triage Needs to be triaged and prioritised accordingly

Comments

@wongelz
Copy link

wongelz commented May 28, 2020

When createResources: true in values.yaml, seldon-controller-manager fails to start with this error:

2020-05-28T02:56:24.140Z	ERROR	setup	unable to initialise operator	{"error": "customresourcedefinitions.apiextensions.k8s.io \"seldondeployments.machinelearning.seldon.io\" is forbidden: User \"system:serviceaccount:default:seldon-manager\" cannot get resource \"customresourcedefinitions\" in API group \"apiextensions.k8s.io\" at the cluster scope"}
github.com/go-logr/zapr.(*zapLogger).Error
	/go/pkg/mod/github.com/go-logr/[email protected]/zapr.go:128
main.main
	/workspace/main.go:95
runtime.main
	/usr/local/go/src/runtime/proc.go:203

Copying the following from (https://github.com/SeldonIO/seldon-core/blob/master/operator/seldon-operator/deploy/role.yaml) to clusterrole_seldon-manager-role.yaml seems to make it work:

- apiGroups:
  - apiextensions.k8s.io
  resources:
  - customresourcedefinitions
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - admissionregistration.k8s.io
  resources:
  - mutatingwebhookconfigurations
  - validatingwebhookconfigurations
  verbs:
  - get
  - list
  - create
  - update

In fact there are a few more rules that are contained in https://github.com/SeldonIO/seldon-core/blob/master/operator/seldon-operator/deploy/role.yaml but missing in the helm chart.

@wongelz wongelz added bug triage Needs to be triaged and prioritised accordingly labels May 28, 2020
@ukclivecox
Copy link
Contributor

ukclivecox commented May 28, 2020

Is there a particular reason you are setting createResources? If you are just using Helm you can leave it as false. In master we have renamed createResources to managerCreateResources as its purpose is to say the manager container should create the needed resources rather than using yaml. This is needed only in certain restricted environments where the yaml can not be used directly.

There is also a bug fix for createResources in master. So I would suggest not setting it unless you really need to.

@wongelz
Copy link
Author

wongelz commented May 28, 2020

Reason is we've got seldon installed in its own (not default) namespace. When we create the SeldonDeployment we get this error:

Internal error occurred: failed calling webhook "v1alpha2.mseldondeployment.kb.io": Post https://seldon-webhook-service.seldon-system.svc:443/mutate-machinelearning-seldon-io-v1alpha2-seldondeployment?timeout=30s: x509: certificate is valid for seldon-webhook-service.default, seldon-webhook-service.default.svc, not seldon-webhook-service.seldon-system.svc

@ukclivecox
Copy link
Contributor

How did you install? If you use the --namespace argument to Helm it should create the correct certificates:

{{- if not .Values.createResources }}
{{- $altNames := list ( printf "seldon-webhook-service.%s" .Release.Namespace ) ( printf "seldon-webhook-service.%s.svc" .Release.Namespace ) -}}
{{- $ca := genCA "custom-metrics-ca" 365 -}}
{{- $cert := genSignedCert "seldon-webhook-service" nil $altNames 365 $ca -}}
---

@wongelz
Copy link
Author

wongelz commented May 28, 2020

Oh OK. We've been using kustomize to set the namespace.

Thanks for your advice!

@ukclivecox
Copy link
Contributor

For Kustomize you would need to use cert-manager. That should work also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Needs to be triaged and prioritised accordingly
Projects
None yet
Development

No branches or pull requests

2 participants