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

Deployment Failed to Start in different Namespace other than Default #223

Closed
gopigrip7 opened this issue Jul 23, 2018 · 5 comments
Closed

Comments

@gopigrip7
Copy link

gopigrip7 commented Jul 23, 2018

Hi Team, I was trying to use the operator for prod, yes left with no choice. I was trying to setup a arangodb operator in operator Namespace and try to create deployment in the different namespace with below cluster role & binding.

When I create the deployment in operator namespace, the cluster starts but when trying to do in a different namespace, nothing happens.

Please point out any bug in my cluster definition.

kind: ClusterRole
metadata:
  name: arangodb-operator
rules:
- apiGroups: ["extensions"]
  resources: ["deployments", "replicasets", "daemonsets"]
  verbs: ["create", "get", "update", "delete", "list"]
- apiGroups: ["apiextensions.k8s.io"]
  resources: ["customresourcedefinitions"]
  verbs: ["create", "get", "update", "delete", "list"]
- apiGroups: ["storage.k8s.io"]
  resources: ["storageclasses"]
  verbs: ["get", "list", "create", "delete", "deletecollection"]
- apiGroups: [""]
  resources: ["endpoints","persistentvolumes", "persistentvolumeclaims", "services", "secrets", "configmaps","events","namespaces"] 
  verbs: ["*"]
- apiGroups: ["batch"]
  resources: ["cronjobs", "jobs"]
  verbs: ["create", "get", "deletecollection", "delete"]
- apiGroups: [""]
  resources: ["pods","nodes"]
  verbs: ["*"]
- apiGroups: ["apps"]
  resources: ["statefulsets", "deployments","replicasets"]
  verbs: ["*"]
- apiGroups: ["database.arangodb.com"]
  resources: ["arangodeployments"]
  verbs: ["*"]
- apiGroups: ["storage.arangodb.com"]
  resources: ["arangolocalstorages"]
  verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: arangodb-operator
  namespace: operator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: arangodb-operator
subjects:
- kind: ServiceAccount
  name: arangodb-operator
  namespace: operator```
@ewoutp
Copy link
Contributor

ewoutp commented Aug 6, 2018

hi @gopigrip7
To run the operator in a different namespace (than default), the following must change:

  • You must have enough permissions to access the new namespace
  • Every reference to namespace default in the YAML files needed to deploy the operators must be changed to the new namespace
  • The ArangoDeployment must be deployed in the new namespace.

@ewoutp
Copy link
Contributor

ewoutp commented Aug 6, 2018

Under tools/manifests there is a go program you can use to build a YAML file for a specific namespace (look in Makefile for how it is used).
Granted, this is not an easy way and we'll hope to make it easier soon.

@gopigrip7
Copy link
Author

Thanks @ewoutp. I reverted back to old creation templates without the operator. But Still feel, the operator is the right way to do. What you do think of the time line for this feature?

@ewoutp
Copy link
Contributor

ewoutp commented Aug 27, 2018

We're very close to merge PR #238 which adds the option to install the operator as a helm chart. That will be the preferred way to install the operator and (by nature of helm) make it really easy to install in a different namespace.

@ewoutp
Copy link
Contributor

ewoutp commented Sep 14, 2018

Helm is now available and the preferred solution for deploying in non-default namespaces.

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

No branches or pull requests

2 participants