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

[BUG] demo deploy RBAC role is incomplete #64

Closed
LaysDragon opened this issue Feb 7, 2020 · 3 comments
Closed

[BUG] demo deploy RBAC role is incomplete #64

LaysDragon opened this issue Feb 7, 2020 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@LaysDragon
Copy link

LaysDragon commented Feb 7, 2020

Describe the bug
Flow the instruction from README via the admiral-install-v0.1-beta.tar.gz to deploy single cluster demo on kubernetes 1.16.6 and istio 1.4.3(deployed via rancher),the admiral will keep report about the error.

020-02-07T08:35:50.643231Z info Waiting for informer caches to sync
2020-02-07T08:35:50.647657Z warn Failed to refresh configmap state Error: configmaps "se-address-configmap" is forbidden: User "system:serviceaccount:admiral:admiral" cannot get resource "configmaps" in API group "" in the namespace "admiral-sync"
2020-02-07T08:35:50.647701Z info getting kubeconfig from: ""
ERROR: logging before flag.Parse: W0207 08:35:50.647710 1 client_config.go:552] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
2020-02-07T08:35:50.648535Z info Initializing default secret resolver
2020-02-07T08:35:50.648547Z info Setting up event handlers
...
...
...
2020-02-07T08:35:50.852004Z info op=Event type=service name=expose-operator-metrics cluster= message=Received, doing nothing
2020-02-07T08:35:50.852777Z error Could not get unique address after 3 retries. Failing to create serviceentry name=default.webapp.global
2020-02-07T08:35:50.852832Z info op=GetMeshPorts type=service name=webapp cluster=enmd message=No mesh ports present, defaulting to first port
2020-02-07T08:35:50.852848Z info op=Event type=deployment name=greeting cluster= message=Received
2020-02-07T08:35:50.852854Z info op=GetMeshPorts type=service name=greeting cluster=enmd message=No mesh ports present, defaulting to first port
2020-02-07T08:35:50.853501Z error Could not get unique address after 3 retries. Failing to create serviceentry name=default.greeting.global
2020-02-07T08:35:50.853516Z info op=GetMeshPorts type=service name=greeting cluster=enmd message=No mesh ports present, defaulting to first port
2020-02-07T08:35:51.776399Z info op=Event type=add name=konga cluster=enmd message=No dependent clusters found
2020-02-07T08:35:51.776579Z info op=Event type=add name=test cluster=enmd message=No dependent clusters found

Steps To Reproduce
Simply flow instruction in README

Expected behavior
Admiral should success generate ServiceEntry.

Note
I fix it via add RBAC role myself,not sure what is the best practice to set it so I give admiral full permission to configmaps in admiral-sync.
This problem might come from this PR which lost the RBAC part
#42

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: admiral-configmap-role
  namespace: admiral-sync
rules:
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - get
  - list
  - create
  - update
  - delete
  - patch
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: admiral-configmap-role-binding
  namespace: admiral-sync
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: admiral-configmap-role
subjects:
- kind: ServiceAccount
  name: admiral
  namespace: admiral

and here is another problem here

if err != nil {
log.Errorf("Could not get unique address after %v retries. Failing to create serviceentry name=%v", maxRetries, globalFqdn)
return nil
}

It ignore the source err and only report cannot not get unique address,and make it harder to find out what happen. It should log the source error to point out the real problem.

@LaysDragon LaysDragon added the bug Something isn't working label Feb 7, 2020
@aattuluri
Copy link
Contributor

@LaysDragon Great feedback, will fix this.

@josephpeacock josephpeacock added this to the v0.1 milestone Feb 12, 2020
josephpeacock pushed a commit that referenced this issue Feb 12, 2020
josephpeacock pushed a commit that referenced this issue Feb 12, 2020
Signed-off-by: Joe Peacock <joe_peacock@intuit.com>
josephpeacock added a commit that referenced this issue Feb 12, 2020
* Fixing rbac issues reported in #64

Signed-off-by: Joe Peacock <joe_peacock@intuit.com>

* improving logging for SE address generation

Signed-off-by: Joe Peacock <joe_peacock@intuit.com>
@martinbaillie
Copy link
Contributor

Having a play with Admiral and hit this using latest. Should these roles and bindings not be in whatever is the sync namespace? admiral-sync by default

@josephpeacock
Copy link
Collaborator

@martinbaillie Thanks for keeping me honest. We should have been overriding that namespace in Kustomize for the example. I fixed that and validated that the out of the box example starts up.

Mengying-Li pushed a commit that referenced this issue Apr 20, 2020
* Fixing rbac issues reported in #64

Signed-off-by: Joe Peacock <joe_peacock@intuit.com>

* improving logging for SE address generation

Signed-off-by: Joe Peacock <joe_peacock@intuit.com>
Signed-off-by: Madeline <madeline_li@intuit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants