mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
140 lines
3.5 KiB
YAML
140 lines
3.5 KiB
YAML
## deployment/rbac.yaml
|
|
## Cluster role granting access to ArangoDeployment resources.
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: arango-deployments
|
|
rules:
|
|
- apiGroups: ["database.arangodb.com"]
|
|
resources: ["arangodeployments"]
|
|
verbs: ["*"]
|
|
|
|
---
|
|
|
|
## Cluster role granting access to all resources needed by the ArangoDeployment operator.
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: arango-deployment-operator
|
|
rules:
|
|
- apiGroups: ["database.arangodb.com"]
|
|
resources: ["arangodeployments"]
|
|
verbs: ["*"]
|
|
- apiGroups: ["apiextensions.k8s.io"]
|
|
resources: ["customresourcedefinitions"]
|
|
verbs: ["get"]
|
|
- apiGroups: [""]
|
|
resources: ["pods", "services", "endpoints", "persistentvolumeclaims", "events", "secrets"]
|
|
verbs: ["*"]
|
|
- apiGroups: [""]
|
|
resources: ["nodes"]
|
|
verbs: ["get"]
|
|
- apiGroups: ["apps"]
|
|
resources: ["deployments"]
|
|
verbs: ["*"]
|
|
- apiGroups: ["storage.k8s.io"]
|
|
resources: ["storageclasses"]
|
|
verbs: ["get", "list"]
|
|
|
|
---
|
|
|
|
## Bind the cluster role granting access to ArangoDeployment resources
|
|
## to the default service account of the configured namespace.
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
kind: RoleBinding
|
|
metadata:
|
|
name: arango-deployments
|
|
namespace: default
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: arango-deployments
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: default
|
|
namespace: default
|
|
|
|
---
|
|
|
|
## Bind the cluster role granting access to all resources needed by
|
|
## the ArangoDeployment operator to the default service account
|
|
## the is being used to run the operator deployment.
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
kind: ClusterRoleBinding
|
|
metadata:
|
|
name: arango-deployment-operator-default
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: arango-deployment-operator
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: default
|
|
namespace: default
|
|
|
|
---
|
|
|
|
## deployment/deployment.yaml
|
|
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: arango-deployment-operator
|
|
namespace: default
|
|
spec:
|
|
replicas: 2
|
|
strategy:
|
|
type: Recreate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
name: arango-deployment-operator
|
|
app: arango-deployment-operator
|
|
spec:
|
|
containers:
|
|
- name: operator
|
|
imagePullPolicy: IfNotPresent
|
|
image: arangodb/kube-arangodb@sha256:1ac03c2ecd188148259e392655381b05b32b389977b53b29ddc51f9d6c39bd88
|
|
args:
|
|
- --operator.deployment
|
|
- --chaos.allowed=false
|
|
env:
|
|
- name: MY_POD_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: MY_POD_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: MY_POD_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
ports:
|
|
- name: metrics
|
|
containerPort: 8528
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8528
|
|
scheme: HTTPS
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /ready/deployment
|
|
port: 8528
|
|
scheme: HTTPS
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
tolerations:
|
|
- key: "node.kubernetes.io/unreachable"
|
|
operator: "Exists"
|
|
effect: "NoExecute"
|
|
tolerationSeconds: 5
|
|
- key: "node.kubernetes.io/not-ready"
|
|
operator: "Exists"
|
|
effect: "NoExecute"
|
|
tolerationSeconds: 5
|
|
|