+++ /dev/null
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
- name: mwan3rules.sdewan.akraino.org
-spec:
- group: sdewan.akraino.org
- names:
- kind: Mwan3Rule
- listKind: Mwan3RuleList
- plural: mwan3rules
- singular: mwan3rule
- scope: Namespaced
- subresources:
- status: {}
- validation:
- openAPIV3Schema:
- description: Mwan3Rule is the Schema for the mwan3rules API
- properties:
- apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
- type: string
- kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
- type: string
- metadata:
- type: object
- spec:
- description: Mwan3RuleSpec defines the desired state of Mwan3Rule
- properties:
- policy:
- description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
- Important: Run "operator-sdk generate k8s" to regenerate code after
- modifying this file Add custom validation using kubebuilder tags:
- https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
- rule:
- additionalProperties:
- properties:
- dest_ip:
- type: string
- dest_port:
- type: string
- family:
- type: string
- proto:
- type: string
- src_IP:
- type: string
- src_port:
- type: string
- sticky:
- type: string
- timeout:
- type: string
- use_policy:
- type: string
- required:
- - use_policy
- type: object
- type: object
- required:
- - policy
- - rule
- type: object
- status:
- description: Mwan3RuleStatus defines the observed state of Mwan3Rule
- type: object
- type: object
- version: v1alpha1
- versions:
- - name: v1alpha1
- served: true
- storage: true
+++ /dev/null
-apiVersion: apiextensions.k8s.io/v1beta1
-kind: CustomResourceDefinition
-metadata:
- name: sdewans.sdewan.akraino.org
-spec:
- group: sdewan.akraino.org
- names:
- kind: Sdewan
- listKind: SdewanList
- plural: sdewans
- singular: sdewan
- scope: Namespaced
- subresources:
- status: {}
- validation:
- openAPIV3Schema:
- description: Sdewan is the Schema for the sdewans API
- properties:
- apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
- type: string
- kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
- type: string
- metadata:
- type: object
- spec:
- description: SdewanSpec defines the desired state of Sdewan
- properties:
- mwan3Rule:
- type: string
- networks:
- items:
- description: SdewanSpec defines the desired state of Sdewan
- properties:
- defaultGateway:
- type: boolean
- interface:
- type: string
- isProvider:
- type: boolean
- name:
- type: string
- required:
- - name
- type: object
- type: array
- node:
- description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
- Important: Run "operator-sdk generate k8s" to regenerate code after
- modifying this file Add custom validation using kubebuilder tags:
- https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
- type: string
- required:
- - networks
- - node
- type: object
- status:
- description: SdewanStatus defines the observed state of Sdewan
- properties:
- mwan3Status:
- description: 'INSERT ADDITIONAL STATUS FIELD - define observed state
- of cluster Important: Run "operator-sdk generate k8s" to regenerate
- code after modifying this file Add custom validation using kubebuilder
- tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
- properties:
- appliedTime:
- type: string
- isApplied:
- type: boolean
- name:
- type: string
- required:
- - name
- type: object
- required:
- - mwan3Status
- type: object
- type: object
- version: v1alpha1
- versions:
- - name: v1alpha1
- served: true
- storage: true
+++ /dev/null
-apiVersion: sdewan.akraino.org/v1alpha1
-kind: Mwan3Rule
-metadata:
- name: example-mwan3rule
-spec:
- # Add fields here
- policy:
- testpolicy1:
- - network: ovn-priv-net
- metric: 1
- weight: 4
- rule:
- https:
- use_policy: testpolicy1
- dest_ip: 10.10.10.10
+++ /dev/null
-apiVersion: sdewan.akraino.org/v1alpha1
-kind: Sdewan
-metadata:
- name: example-sdewan
-spec:
- # Add fields here
- node: "ubuntu18"
- networks:
- - name: ovn-priv-net
- mwan3Rule: example-mwan3rule
+++ /dev/null
----
-apiVersion: k8s.cni.cncf.io/v1
-kind: NetworkAttachmentDefinition
-metadata:
- name: ovn-networkobj
-spec:
- config: '{
- "cniVersion": "0.3.1",
- "name": "ovn4nfv-k8s-plugin",
- "type": "ovn4nfvk8s-cni"
- }'
-
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: sdewan-operator
-spec:
- replicas: 1
- selector:
- matchLabels:
- name: sdewan-operator
- template:
- metadata:
- labels:
- name: sdewan-operator
- spec:
- serviceAccountName: sdewan-operator
- containers:
- - name: sdewan-operator
- # Replace this with the built image name
- image: chengtcli/sdewan-operator:latest
- command:
- - sdewan-operator
- imagePullPolicy: IfNotPresent
- env:
- - name: WATCH_NAMESPACE
- valueFrom:
- fieldRef:
- fieldPath: metadata.namespace
- - name: POD_NAME
- valueFrom:
- fieldRef:
- fieldPath: metadata.name
- - name: OPERATOR_NAME
- value: "sdewan-operator"
+++ /dev/null
-apiVersion: rbac.authorization.k8s.io/v1
-kind: Role
-metadata:
- creationTimestamp: null
- name: sdewan-operator
-rules:
-- apiGroups:
- - ""
- resources:
- - pods
- - services
- - services/finalizers
- - endpoints
- - persistentvolumeclaims
- - events
- - configmaps
- - secrets
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - apps
- resources:
- - deployments
- - daemonsets
- - replicasets
- - statefulsets
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - monitoring.coreos.com
- resources:
- - servicemonitors
- verbs:
- - get
- - create
-- apiGroups:
- - apps
- resourceNames:
- - sdewan-operator
- resources:
- - deployments/finalizers
- verbs:
- - update
-- apiGroups:
- - ""
- resources:
- - pods
- verbs:
- - get
-- apiGroups:
- - apps
- resources:
- - replicasets
- - deployments
- verbs:
- - get
-- apiGroups:
- - sdewan.akraino.org
- resources:
- - '*'
- - mwan3rules
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
+++ /dev/null
-kind: RoleBinding
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
- name: sdewan-operator
-subjects:
-- kind: ServiceAccount
- name: sdewan-operator
-roleRef:
- kind: Role
- name: sdewan-operator
- apiGroup: rbac.authorization.k8s.io
+++ /dev/null
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: sdewan-operator