From cda9d563ef843be5f80ce5755cb291c68dc6e3e8 Mon Sep 17 00:00:00 2001 From: Srivahni Date: Mon, 5 Aug 2019 15:39:34 -0700 Subject: Skeletal code for visualization-operator This visualization-operator(based on operator-sdk) when deployed, should be able to manage(add/update/delete) the datasources dynamically without restarting the grafana pods. Issue-ID: ONAPARC-393 Signed-off-by: Srivahni Change-Id: I2df3659aca5dd9ad59cf58adaf3c30999829fa2f --- .../visualization-operator/deploy/operator.yaml | 33 ++++++++++++++ .../visualization-operator/deploy/role.yaml | 53 ++++++++++++++++++++++ .../deploy/role_binding.yaml | 11 +++++ .../deploy/service_account.yaml | 4 ++ 4 files changed, 101 insertions(+) create mode 100644 vnfs/DAaaS/microservices/visualization-operator/deploy/operator.yaml create mode 100644 vnfs/DAaaS/microservices/visualization-operator/deploy/role.yaml create mode 100644 vnfs/DAaaS/microservices/visualization-operator/deploy/role_binding.yaml create mode 100644 vnfs/DAaaS/microservices/visualization-operator/deploy/service_account.yaml (limited to 'vnfs/DAaaS/microservices/visualization-operator/deploy') diff --git a/vnfs/DAaaS/microservices/visualization-operator/deploy/operator.yaml b/vnfs/DAaaS/microservices/visualization-operator/deploy/operator.yaml new file mode 100644 index 00000000..6c37f312 --- /dev/null +++ b/vnfs/DAaaS/microservices/visualization-operator/deploy/operator.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: visualization-operator +spec: + replicas: 1 + selector: + matchLabels: + name: visualization-operator + template: + metadata: + labels: + name: visualization-operator + spec: + serviceAccountName: visualization-operator + containers: + - name: visualization-operator + # Replace this with the built image name + image: REPLACE_IMAGE + command: + - visualization-operator + imagePullPolicy: Always + env: + - name: WATCH_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: OPERATOR_NAME + value: "visualization-operator" diff --git a/vnfs/DAaaS/microservices/visualization-operator/deploy/role.yaml b/vnfs/DAaaS/microservices/visualization-operator/deploy/role.yaml new file mode 100644 index 00000000..a140ca2c --- /dev/null +++ b/vnfs/DAaaS/microservices/visualization-operator/deploy/role.yaml @@ -0,0 +1,53 @@ +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: visualization-operator +rules: +- apiGroups: + - "" + resources: + - pods + - services + - endpoints + - persistentvolumeclaims + - events + - configmaps + - secrets + verbs: + - "*" +- apiGroups: + - apps + resources: + - deployments + - daemonsets + - replicasets + - statefulsets + verbs: + - "*" +- apiGroups: + - monitoring.coreos.com + resources: + - servicemonitors + verbs: + - "get" + - "create" +- apiGroups: + - apps + resources: + - deployments/finalizers + resourceNames: + - visualization-operator + verbs: + - "update" +- apiGroups: + - "" + resources: + - pods + verbs: + - get +- apiGroups: + - apps + resources: + - replicasets + verbs: + - get diff --git a/vnfs/DAaaS/microservices/visualization-operator/deploy/role_binding.yaml b/vnfs/DAaaS/microservices/visualization-operator/deploy/role_binding.yaml new file mode 100644 index 00000000..234ba2a4 --- /dev/null +++ b/vnfs/DAaaS/microservices/visualization-operator/deploy/role_binding.yaml @@ -0,0 +1,11 @@ +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: visualization-operator +subjects: +- kind: ServiceAccount + name: visualization-operator +roleRef: + kind: Role + name: visualization-operator + apiGroup: rbac.authorization.k8s.io diff --git a/vnfs/DAaaS/microservices/visualization-operator/deploy/service_account.yaml b/vnfs/DAaaS/microservices/visualization-operator/deploy/service_account.yaml new file mode 100644 index 00000000..028feeeb --- /dev/null +++ b/vnfs/DAaaS/microservices/visualization-operator/deploy/service_account.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: visualization-operator -- cgit