From: Le Yao Date: Thu, 17 Feb 2022 02:20:59 +0000 (-0500) Subject: Remove Ctrl+M from repo X-Git-Tag: 21.12.03~1 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=26352a83fb972b1f9269e72627a6afafbfe833f6;p=icn%2Fsdwan.git Remove Ctrl+M from repo Ctrl+M indents the paragraph under Windows Signed-off-by: Le Yao Change-Id: Ibf1a1cebf94078897363af83442c542fec98e4c1 --- diff --git a/central-controller/README.md b/central-controller/README.md index f290a73..f0f53cb 100644 --- a/central-controller/README.md +++ b/central-controller/README.md @@ -1,28 +1,28 @@ -# Steps to setup Overlay Controller cluster - -###Prerequisite -**Install Kubernetes** - -###Install dependencies -**1. Install cert-manager** - -`$ kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml` - -**2. Create namespace for SDEWAN Overlay Controller Microservices** - -`$ kubectl create namespace sdewan-system` - -###Install CNF -**Please follow the README.md under ../platform/cnf folder for installation** - -###Install CRD Controller -**Please follow the README.md under ../platform/crd-ctrlr folder for installation** - -###Install Overlay Controller Microservices -**Please follow the README.md under deployments folder for installation** - -###Configurations for Overlay Controller -**1. Routing rule** - -**2. Local cluster registration** -**Please follow the README.md under reg_cluster/ to finish the registration** +# Steps to setup Overlay Controller cluster + +###Prerequisite +**Install Kubernetes** + +###Install dependencies +**1. Install cert-manager** + +`$ kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml` + +**2. Create namespace for SDEWAN Overlay Controller Microservices** + +`$ kubectl create namespace sdewan-system` + +###Install CNF +**Please follow the README.md under ../platform/cnf folder for installation** + +###Install CRD Controller +**Please follow the README.md under ../platform/crd-ctrlr folder for installation** + +###Install Overlay Controller Microservices +**Please follow the README.md under deployments folder for installation** + +###Configurations for Overlay Controller +**1. Routing rule** + +**2. Local cluster registration** +**Please follow the README.md under reg_cluster/ to finish the registration** diff --git a/central-controller/build/Dockerfile b/central-controller/build/Dockerfile index e438ddc..81173f6 100644 --- a/central-controller/build/Dockerfile +++ b/central-controller/build/Dockerfile @@ -1,35 +1,35 @@ -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# Copyright (c) 2021 Intel Corporation -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -FROM golang:1.17-alpine - -RUN apk update \ - && apk add --no-cache make - -WORKDIR /go/src/github.com/central-controller -COPY ./ ./ -RUN cd src/scc && make all -RUN cd src/rsync && make all -RUN cd src/monitor && make all - -FROM alpine:3.15 - -WORKDIR /opt/scc -RUN addgroup -S scc && adduser -S -G scc scc -RUN chown scc:scc /opt/scc -R - -COPY --chown=scc --from=0 /go/src/github.com/central-controller/src/scc/scc ./ -COPY --chown=scc --from=0 /go/src/github.com/central-controller/src/rsync/rsync ./ -COPY --chown=scc --from=0 /go/src/github.com/central-controller/src/monitor/monitor ./ -COPY --chown=scc --from=0 /go/src/github.com/central-controller/build/entrypoint ./ -RUN chmod +x entrypoint - -USER scc - -ENTRYPOINT ["./entrypoint"] +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2021 Intel Corporation +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +FROM golang:1.17-alpine + +RUN apk update \ + && apk add --no-cache make + +WORKDIR /go/src/github.com/central-controller +COPY ./ ./ +RUN cd src/scc && make all +RUN cd src/rsync && make all +RUN cd src/monitor && make all + +FROM alpine:3.15 + +WORKDIR /opt/scc +RUN addgroup -S scc && adduser -S -G scc scc +RUN chown scc:scc /opt/scc -R + +COPY --chown=scc --from=0 /go/src/github.com/central-controller/src/scc/scc ./ +COPY --chown=scc --from=0 /go/src/github.com/central-controller/src/rsync/rsync ./ +COPY --chown=scc --from=0 /go/src/github.com/central-controller/src/monitor/monitor ./ +COPY --chown=scc --from=0 /go/src/github.com/central-controller/build/entrypoint ./ +RUN chmod +x entrypoint + +USER scc + +ENTRYPOINT ["./entrypoint"] diff --git a/central-controller/build/README.md b/central-controller/build/README.md index dec5cd8..009881b 100644 --- a/central-controller/build/README.md +++ b/central-controller/build/README.md @@ -1,5 +1,5 @@ -# Steps for building v1 API Docker Image - - `$cd central-controller` - +# Steps for building v1 API Docker Image + + `$cd central-controller` + `$docker build -f build/Dockerfile . -t scc` \ No newline at end of file diff --git a/central-controller/deployments/README.md b/central-controller/deployments/README.md index 520321a..4a12721 100644 --- a/central-controller/deployments/README.md +++ b/central-controller/deployments/README.md @@ -1,26 +1,26 @@ -# Steps for running v1 API microservices - -### Precondition -**1. Install cert-manager** - -`$ kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml` - -### Steps to install packages from yaml -**1. Create namespace for SDEWAN Central Controller v1Microservices** - -`$cd kubernetes` -`$ kubectl create namespace sdewan-system` - -**2. Create Databases used by SDEWAN Central Controller v1 Microservices for Etcd and Mongo** - -`$ kubectl apply -f scc_db.yaml -n sdewan-system` - -**3. create SDEWAN Central Controller v1 Microservices** - -`$ kubectl apply -f scc.yaml -n sdewan-system` - -`$ kubectl apply -f scc_rsync.yaml -n sdewan-system` - -**4. install monitor resources** - -`$ ./monitor-deploy.sh` +# Steps for running v1 API microservices + +### Precondition +**1. Install cert-manager** + +`$ kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml` + +### Steps to install packages from yaml +**1. Create namespace for SDEWAN Central Controller v1Microservices** + +`$cd kubernetes` +`$ kubectl create namespace sdewan-system` + +**2. Create Databases used by SDEWAN Central Controller v1 Microservices for Etcd and Mongo** + +`$ kubectl apply -f scc_db.yaml -n sdewan-system` + +**3. create SDEWAN Central Controller v1 Microservices** + +`$ kubectl apply -f scc.yaml -n sdewan-system` + +`$ kubectl apply -f scc_rsync.yaml -n sdewan-system` + +**4. install monitor resources** + +`$ ./monitor-deploy.sh` diff --git a/central-controller/deployments/kubernetes/monitor-deploy.sh b/central-controller/deployments/kubernetes/monitor-deploy.sh index 8884384..77dbef6 100644 --- a/central-controller/deployments/kubernetes/monitor-deploy.sh +++ b/central-controller/deployments/kubernetes/monitor-deploy.sh @@ -1,7 +1,7 @@ -kubectl apply -f monitor/crds/k8splugin_v1alpha1_resourcebundlestate_crd.yaml -kubectl apply -f monitor/role.yaml -kubectl apply -f monitor/cluster_role.yaml -kubectl apply -f monitor/role_binding.yaml -kubectl apply -f monitor/clusterrole_binding.yaml -kubectl apply -f monitor/service_account.yaml -kubectl apply -f monitor/operator.yaml +kubectl apply -f monitor/crds/k8splugin_v1alpha1_resourcebundlestate_crd.yaml +kubectl apply -f monitor/role.yaml +kubectl apply -f monitor/cluster_role.yaml +kubectl apply -f monitor/role_binding.yaml +kubectl apply -f monitor/clusterrole_binding.yaml +kubectl apply -f monitor/service_account.yaml +kubectl apply -f monitor/operator.yaml diff --git a/central-controller/deployments/kubernetes/monitor-undeploy.sh b/central-controller/deployments/kubernetes/monitor-undeploy.sh index 05d00f6..7d75a2e 100644 --- a/central-controller/deployments/kubernetes/monitor-undeploy.sh +++ b/central-controller/deployments/kubernetes/monitor-undeploy.sh @@ -1,7 +1,7 @@ -kubectl delete -f monitor/crds/k8splugin_v1alpha1_resourcebundlestate_crd.yaml -kubectl delete -f monitor/role.yaml -kubectl delete -f monitor/cluster_role.yaml -kubectl delete -f monitor/role_binding.yaml -kubectl delete -f monitor/clusterrole_binding.yaml -kubectl delete -f monitor/service_account.yaml -kubectl delete -f monitor/operator.yaml +kubectl delete -f monitor/crds/k8splugin_v1alpha1_resourcebundlestate_crd.yaml +kubectl delete -f monitor/role.yaml +kubectl delete -f monitor/cluster_role.yaml +kubectl delete -f monitor/role_binding.yaml +kubectl delete -f monitor/clusterrole_binding.yaml +kubectl delete -f monitor/service_account.yaml +kubectl delete -f monitor/operator.yaml diff --git a/central-controller/deployments/kubernetes/monitor/cluster_role.yaml b/central-controller/deployments/kubernetes/monitor/cluster_role.yaml index f82622a..9330a68 100644 --- a/central-controller/deployments/kubernetes/monitor/cluster_role.yaml +++ b/central-controller/deployments/kubernetes/monitor/cluster_role.yaml @@ -1,78 +1,78 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - creationTimestamp: null - name: monitor -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: - - monitor - resources: - - deployments/finalizers - verbs: - - update -- apiGroups: - - "" - resources: - - pods - verbs: - - get -- apiGroups: - - apps - resources: - - replicasets - verbs: - - get -- apiGroups: - - k8splugin.io - resources: - - '*' - verbs: - - '*' -- apiGroups: - - batch - resources: - - '*' - verbs: - - '*' -- apiGroups: - - extensions - resources: - - '*' - verbs: - - '*' -- apiGroups: - - certificates.k8s.io - resources: - - '*' - verbs: - - '*' +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + name: monitor +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: + - monitor + resources: + - deployments/finalizers + verbs: + - update +- apiGroups: + - "" + resources: + - pods + verbs: + - get +- apiGroups: + - apps + resources: + - replicasets + verbs: + - get +- apiGroups: + - k8splugin.io + resources: + - '*' + verbs: + - '*' +- apiGroups: + - batch + resources: + - '*' + verbs: + - '*' +- apiGroups: + - extensions + resources: + - '*' + verbs: + - '*' +- apiGroups: + - certificates.k8s.io + resources: + - '*' + verbs: + - '*' diff --git a/central-controller/deployments/kubernetes/monitor/clusterrole_binding.yaml b/central-controller/deployments/kubernetes/monitor/clusterrole_binding.yaml index 40187e9..73e7403 100644 --- a/central-controller/deployments/kubernetes/monitor/clusterrole_binding.yaml +++ b/central-controller/deployments/kubernetes/monitor/clusterrole_binding.yaml @@ -1,12 +1,12 @@ -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: monitor -subjects: -- kind: ServiceAccount - name: monitor - namespace: default -roleRef: - kind: ClusterRole - name: monitor - apiGroup: rbac.authorization.k8s.io +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: monitor +subjects: +- kind: ServiceAccount + name: monitor + namespace: default +roleRef: + kind: ClusterRole + name: monitor + apiGroup: rbac.authorization.k8s.io diff --git a/central-controller/deployments/kubernetes/monitor/crds/k8splugin_v1alpha1_resourcebundlestate_cr.yaml b/central-controller/deployments/kubernetes/monitor/crds/k8splugin_v1alpha1_resourcebundlestate_cr.yaml index cb1a163..86fe055 100644 --- a/central-controller/deployments/kubernetes/monitor/crds/k8splugin_v1alpha1_resourcebundlestate_cr.yaml +++ b/central-controller/deployments/kubernetes/monitor/crds/k8splugin_v1alpha1_resourcebundlestate_cr.yaml @@ -1,12 +1,12 @@ -apiVersion: k8splugin.io/v1alpha1 -kind: ResourceBundleState -metadata: - name: example-resourcebundlestate - labels: - "emco/deployment-id": "bionic-beaver" -spec: - selector: - matchLabels: - "emco/deployment-id": "bionic-beaver" -status: - ready: false +apiVersion: k8splugin.io/v1alpha1 +kind: ResourceBundleState +metadata: + name: example-resourcebundlestate + labels: + "emco/deployment-id": "bionic-beaver" +spec: + selector: + matchLabels: + "emco/deployment-id": "bionic-beaver" +status: + ready: false diff --git a/central-controller/deployments/kubernetes/monitor/crds/k8splugin_v1alpha1_resourcebundlestate_crd.yaml b/central-controller/deployments/kubernetes/monitor/crds/k8splugin_v1alpha1_resourcebundlestate_crd.yaml index 39a3917..4ae37c9 100644 --- a/central-controller/deployments/kubernetes/monitor/crds/k8splugin_v1alpha1_resourcebundlestate_crd.yaml +++ b/central-controller/deployments/kubernetes/monitor/crds/k8splugin_v1alpha1_resourcebundlestate_crd.yaml @@ -1,102 +1,102 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: resourcebundlestates.k8splugin.io -spec: - group: k8splugin.io - names: - kind: ResourceBundleState - listKind: ResourceBundleStateList - plural: resourcebundlestates - singular: resourcebundlestate - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - 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/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/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - properties: - selector: - type: object - required: - - selector - type: object - status: - properties: - podStatuses: - items: - type: object - type: array - ready: - type: boolean - resourceCount: - format: int32 - type: integer - serviceStatuses: - items: - type: object - type: array - configMapStatuses: - items: - type: object - type: array - deploymentStatuses: - items: - type: object - type: array - secretStatuses: - items: - type: object - type: array - daemonSetStatuses: - items: - type: object - type: array - ingressStatuses: - items: - type: object - type: array - jobStatuses: - items: - type: object - type: array - statefulSetStatuses: - items: - type: object - type: array - csrStatuses: - items: - type: object - type: array - required: - - ready - - resourceCount - - podStatuses - - serviceStatuses - - configMapStatuses - - deploymentStatuses - - secretStatuses - - daemonSetStatuses - - ingressStatuses - - jobStatuses - - statefulSetStatuses - - csrStatuses - type: object - type: object - served: true - storage: true - subresources: - status: {} +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: resourcebundlestates.k8splugin.io +spec: + group: k8splugin.io + names: + kind: ResourceBundleState + listKind: ResourceBundleStateList + plural: resourcebundlestates + singular: resourcebundlestate + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + 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/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/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + selector: + type: object + required: + - selector + type: object + status: + properties: + podStatuses: + items: + type: object + type: array + ready: + type: boolean + resourceCount: + format: int32 + type: integer + serviceStatuses: + items: + type: object + type: array + configMapStatuses: + items: + type: object + type: array + deploymentStatuses: + items: + type: object + type: array + secretStatuses: + items: + type: object + type: array + daemonSetStatuses: + items: + type: object + type: array + ingressStatuses: + items: + type: object + type: array + jobStatuses: + items: + type: object + type: array + statefulSetStatuses: + items: + type: object + type: array + csrStatuses: + items: + type: object + type: array + required: + - ready + - resourceCount + - podStatuses + - serviceStatuses + - configMapStatuses + - deploymentStatuses + - secretStatuses + - daemonSetStatuses + - ingressStatuses + - jobStatuses + - statefulSetStatuses + - csrStatuses + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/central-controller/deployments/kubernetes/monitor/monitor-cleanup.sh b/central-controller/deployments/kubernetes/monitor/monitor-cleanup.sh index 44f241f..2172507 100644 --- a/central-controller/deployments/kubernetes/monitor/monitor-cleanup.sh +++ b/central-controller/deployments/kubernetes/monitor/monitor-cleanup.sh @@ -1,6 +1,6 @@ -kubectl delete rolebinding monitor -kubectl delete clusterrolebinding monitor -kubectl delete role monitor -kubectl delete clusterrole monitor -kubectl delete serviceaccount monitor -kubectl delete deploy monitor +kubectl delete rolebinding monitor +kubectl delete clusterrolebinding monitor +kubectl delete role monitor +kubectl delete clusterrole monitor +kubectl delete serviceaccount monitor +kubectl delete deploy monitor diff --git a/central-controller/deployments/kubernetes/monitor/operator.yaml b/central-controller/deployments/kubernetes/monitor/operator.yaml index ce320bb..2c69345 100644 --- a/central-controller/deployments/kubernetes/monitor/operator.yaml +++ b/central-controller/deployments/kubernetes/monitor/operator.yaml @@ -1,32 +1,32 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: monitor - labels: - "emco/deployment-id": "monitor" -spec: - replicas: 1 - selector: - matchLabels: - "emco/deployment-id": "monitor" - template: - metadata: - labels: - "emco/deployment-id": "monitor" - spec: - serviceAccountName: monitor - containers: - - name: monitor - # Replace this with the built image name - image: scc:latest - command: ["/opt/scc/entrypoint", "monitor"] - imagePullPolicy: IfNotPresent - env: - - name: WATCH_NAMESPACE - value: "" - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: OPERATOR_NAME - value: "monitor" +apiVersion: apps/v1 +kind: Deployment +metadata: + name: monitor + labels: + "emco/deployment-id": "monitor" +spec: + replicas: 1 + selector: + matchLabels: + "emco/deployment-id": "monitor" + template: + metadata: + labels: + "emco/deployment-id": "monitor" + spec: + serviceAccountName: monitor + containers: + - name: monitor + # Replace this with the built image name + image: scc:latest + command: ["/opt/scc/entrypoint", "monitor"] + imagePullPolicy: IfNotPresent + env: + - name: WATCH_NAMESPACE + value: "" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: OPERATOR_NAME + value: "monitor" diff --git a/central-controller/deployments/kubernetes/monitor/role.yaml b/central-controller/deployments/kubernetes/monitor/role.yaml index 19cf957..c48141a 100644 --- a/central-controller/deployments/kubernetes/monitor/role.yaml +++ b/central-controller/deployments/kubernetes/monitor/role.yaml @@ -1,72 +1,72 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - creationTimestamp: null - name: monitor -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: - - monitor - resources: - - deployments/finalizers - verbs: - - update -- apiGroups: - - "" - resources: - - pods - verbs: - - get -- apiGroups: - - apps - resources: - - replicasets - verbs: - - get -- apiGroups: - - k8splugin.io - resources: - - '*' - verbs: - - '*' -- apiGroups: - - batch - resources: - - '*' - verbs: - - '*' -- apiGroups: - - extensions - resources: - - '*' - verbs: - - '*' +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + creationTimestamp: null + name: monitor +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: + - monitor + resources: + - deployments/finalizers + verbs: + - update +- apiGroups: + - "" + resources: + - pods + verbs: + - get +- apiGroups: + - apps + resources: + - replicasets + verbs: + - get +- apiGroups: + - k8splugin.io + resources: + - '*' + verbs: + - '*' +- apiGroups: + - batch + resources: + - '*' + verbs: + - '*' +- apiGroups: + - extensions + resources: + - '*' + verbs: + - '*' diff --git a/central-controller/deployments/kubernetes/monitor/role_binding.yaml b/central-controller/deployments/kubernetes/monitor/role_binding.yaml index b3ec755..69cd293 100644 --- a/central-controller/deployments/kubernetes/monitor/role_binding.yaml +++ b/central-controller/deployments/kubernetes/monitor/role_binding.yaml @@ -1,11 +1,11 @@ -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: monitor -subjects: -- kind: ServiceAccount - name: monitor -roleRef: - kind: Role - name: monitor - apiGroup: rbac.authorization.k8s.io +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: monitor +subjects: +- kind: ServiceAccount + name: monitor +roleRef: + kind: Role + name: monitor + apiGroup: rbac.authorization.k8s.io diff --git a/central-controller/deployments/kubernetes/monitor/service_account.yaml b/central-controller/deployments/kubernetes/monitor/service_account.yaml index f0101eb..ba9b61c 100644 --- a/central-controller/deployments/kubernetes/monitor/service_account.yaml +++ b/central-controller/deployments/kubernetes/monitor/service_account.yaml @@ -1,4 +1,4 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: monitor +apiVersion: v1 +kind: ServiceAccount +metadata: + name: monitor diff --git a/central-controller/deployments/kubernetes/scc.yaml b/central-controller/deployments/kubernetes/scc.yaml index 2db15e7..421f783 100644 --- a/central-controller/deployments/kubernetes/scc.yaml +++ b/central-controller/deployments/kubernetes/scc.yaml @@ -1,100 +1,100 @@ -# Resources to create SDEWAN Central Controller v1 Microservices -# SCC Config Map -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: scc-rbac -subjects: - - kind: ServiceAccount - name: default - namespace: sdewan-system -roleRef: - kind: ClusterRole - name: cluster-admin - apiGroup: rbac.authorization.k8s.io - ---- -# SCC Config Map -kind: ConfigMap -apiVersion: v1 -metadata: - name: scc - labels: - app: scc -data: - config.json: | - { - "database-type": "mongo", - "database-ip": "mongo", - "etcd-ip": "etcd", - "service-port": "9015" - } - rsync_config.json: | - { - "rsync-ip": "rsync", - "rsync-port": "9041" - } - ---- -# SCC Service -apiVersion: v1 -kind: Service -metadata: - name: scc - labels: - app: scc -spec: - selector: - app: scc - type: NodePort - ports: - - name: http - port: 9015 - nodePort: 31298 - protocol: TCP - targetPort: 9015 - ---- -# SCC Deployment -apiVersion: apps/v1 -kind: Deployment -metadata: - name: scc -spec: - replicas: 1 - selector: - matchLabels: - app: scc - template: - metadata: - labels: - app: scc - spec: - containers: - - name: scc - image: scc:latest - imagePullPolicy: IfNotPresent - command: ["/opt/scc/entrypoint", "scc"] - workingDir: /opt/scc - ports: - - containerPort: 9015 - volumeMounts: - - name: config - mountPath: /opt/scc/config.json - subPath: config.json - - name: rsync-config - mountPath: /opt/scc/rsync_config.json - subPath: rsync_config.json - volumes: - - name: config - configMap: - name: scc - items: - - key: config.json - path: config.json - - name: rsync-config - configMap: - name: scc - items: - - key: rsync_config.json - path: rsync_config.json +# Resources to create SDEWAN Central Controller v1 Microservices +# SCC Config Map +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: scc-rbac +subjects: + - kind: ServiceAccount + name: default + namespace: sdewan-system +roleRef: + kind: ClusterRole + name: cluster-admin + apiGroup: rbac.authorization.k8s.io + +--- +# SCC Config Map +kind: ConfigMap +apiVersion: v1 +metadata: + name: scc + labels: + app: scc +data: + config.json: | + { + "database-type": "mongo", + "database-ip": "mongo", + "etcd-ip": "etcd", + "service-port": "9015" + } + rsync_config.json: | + { + "rsync-ip": "rsync", + "rsync-port": "9041" + } + +--- +# SCC Service +apiVersion: v1 +kind: Service +metadata: + name: scc + labels: + app: scc +spec: + selector: + app: scc + type: NodePort + ports: + - name: http + port: 9015 + nodePort: 31298 + protocol: TCP + targetPort: 9015 + +--- +# SCC Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: scc +spec: + replicas: 1 + selector: + matchLabels: + app: scc + template: + metadata: + labels: + app: scc + spec: + containers: + - name: scc + image: scc:latest + imagePullPolicy: IfNotPresent + command: ["/opt/scc/entrypoint", "scc"] + workingDir: /opt/scc + ports: + - containerPort: 9015 + volumeMounts: + - name: config + mountPath: /opt/scc/config.json + subPath: config.json + - name: rsync-config + mountPath: /opt/scc/rsync_config.json + subPath: rsync_config.json + volumes: + - name: config + configMap: + name: scc + items: + - key: config.json + path: config.json + - name: rsync-config + configMap: + name: scc + items: + - key: rsync_config.json + path: rsync_config.json diff --git a/central-controller/deployments/kubernetes/scc_db.yaml b/central-controller/deployments/kubernetes/scc_db.yaml index f40aaa0..cb212b3 100644 --- a/central-controller/deployments/kubernetes/scc_db.yaml +++ b/central-controller/deployments/kubernetes/scc_db.yaml @@ -1,87 +1,87 @@ -# Resources to create Databases used by SDEWAN Central Controller v1 Microservices ---- -#Etcd Service -apiVersion: v1 -kind: Service -metadata: - labels: - app: etcd - name: etcd -spec: - ports: - - name: "2379" - port: 2379 - targetPort: 2379 - - name: "2380" - port: 2380 - targetPort: 2380 - selector: - app: etcd - ---- -#Mongo Service -apiVersion: v1 -kind: Service -metadata: - labels: - app: mongo - name: mongo -spec: - ports: - - name: "27017" - port: 27017 - targetPort: 27017 - selector: - app: mongo - ---- -#Etcd Deployment -apiVersion: apps/v1 -kind: Deployment -metadata: - name: etcd -spec: - replicas: 1 - selector: - matchLabels: - app: etcd - template: - metadata: - labels: - app: etcd - spec: - containers: - - image: bitnami/etcd:3 - imagePullPolicy: IfNotPresent - name: etcd - env: - - name: "ALLOW_NONE_AUTHENTICATION" - value: "yes" - ports: - - containerPort: 2379 - - containerPort: 2380 - ---- -#Mongo Deployment -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: mongo - name: mongo -spec: - replicas: 1 - selector: - matchLabels: - app: mongo - template: - metadata: - labels: - app: mongo - spec: - containers: - - image: mongo - imagePullPolicy: IfNotPresent - name: mongo - ports: - - containerPort: 27017 +# Resources to create Databases used by SDEWAN Central Controller v1 Microservices +--- +#Etcd Service +apiVersion: v1 +kind: Service +metadata: + labels: + app: etcd + name: etcd +spec: + ports: + - name: "2379" + port: 2379 + targetPort: 2379 + - name: "2380" + port: 2380 + targetPort: 2380 + selector: + app: etcd + +--- +#Mongo Service +apiVersion: v1 +kind: Service +metadata: + labels: + app: mongo + name: mongo +spec: + ports: + - name: "27017" + port: 27017 + targetPort: 27017 + selector: + app: mongo + +--- +#Etcd Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: etcd +spec: + replicas: 1 + selector: + matchLabels: + app: etcd + template: + metadata: + labels: + app: etcd + spec: + containers: + - image: bitnami/etcd:3 + imagePullPolicy: IfNotPresent + name: etcd + env: + - name: "ALLOW_NONE_AUTHENTICATION" + value: "yes" + ports: + - containerPort: 2379 + - containerPort: 2380 + +--- +#Mongo Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: mongo + name: mongo +spec: + replicas: 1 + selector: + matchLabels: + app: mongo + template: + metadata: + labels: + app: mongo + spec: + containers: + - image: mongo + imagePullPolicy: IfNotPresent + name: mongo + ports: + - containerPort: 27017 diff --git a/central-controller/deployments/kubernetes/scc_rsync.yaml b/central-controller/deployments/kubernetes/scc_rsync.yaml index ad80d55..9106982 100644 --- a/central-controller/deployments/kubernetes/scc_rsync.yaml +++ b/central-controller/deployments/kubernetes/scc_rsync.yaml @@ -1,71 +1,71 @@ -# Resources to create Rsync used by SDEWAN Central Controller v1 Microservices ---- -# RSYNC ConfigMap -kind: ConfigMap -apiVersion: v1 -metadata: - name: rsync - labels: - app: rsync -data: - config.json: | - { - "database-type": "mongo", - "database-ip": "mongo", - "etcd-ip": "etcd" - } - ---- -# RSYNC Service -apiVersion: v1 -kind: Service -metadata: - name: rsync - labels: - app: rsync -spec: - selector: - app: rsync - type: NodePort - ports: - - name: internal - port: 9041 - protocol: TCP - targetPort: 9041 - nodePort: 31297 - ---- -# RSYNC Deployment -apiVersion: apps/v1 -kind: Deployment -metadata: - name: rsync -spec: - replicas: 1 - selector: - matchLabels: - app: rsync - template: - metadata: - labels: - app: rsync - spec: - containers: - - name: rsync - image: scc:latest - imagePullPolicy: IfNotPresent - command: ["/opt/scc/entrypoint", "rsync"] - workingDir: /opt/scc - ports: - - containerPort: 9041 - volumeMounts: - - name: config - mountPath: /opt/scc/config.json - subPath: config.json - volumes: - - name: config - configMap: - name: rsync - items: - - key: config.json +# Resources to create Rsync used by SDEWAN Central Controller v1 Microservices +--- +# RSYNC ConfigMap +kind: ConfigMap +apiVersion: v1 +metadata: + name: rsync + labels: + app: rsync +data: + config.json: | + { + "database-type": "mongo", + "database-ip": "mongo", + "etcd-ip": "etcd" + } + +--- +# RSYNC Service +apiVersion: v1 +kind: Service +metadata: + name: rsync + labels: + app: rsync +spec: + selector: + app: rsync + type: NodePort + ports: + - name: internal + port: 9041 + protocol: TCP + targetPort: 9041 + nodePort: 31297 + +--- +# RSYNC Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: rsync +spec: + replicas: 1 + selector: + matchLabels: + app: rsync + template: + metadata: + labels: + app: rsync + spec: + containers: + - name: rsync + image: scc:latest + imagePullPolicy: IfNotPresent + command: ["/opt/scc/entrypoint", "rsync"] + workingDir: /opt/scc + ports: + - containerPort: 9041 + volumeMounts: + - name: config + mountPath: /opt/scc/config.json + subPath: config.json + volumes: + - name: config + configMap: + name: rsync + items: + - key: config.json path: config.json \ No newline at end of file diff --git a/central-controller/src/monitor/.gitignore b/central-controller/src/monitor/.gitignore index 712a731..571ef64 100644 --- a/central-controller/src/monitor/.gitignore +++ b/central-controller/src/monitor/.gitignore @@ -1,7 +1,7 @@ -# Temporary Build Files -build/_output -build/_test -/output -### VisualStudioCode ### -.vscode/* -.history +# Temporary Build Files +build/_output +build/_test +/output +### VisualStudioCode ### +.vscode/* +.history diff --git a/central-controller/src/monitor/LICENSE.txt b/central-controller/src/monitor/LICENSE.txt index 557afc3..6b088b1 100644 --- a/central-controller/src/monitor/LICENSE.txt +++ b/central-controller/src/monitor/LICENSE.txt @@ -1,2 +1,2 @@ -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2020 Intel Corporation \ No newline at end of file diff --git a/central-controller/src/monitor/Makefile b/central-controller/src/monitor/Makefile index 12c62ec..5822bba 100644 --- a/central-controller/src/monitor/Makefile +++ b/central-controller/src/monitor/Makefile @@ -1,27 +1,27 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020 Intel Corporation - -export GO111MODULE=on - -all: clean - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ - go build -a -ldflags '-extldflags "-static"' \ - -o ./monitor ./cmd/manager/main.go - -build: clean test cover -deploy: build - -.PHONY: test -test: clean - @go test -v ./... - -format: - @go fmt ./... - -clean: - @rm -f monitor - -.PHONY: cover -cover: - @go test -p 2 ./... -coverprofile=coverage.out - @go tool cover -html=coverage.out -o coverage.html +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2020 Intel Corporation + +export GO111MODULE=on + +all: clean + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ + go build -a -ldflags '-extldflags "-static"' \ + -o ./monitor ./cmd/manager/main.go + +build: clean test cover +deploy: build + +.PHONY: test +test: clean + @go test -v ./... + +format: + @go fmt ./... + +clean: + @rm -f monitor + +.PHONY: cover +cover: + @go test -p 2 ./... -coverprofile=coverage.out + @go tool cover -html=coverage.out -o coverage.html diff --git a/central-controller/src/monitor/tools.go b/central-controller/src/monitor/tools.go index eba4587..6e6e18b 100644 --- a/central-controller/src/monitor/tools.go +++ b/central-controller/src/monitor/tools.go @@ -1,7 +1,7 @@ -// +build tools - -package tools - -import ( - _ "sigs.k8s.io/controller-tools/pkg/crd" -) +// +build tools + +package tools + +import ( + _ "sigs.k8s.io/controller-tools/pkg/crd" +) diff --git a/central-controller/src/reg_cluster/README.md b/central-controller/src/reg_cluster/README.md index 9ec79e9..4db24a9 100644 --- a/central-controller/src/reg_cluster/README.md +++ b/central-controller/src/reg_cluster/README.md @@ -1,9 +1,9 @@ -# Steps to register local cluster - -**1. Copy Kubeconfig as admin.conf in this folder** -**2. Compiled as:** - `$ go build -o reg_cluster ./reg_cluster.go` -**3. Edit config.json with mongo db and etcd ip** -**4. Run command to register cluster** - `$ ./reg_cluster` - +# Steps to register local cluster + +**1. Copy Kubeconfig as admin.conf in this folder** +**2. Compiled as:** + `$ go build -o reg_cluster ./reg_cluster.go` +**3. Edit config.json with mongo db and etcd ip** +**4. Run command to register cluster** + `$ ./reg_cluster` + diff --git a/central-controller/src/reg_cluster/config.json b/central-controller/src/reg_cluster/config.json index bc00c04..cc2890c 100644 --- a/central-controller/src/reg_cluster/config.json +++ b/central-controller/src/reg_cluster/config.json @@ -1,4 +1,4 @@ -{ -"etcd-ip": "", -"database-ip": "" -} +{ +"etcd-ip": "", +"database-ip": "" +} diff --git a/central-controller/src/rsync/Makefile b/central-controller/src/rsync/Makefile index d019e9d..d92289c 100644 --- a/central-controller/src/rsync/Makefile +++ b/central-controller/src/rsync/Makefile @@ -1,30 +1,30 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020 Intel Corporation - -export GO111MODULE=on - -all: clean - CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \ - go build -tags rsync -o ./rsync ./cmd/main.go - -# The following is done this way as each patch on CI runs build and each merge runs deploy. So for build we don't need to build binary and hence -# no need to create a static binary with additional flags. However, for generating binary, additional build flags are necessary. This if used with -# mock plugin errors out for unit tests. So the seperation avoids the error. - -build: clean test cover -deploy: build - -.PHONY: test -test: clean - @go test -race ./... - -format: - @go fmt ./... - -clean: - @rm -f rsync coverage.html coverage.out - -.PHONY: cover -cover: - @go test -race ./... -coverprofile=coverage.out - @go tool cover -html=coverage.out -o coverage.html +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2020 Intel Corporation + +export GO111MODULE=on + +all: clean + CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \ + go build -tags rsync -o ./rsync ./cmd/main.go + +# The following is done this way as each patch on CI runs build and each merge runs deploy. So for build we don't need to build binary and hence +# no need to create a static binary with additional flags. However, for generating binary, additional build flags are necessary. This if used with +# mock plugin errors out for unit tests. So the seperation avoids the error. + +build: clean test cover +deploy: build + +.PHONY: test +test: clean + @go test -race ./... + +format: + @go fmt ./... + +clean: + @rm -f rsync coverage.html coverage.out + +.PHONY: cover +cover: + @go test -race ./... -coverprofile=coverage.out + @go tool cover -html=coverage.out -o coverage.html diff --git a/central-controller/src/rsync/scripts/Dockerfile b/central-controller/src/rsync/scripts/Dockerfile index 4a3bc17..a4f4696 100644 --- a/central-controller/src/rsync/scripts/Dockerfile +++ b/central-controller/src/rsync/scripts/Dockerfile @@ -1,24 +1,24 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020 Intel Corporation - -FROM ubuntu:18.04 - -ARG HTTP_PROXY=${HTTP_PROXY} -ARG HTTPS_PROXY=${HTTPS_PROXY} - -ENV http_proxy $HTTP_PROXY -ENV https_proxy $HTTPS_PROXY -ENV no_proxy $NO_PROXY - -EXPOSE 9016 - -RUN groupadd -r onap && useradd -r -g onap onap - -WORKDIR /opt/multicloud/k8s/rsync -RUN chown onap:onap /opt/multicloud/k8s/rsync -R - -ADD --chown=onap ./rsync ./ - -USER onap - -CMD ["./rsync"] +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2020 Intel Corporation + +FROM ubuntu:18.04 + +ARG HTTP_PROXY=${HTTP_PROXY} +ARG HTTPS_PROXY=${HTTPS_PROXY} + +ENV http_proxy $HTTP_PROXY +ENV https_proxy $HTTPS_PROXY +ENV no_proxy $NO_PROXY + +EXPOSE 9016 + +RUN groupadd -r onap && useradd -r -g onap onap + +WORKDIR /opt/multicloud/k8s/rsync +RUN chown onap:onap /opt/multicloud/k8s/rsync -R + +ADD --chown=onap ./rsync ./ + +USER onap + +CMD ["./rsync"] diff --git a/central-controller/src/scc/Makefile b/central-controller/src/scc/Makefile index b0d2754..22c0dfb 100644 --- a/central-controller/src/scc/Makefile +++ b/central-controller/src/scc/Makefile @@ -1,37 +1,37 @@ -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# Copyright (c) 2021 Intel Corporation -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -export GO111MODULE=on - -all: clean - CGO_ENABLED=1 GOOS=linux GOARCH=amd64 - @go build -tags netgo -o ./scc ./cmd/main.go - -# The following is done this way as each patch on CI runs build and each merge runs deploy. So for build we don't need to build binary and hence -# no need to create a static binary with additional flags. However, for generating binary, additional build flags are necessary. This if used with -# mock plugin errors out for unit tests. So the seperation avoids the error. - -build: clean test cover -deploy: build - -.PHONY: test -test: clean - @go test -race ./... - -format: - @go fmt ./... - -clean: - @find . -name "*so" -delete - @rm -f scc coverage.html coverage.out - -.PHONY: cover -cover: - @go test -race ./... -coverprofile=coverage.out - @go tool cover -html=coverage.out -o coverage.html +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2021 Intel Corporation +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +export GO111MODULE=on + +all: clean + CGO_ENABLED=1 GOOS=linux GOARCH=amd64 + @go build -tags netgo -o ./scc ./cmd/main.go + +# The following is done this way as each patch on CI runs build and each merge runs deploy. So for build we don't need to build binary and hence +# no need to create a static binary with additional flags. However, for generating binary, additional build flags are necessary. This if used with +# mock plugin errors out for unit tests. So the seperation avoids the error. + +build: clean test cover +deploy: build + +.PHONY: test +test: clean + @go test -race ./... + +format: + @go fmt ./... + +clean: + @find . -name "*so" -delete + @rm -f scc coverage.html coverage.out + +.PHONY: cover +cover: + @go test -race ./... -coverprofile=coverage.out + @go tool cover -html=coverage.out -o coverage.html diff --git a/central-controller/src/scc/config.json b/central-controller/src/scc/config.json index bc00c04..cc2890c 100644 --- a/central-controller/src/scc/config.json +++ b/central-controller/src/scc/config.json @@ -1,4 +1,4 @@ -{ -"etcd-ip": "", -"database-ip": "" -} +{ +"etcd-ip": "", +"database-ip": "" +} diff --git a/central-controller/src/scc/pkg/manager/resource_objectmanager.go b/central-controller/src/scc/pkg/manager/resource_objectmanager.go index ae4c4ea..2debe0a 100644 --- a/central-controller/src/scc/pkg/manager/resource_objectmanager.go +++ b/central-controller/src/scc/pkg/manager/resource_objectmanager.go @@ -1,103 +1,103 @@ -/* - * Copyright 2020 Intel Corporation, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package manager - -import ( - "encoding/json" - "io" - - "github.com/akraino-edge-stack/icn-sdwan/central-controller/src/scc/pkg/module" - "github.com/open-ness/EMCO/src/orchestrator/pkg/infra/db" - pkgerrors "github.com/pkg/errors" -) - -type ResourceObjectKey struct { - Cluster string `json:"cluster-info"` - Type string `json:"type"` - Name string `json:"name"` -} - -// ResourceObjectManager implements the ControllerObjectManager -type ResourceObjectManager struct { - BaseObjectManager -} - -func NewResourceObjectManager() *ResourceObjectManager { - return &ResourceObjectManager{ - BaseObjectManager{ - storeName: StoreName, - tagMeta: "resource", - depResManagers: []ControllerObjectManager{}, - ownResManagers: []ControllerObjectManager{}, - }, - } -} - -func (c *ResourceObjectManager) GetResourceName() string { - return Resource -} - -func (c *ResourceObjectManager) IsOperationSupported(oper string) bool { - return false -} - -func (c *ResourceObjectManager) CreateEmptyObject() module.ControllerObject { - return &module.ResourceObject{} -} - -func (c *ResourceObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error) { - // Currently no collections fetching supported - return ResourceObjectKey{ - Cluster: m[OverlayResource] + "-" + m[DeviceResource], - Type: m["Type"], - Name: m["Name"], - }, nil -} - -func (c *ResourceObjectManager) ParseObject(r io.Reader) (module.ControllerObject, error) { - var v module.ResourceObject - err := json.NewDecoder(r).Decode(&v) - return &v, err -} - -func (c *ResourceObjectManager) CreateObject(m map[string]string, t module.ControllerObject) (module.ControllerObject, error) { - // DB Operation - t, err := GetDBUtils().CreateObject(c, m, t) - return t, err -} - -func (c *ResourceObjectManager) GetObject(m map[string]string) (module.ControllerObject, error) { - // DB Operation - t, err := GetDBUtils().GetObject(c, m) - return t, err -} - -func (c *ResourceObjectManager) GetObjects(m map[string]string) ([]module.ControllerObject, error) { - return []module.ControllerObject{}, pkgerrors.New("Not implemented") -} - -func (c *ResourceObjectManager) UpdateObject(m map[string]string, t module.ControllerObject) (module.ControllerObject, error) { - // DB Operation - t, err := GetDBUtils().UpdateObject(c, m, t) - return t, err -} - -func (c *ResourceObjectManager) DeleteObject(m map[string]string) error { - // DB Operation - err := GetDBUtils().DeleteObject(c, m) - return err -} +/* + * Copyright 2020 Intel Corporation, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package manager + +import ( + "encoding/json" + "io" + + "github.com/akraino-edge-stack/icn-sdwan/central-controller/src/scc/pkg/module" + "github.com/open-ness/EMCO/src/orchestrator/pkg/infra/db" + pkgerrors "github.com/pkg/errors" +) + +type ResourceObjectKey struct { + Cluster string `json:"cluster-info"` + Type string `json:"type"` + Name string `json:"name"` +} + +// ResourceObjectManager implements the ControllerObjectManager +type ResourceObjectManager struct { + BaseObjectManager +} + +func NewResourceObjectManager() *ResourceObjectManager { + return &ResourceObjectManager{ + BaseObjectManager{ + storeName: StoreName, + tagMeta: "resource", + depResManagers: []ControllerObjectManager{}, + ownResManagers: []ControllerObjectManager{}, + }, + } +} + +func (c *ResourceObjectManager) GetResourceName() string { + return Resource +} + +func (c *ResourceObjectManager) IsOperationSupported(oper string) bool { + return false +} + +func (c *ResourceObjectManager) CreateEmptyObject() module.ControllerObject { + return &module.ResourceObject{} +} + +func (c *ResourceObjectManager) GetStoreKey(m map[string]string, t module.ControllerObject, isCollection bool) (db.Key, error) { + // Currently no collections fetching supported + return ResourceObjectKey{ + Cluster: m[OverlayResource] + "-" + m[DeviceResource], + Type: m["Type"], + Name: m["Name"], + }, nil +} + +func (c *ResourceObjectManager) ParseObject(r io.Reader) (module.ControllerObject, error) { + var v module.ResourceObject + err := json.NewDecoder(r).Decode(&v) + return &v, err +} + +func (c *ResourceObjectManager) CreateObject(m map[string]string, t module.ControllerObject) (module.ControllerObject, error) { + // DB Operation + t, err := GetDBUtils().CreateObject(c, m, t) + return t, err +} + +func (c *ResourceObjectManager) GetObject(m map[string]string) (module.ControllerObject, error) { + // DB Operation + t, err := GetDBUtils().GetObject(c, m) + return t, err +} + +func (c *ResourceObjectManager) GetObjects(m map[string]string) ([]module.ControllerObject, error) { + return []module.ControllerObject{}, pkgerrors.New("Not implemented") +} + +func (c *ResourceObjectManager) UpdateObject(m map[string]string, t module.ControllerObject) (module.ControllerObject, error) { + // DB Operation + t, err := GetDBUtils().UpdateObject(c, m, t) + return t, err +} + +func (c *ResourceObjectManager) DeleteObject(m map[string]string) error { + // DB Operation + err := GetDBUtils().DeleteObject(c, m) + return err +} diff --git a/central-controller/src/scc/pkg/module/resourceobject.go b/central-controller/src/scc/pkg/module/resourceobject.go index 9b7587d..0cfce7e 100644 --- a/central-controller/src/scc/pkg/module/resourceobject.go +++ b/central-controller/src/scc/pkg/module/resourceobject.go @@ -1,39 +1,39 @@ -/* - * Copyright 2020 Intel Corporation, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package module - -// App contains metadata for Apps -type ResourceObject struct { - Metadata ObjectMetaData `json:"metadata"` - Specification ResourceObjectSpec `json:"spec"` -} - -//ResourceObjectSpec contains the parameters -type ResourceObjectSpec struct { - Hash string `json:"hash"` - Ref int `json:"ref"` - ContextId string `json:"cid"` - Status string `json:"status"` -} - -func (c *ResourceObject) GetMetadata() ObjectMetaData { - return c.Metadata -} - -func (c *ResourceObject) GetType() string { - return "Resource" +/* + * Copyright 2020 Intel Corporation, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package module + +// App contains metadata for Apps +type ResourceObject struct { + Metadata ObjectMetaData `json:"metadata"` + Specification ResourceObjectSpec `json:"spec"` +} + +//ResourceObjectSpec contains the parameters +type ResourceObjectSpec struct { + Hash string `json:"hash"` + Ref int `json:"ref"` + ContextId string `json:"cid"` + Status string `json:"status"` +} + +func (c *ResourceObject) GetMetadata() ObjectMetaData { + return c.Metadata +} + +func (c *ResourceObject) GetType() string { + return "Resource" } \ No newline at end of file diff --git a/central-controller/src/scc/pkg/resource/route_resource.go b/central-controller/src/scc/pkg/resource/route_resource.go index cf2794f..1ed8382 100644 --- a/central-controller/src/scc/pkg/resource/route_resource.go +++ b/central-controller/src/scc/pkg/resource/route_resource.go @@ -1,58 +1,58 @@ -/* - * Copyright 2020 Intel Corporation, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package resource - -type RouteResource struct { - Name string - Destination string - Gateway string - Device string - Table string -} - -func (c *RouteResource) GetName() string { - return c.Name -} - -func (c *RouteResource) GetType() string { - return "Route" -} - -func (c *RouteResource) ToYaml(target string) string { - basic := `apiVersion: ` + SdewanApiVersion + ` -kind: CNFRoute -metadata: - name: ` + c.Name + ` - namespace: default - labels: - sdewanPurpose: ` + SdewanPurpose + ` - targetCluster: ` + target + ` -spec: - dst: ` + c.Destination + ` - dev: "` + c.Device + `" - table: ` + c.Table - - if c.Gateway != "" { - basic += ` - gw: ` + c.Gateway - } - return basic -} - -func init() { - GetResourceBuilder().Register("Route", &RouteResource{}) -} +/* + * Copyright 2020 Intel Corporation, Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package resource + +type RouteResource struct { + Name string + Destination string + Gateway string + Device string + Table string +} + +func (c *RouteResource) GetName() string { + return c.Name +} + +func (c *RouteResource) GetType() string { + return "Route" +} + +func (c *RouteResource) ToYaml(target string) string { + basic := `apiVersion: ` + SdewanApiVersion + ` +kind: CNFRoute +metadata: + name: ` + c.Name + ` + namespace: default + labels: + sdewanPurpose: ` + SdewanPurpose + ` + targetCluster: ` + target + ` +spec: + dst: ` + c.Destination + ` + dev: "` + c.Device + `" + table: ` + c.Table + + if c.Gateway != "" { + basic += ` + gw: ` + c.Gateway + } + return basic +} + +func init() { + GetResourceBuilder().Register("Route", &RouteResource{}) +} diff --git a/central-controller/src/scc/rsync_config.json b/central-controller/src/scc/rsync_config.json index 34eec6d..4e3ae8b 100644 --- a/central-controller/src/scc/rsync_config.json +++ b/central-controller/src/scc/rsync_config.json @@ -1,4 +1,4 @@ -{ -"rsync-ip": "", -"rsync-port": "9041" -} +{ +"rsync-ip": "", +"rsync-port": "9041" +} diff --git a/central-controller/src/scc/test/config.json b/central-controller/src/scc/test/config.json index bc00c04..cc2890c 100644 --- a/central-controller/src/scc/test/config.json +++ b/central-controller/src/scc/test/config.json @@ -1,4 +1,4 @@ -{ -"etcd-ip": "", -"database-ip": "" -} +{ +"etcd-ip": "", +"database-ip": "" +} diff --git a/central-controller/src/scc/tools/ewoctl/examples/ewo-cfg.yaml b/central-controller/src/scc/tools/ewoctl/examples/ewo-cfg.yaml index 6362204..20fb99e 100644 --- a/central-controller/src/scc/tools/ewoctl/examples/ewo-cfg.yaml +++ b/central-controller/src/scc/tools/ewoctl/examples/ewo-cfg.yaml @@ -1,6 +1,6 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020 Intel Corporation - - ewo: - host: localhost +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2020 Intel Corporation + + ewo: + host: localhost port: 9015 \ No newline at end of file diff --git a/central-controller/src/scc/tools/ewoctl/examples/overlay.yaml b/central-controller/src/scc/tools/ewoctl/examples/overlay.yaml index cb8e7b6..8f72394 100644 --- a/central-controller/src/scc/tools/ewoctl/examples/overlay.yaml +++ b/central-controller/src/scc/tools/ewoctl/examples/overlay.yaml @@ -1,23 +1,23 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020 Intel Corporation - -# creating overlay1 -version: ewo/v1 -resourceContext: - anchor: overlays -metadata: - name: overlay1 - description: - userData1: - userData2: - ---- -# creating overlay2 -version: ewo/v1 -resourceContext: - anchor: overlays -metadata: - name: overlay2 - description: - userData1: +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2020 Intel Corporation + +# creating overlay1 +version: ewo/v1 +resourceContext: + anchor: overlays +metadata: + name: overlay1 + description: + userData1: + userData2: + +--- +# creating overlay2 +version: ewo/v1 +resourceContext: + anchor: overlays +metadata: + name: overlay2 + description: + userData1: userData2: \ No newline at end of file diff --git a/central-controller/src/scc/tools/ewoctl/examples/values.yaml b/central-controller/src/scc/tools/ewoctl/examples/values.yaml index 4439e61..ae26ecd 100644 --- a/central-controller/src/scc/tools/ewoctl/examples/values.yaml +++ b/central-controller/src/scc/tools/ewoctl/examples/values.yaml @@ -1,7 +1,7 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020 Intel Corporation - -OverlayName: overlay1 -ProposalName: proposal1 -IPRangelName: iprange1 +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2020 Intel Corporation + +OverlayName: overlay1 +ProposalName: proposal1 +IPRangelName: iprange1 DeviceName: device1 \ No newline at end of file diff --git a/central-controller/src/vendor/github.com/open-ness/EMCO/src/go.mod b/central-controller/src/vendor/github.com/open-ness/EMCO/src/go.mod index 8e37b5c..4674501 100644 --- a/central-controller/src/vendor/github.com/open-ness/EMCO/src/go.mod +++ b/central-controller/src/vendor/github.com/open-ness/EMCO/src/go.mod @@ -1,11 +1,11 @@ -module github.com/open-ness/EMCO/src/orchestrator - -require ( - github.com/open-ness/EMCO/src/rsync v0.0.0-00010101000000-000000000000 -) - -replace ( - github.com/open-ness/EMCO/src/rsync => ../../../../../rsync -) - -go 1.17 +module github.com/open-ness/EMCO/src/orchestrator + +require ( + github.com/open-ness/EMCO/src/rsync v0.0.0-00010101000000-000000000000 +) + +replace ( + github.com/open-ness/EMCO/src/rsync => ../../../../../rsync +) + +go 1.17 diff --git a/central-controller/src/vendor/github.com/open-ness/EMCO/src/orchestrator/go.mod b/central-controller/src/vendor/github.com/open-ness/EMCO/src/orchestrator/go.mod index 9aee0ee..0b99236 100644 --- a/central-controller/src/vendor/github.com/open-ness/EMCO/src/orchestrator/go.mod +++ b/central-controller/src/vendor/github.com/open-ness/EMCO/src/orchestrator/go.mod @@ -1,11 +1,11 @@ -module github.com/open-ness/EMCO/src/orchestrator - -require ( - github.com/open-ness/EMCO/src/rsync v0.0.0-00010101000000-000000000000 -) - -replace ( - github.com/open-ness/EMCO/src/rsync => ../../../../../../rsync -) - -go 1.17 +module github.com/open-ness/EMCO/src/orchestrator + +require ( + github.com/open-ness/EMCO/src/rsync v0.0.0-00010101000000-000000000000 +) + +replace ( + github.com/open-ness/EMCO/src/rsync => ../../../../../../rsync +) + +go 1.17 diff --git a/central-controller/src/vendor/github.com/open-ness/EMCO/src/orchestrator/pkg/infra/auth/auth_test.go b/central-controller/src/vendor/github.com/open-ness/EMCO/src/orchestrator/pkg/infra/auth/auth_test.go index 3f7fe64..fdf81e6 100644 --- a/central-controller/src/vendor/github.com/open-ness/EMCO/src/orchestrator/pkg/infra/auth/auth_test.go +++ b/central-controller/src/vendor/github.com/open-ness/EMCO/src/orchestrator/pkg/infra/auth/auth_test.go @@ -1,47 +1,47 @@ -/* -* Copyright 2018 TechMahindra -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. - */ - -package auth - -import ( - "crypto/tls" - "testing" -) - -//Unit test to varify GetTLSconfig func and varify the tls config min version to be 771 -//Assuming cert file name as auth_test.cert -func TestGetTLSConfig(t *testing.T) { - _, err := GetTLSConfig("filedoesnotexist.cert", "filedoesnotexist.cert", "filedoesnotexist.cert") - if err == nil { - t.Errorf("Test failed, expected error but got none") - } - tlsConfig, err := GetTLSConfig("../../../tests/certs/auth_test_certificate.pem", - "../../../tests/certs/auth_test_certificate.pem", - "../../../tests/certs/auth_test_key.pem") - if err != nil { - t.Fatal("Test Failed as GetTLSConfig returned error: " + err.Error()) - } - expected := tls.VersionTLS12 - actual := tlsConfig.MinVersion - if tlsConfig != nil { - if int(actual) != expected { - t.Errorf("Test Failed due to version mismatch") - } - if tlsConfig == nil { - t.Errorf("Test Failed due to GetTLSConfig returned nil") - } - } -} +/* +* Copyright 2018 TechMahindra +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. + */ + +package auth + +import ( + "crypto/tls" + "testing" +) + +//Unit test to varify GetTLSconfig func and varify the tls config min version to be 771 +//Assuming cert file name as auth_test.cert +func TestGetTLSConfig(t *testing.T) { + _, err := GetTLSConfig("filedoesnotexist.cert", "filedoesnotexist.cert", "filedoesnotexist.cert") + if err == nil { + t.Errorf("Test failed, expected error but got none") + } + tlsConfig, err := GetTLSConfig("../../../tests/certs/auth_test_certificate.pem", + "../../../tests/certs/auth_test_certificate.pem", + "../../../tests/certs/auth_test_key.pem") + if err != nil { + t.Fatal("Test Failed as GetTLSConfig returned error: " + err.Error()) + } + expected := tls.VersionTLS12 + actual := tlsConfig.MinVersion + if tlsConfig != nil { + if int(actual) != expected { + t.Errorf("Test Failed due to version mismatch") + } + if tlsConfig == nil { + t.Errorf("Test Failed due to GetTLSConfig returned nil") + } + } +} diff --git a/platform/crd-ctrlr/src/config/crd/patches/cainjection_in_cnflocalservices.yaml b/platform/crd-ctrlr/src/config/crd/patches/cainjection_in_cnflocalservices.yaml index ef000c3..defc814 100644 --- a/platform/crd-ctrlr/src/config/crd/patches/cainjection_in_cnflocalservices.yaml +++ b/platform/crd-ctrlr/src/config/crd/patches/cainjection_in_cnflocalservices.yaml @@ -1,10 +1,10 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2021 Intel Corporation -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: cnflocalservices.batch.sdewan.akraino.org +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Intel Corporation +# The following patch adds a directive for certmanager to inject CA into the CRD +# CRD conversion requires k8s 1.13 or later. +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: cnflocalservices.batch.sdewan.akraino.org diff --git a/platform/crd-ctrlr/src/config/crd/patches/cainjection_in_cnfnats.yaml b/platform/crd-ctrlr/src/config/crd/patches/cainjection_in_cnfnats.yaml index 814fd7b..b35df34 100644 --- a/platform/crd-ctrlr/src/config/crd/patches/cainjection_in_cnfnats.yaml +++ b/platform/crd-ctrlr/src/config/crd/patches/cainjection_in_cnfnats.yaml @@ -1,10 +1,10 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2021 Intel Corporation -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: cnfnats.batch.sdewan.akraino.org +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Intel Corporation +# The following patch adds a directive for certmanager to inject CA into the CRD +# CRD conversion requires k8s 1.13 or later. +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: cnfnats.batch.sdewan.akraino.org diff --git a/platform/crd-ctrlr/src/config/crd/patches/webhook_in_cnflocalservices.yaml b/platform/crd-ctrlr/src/config/crd/patches/webhook_in_cnflocalservices.yaml index 051c611..a18ea0f 100644 --- a/platform/crd-ctrlr/src/config/crd/patches/webhook_in_cnflocalservices.yaml +++ b/platform/crd-ctrlr/src/config/crd/patches/webhook_in_cnflocalservices.yaml @@ -1,19 +1,19 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2021 Intel Corporation -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: cnflocalservices.batch.sdewan.akraino.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Intel Corporation +# The following patch enables conversion webhook for CRD +# CRD conversion requires k8s 1.13 or later. +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: cnflocalservices.batch.sdewan.akraino.org +spec: + conversion: + strategy: Webhook + webhookClientConfig: + # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, + # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) + caBundle: Cg== + service: + namespace: system + name: webhook-service + path: /convert diff --git a/platform/crd-ctrlr/src/config/crd/patches/webhook_in_cnfnats.yaml b/platform/crd-ctrlr/src/config/crd/patches/webhook_in_cnfnats.yaml index 2b870e5..d86db7c 100644 --- a/platform/crd-ctrlr/src/config/crd/patches/webhook_in_cnfnats.yaml +++ b/platform/crd-ctrlr/src/config/crd/patches/webhook_in_cnfnats.yaml @@ -1,19 +1,19 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2021 Intel Corporation -# The following patch enables conversion webhook for CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: cnfnats.batch.sdewan.akraino.org -spec: - conversion: - strategy: Webhook - webhookClientConfig: - # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, - # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) - caBundle: Cg== - service: - namespace: system - name: webhook-service - path: /convert +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Intel Corporation +# The following patch enables conversion webhook for CRD +# CRD conversion requires k8s 1.13 or later. +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: cnfnats.batch.sdewan.akraino.org +spec: + conversion: + strategy: Webhook + webhookClientConfig: + # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, + # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) + caBundle: Cg== + service: + namespace: system + name: webhook-service + path: /convert diff --git a/platform/crd-ctrlr/src/config/samples/batch_v1alpha1_cnfnat.yaml b/platform/crd-ctrlr/src/config/samples/batch_v1alpha1_cnfnat.yaml index 08e1244..38c6877 100644 --- a/platform/crd-ctrlr/src/config/samples/batch_v1alpha1_cnfnat.yaml +++ b/platform/crd-ctrlr/src/config/samples/batch_v1alpha1_cnfnat.yaml @@ -1,18 +1,18 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2021 Intel Corporation ---- -apiVersion: batch.sdewan.akraino.org/v1alpha1 -kind: CNFNAT -metadata: - name: nat-sample - namespace: default - labels: - sdewanPurpose: cnf1 -spec: - src: iface1 - src_ip: 192.168.1.2 - src_dip: 1.2.3.4 - dest: iface2 - proto: tcp - target: DNAT +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2021 Intel Corporation +--- +apiVersion: batch.sdewan.akraino.org/v1alpha1 +kind: CNFNAT +metadata: + name: nat-sample + namespace: default + labels: + sdewanPurpose: cnf1 +spec: + src: iface1 + src_ip: 192.168.1.2 + src_dip: 1.2.3.4 + dest: iface2 + proto: tcp + target: DNAT ...