aboutsummaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorRitu Sood <ritu.sood@intel.com>2019-08-06 19:35:42 -0700
committerRitu Sood <ritu.sood@intel.com>2019-08-15 10:03:47 -0700
commit8295a28f6d6e14f5adb62138271de393015061e9 (patch)
treed11b1e799de55e89d08bc810180d99ce65e6f21e /deploy
parentaa41b49246d84b605a76d169f0c861ba0691a4fb (diff)
Use controller runtime and operator sdk
Changing the framework to use controller runtime and operator sdk. This allows to add CRD controllers for Network, Provider Network etc in the same operator. Binary renamed to nfn-operator (Network funtion networking). Change-Id: Ic25a3c3f5f1418fc0614f3aede48b41d9c1156cd Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Diffstat (limited to 'deploy')
-rw-r--r--deploy/operator.yaml42
-rw-r--r--deploy/operator_roles.yaml75
2 files changed, 117 insertions, 0 deletions
diff --git a/deploy/operator.yaml b/deploy/operator.yaml
new file mode 100644
index 0000000..a1edde8
--- /dev/null
+++ b/deploy/operator.yaml
@@ -0,0 +1,42 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: nfn-operator
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ name: nfn-operator
+ template:
+ metadata:
+ labels:
+ name: nfn-operator
+ spec:
+ serviceAccountName: k8s-nfn-sa
+ affinity:
+ nodeAffinity:
+ requiredDuringSchedulingIgnoredDuringExecution:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: nfnType
+ operator: In
+ values:
+ - operator
+ containers:
+ - name: nfn-operator
+ # Replace this with the built image name
+ image: rtsood/nfn-operator:latest
+ command:
+ - nfn-operator
+ imagePullPolicy: IfNotPresent
+ env:
+ - name: HOST_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.hostIP
+ - name: POD_NAME
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.name
+ - name: OPERATOR_NAME
+ value: "nfn-operator"
diff --git a/deploy/operator_roles.yaml b/deploy/operator_roles.yaml
new file mode 100644
index 0000000..2bd49ac
--- /dev/null
+++ b/deploy/operator_roles.yaml
@@ -0,0 +1,75 @@
+
+---
+
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: k8s-nfn-sa
+
+---
+
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ creationTimestamp: null
+ name: k8s-nfn-cr
+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
+ resourceNames:
+ - nfn-operator
+ resources:
+ - deployments/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - k8s.plugin.opnfv.org
+ resources:
+ - '*'
+ - providernetworks
+ verbs:
+ - '*'
+
+---
+
+kind: ClusterRoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+ name: k8s-nfn-crb
+subjects:
+- kind: Group
+ name: system:serviceaccounts
+ apiGroup: rbac.authorization.k8s.io
+roleRef:
+ kind: ClusterRole
+ name: k8s-nfn-cr
+ apiGroup: rbac.authorization.k8s.io
+