diff --git a/free5gc-operator/Kptfile b/free5gc-operator/Kptfile index 370ec0d..1d2394e 100644 --- a/free5gc-operator/Kptfile +++ b/free5gc-operator/Kptfile @@ -1,8 +1,10 @@ apiVersion: kpt.dev/v1 kind: Kptfile + metadata: name: free5gc-operator annotations: config.kubernetes.io/local-config: "true" + info: - description: Operator package for free5gc Nephio integration + description: free5GC operator package diff --git a/free5gc-operator/app/controller/namespace.yaml b/free5gc-operator/app/controller/namespace.yaml deleted file mode 100644 index 049ef84..0000000 --- a/free5gc-operator/app/controller/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: free5gc diff --git a/free5gc-operator/app/controller/serviceaccount-controller.yaml b/free5gc-operator/app/controller/serviceaccount-controller.yaml deleted file mode 100644 index c270778..0000000 --- a/free5gc-operator/app/controller/serviceaccount-controller.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/name: free5gc-operator - app.kubernetes.io/part-of: free5gc-operator - name: free5gc-operator - namespace: free5gc diff --git a/free5gc-operator/app/controller/clusterrole-controller.yaml b/free5gc-operator/operator/clusterrole.yaml similarity index 87% rename from free5gc-operator/app/controller/clusterrole-controller.yaml rename to free5gc-operator/operator/clusterrole.yaml index 24a8d59..94cc720 100644 --- a/free5gc-operator/app/controller/clusterrole-controller.yaml +++ b/free5gc-operator/operator/clusterrole.yaml @@ -1,8 +1,15 @@ ---- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole + metadata: name: free5gc-operator-role + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: free5gc-operator-role + app.kubernetes.io/component: operator + app.kubernetes.io/created-by: nephio + app.kubernetes.io/part-of: free5gc-operator + rules: - apiGroups: - "" diff --git a/free5gc-operator/app/controller/clusterrolebinding-controller.yaml b/free5gc-operator/operator/clusterrolebinding.yaml similarity index 64% rename from free5gc-operator/app/controller/clusterrolebinding-controller.yaml rename to free5gc-operator/operator/clusterrolebinding.yaml index aba2336..3358296 100644 --- a/free5gc-operator/app/controller/clusterrolebinding-controller.yaml +++ b/free5gc-operator/operator/clusterrolebinding.yaml @@ -1,10 +1,15 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding + metadata: + name: free5gc-operator-role-binding labels: - app.kubernetes.io/name: free5gc-operator + app.kubernetes.io/name: clusterrolebinding + app.kubernetes.io/instance: free5gc-operator-role-binding + app.kubernetes.io/component: operator + app.kubernetes.io/created-by: nephio app.kubernetes.io/part-of: free5gc-operator - name: free5gc-operator-role-binding + roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/free5gc-operator/app/controller/deployment-controller.yaml b/free5gc-operator/operator/deployment.yaml similarity index 69% rename from free5gc-operator/app/controller/deployment-controller.yaml rename to free5gc-operator/operator/deployment.yaml index edbd2b1..690687c 100644 --- a/free5gc-operator/app/controller/deployment-controller.yaml +++ b/free5gc-operator/operator/deployment.yaml @@ -1,33 +1,40 @@ apiVersion: apps/v1 kind: Deployment + metadata: - name: free5gc-operator-controller namespace: free5gc + name: free5gc-operator + labels: + app.kubernetes.io/name: deployment + app.kubernetes.io/instance: free5gc-operator + app.kubernetes.io/component: operator + app.kubernetes.io/created-by: nephio + app.kubernetes.io/part-of: free5gc-operator + spec: replicas: 1 selector: matchLabels: - fn.kptgen.dev/controller: free5gc-operator-controller + fn.kptgen.dev/controller: free5gc-operator template: metadata: + name: free5gc-operator labels: - app.kubernetes.io/component: tbd - app.kubernetes.io/instance: tbd - app.kubernetes.io/managed-by: kpt - app.kubernetes.io/name: free5gc-operator + app.kubernetes.io/name: deployment + app.kubernetes.io/instance: free5gc-operator + app.kubernetes.io/component: operator + app.kubernetes.io/created-by: nephio app.kubernetes.io/part-of: free5gc-operator - app.kubernetes.io/version: tbd - fn.kptgen.dev/controller: free5gc-operator-controller - name: free5gc-operator-controller spec: + serviceAccountName: free5gc-operator containers: - - args: + - name: kube-rbac-proxy + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0 + args: - --secure-listen-address=0.0.0.0:8443 - --upstream=http://127.0.0.1:8080/ - --logtostderr=true - --v=10 - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0 - name: kube-rbac-proxy ports: - containerPort: 8443 name: https @@ -38,26 +45,26 @@ spec: requests: cpu: 5m memory: 64Mi - - args: + - name: operator + image: docker.io/nephio/free5gc-operator:latest + command: + - /free5gc-operator + args: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - command: - - /manager env: - name: POD_NAMESPACE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: nephio/free5gc-operator:latest livenessProbe: httpGet: path: /healthz port: 8081 initialDelaySeconds: 15 periodSeconds: 20 - name: controller readinessProbe: httpGet: path: /readyz @@ -76,4 +83,3 @@ spec: capabilities: drop: - ALL - serviceAccountName: free5gc-operator diff --git a/free5gc-operator/operator/namespace.yaml b/free5gc-operator/operator/namespace.yaml new file mode 100644 index 0000000..3617772 --- /dev/null +++ b/free5gc-operator/operator/namespace.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Namespace + +metadata: + name: free5gc + labels: + app.kubernetes.io/name: namespace + app.kubernetes.io/instance: free5gc + app.kubernetes.io/component: operator + app.kubernetes.io/created-by: nephio + app.kubernetes.io/part-of: free5gc-operator diff --git a/free5gc-operator/app/controller/role-leader-election.yaml b/free5gc-operator/operator/role-leader-election.yaml similarity index 73% rename from free5gc-operator/app/controller/role-leader-election.yaml rename to free5gc-operator/operator/role-leader-election.yaml index 6e621ac..6cd9146 100644 --- a/free5gc-operator/app/controller/role-leader-election.yaml +++ b/free5gc-operator/operator/role-leader-election.yaml @@ -1,11 +1,16 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role + metadata: + namespace: free5gc + name: free5gc-operator-leader-election-role labels: - app.kubernetes.io/name: free5gc-operator + app.kubernetes.io/name: role + app.kubernetes.io/instance: free5gc-operator-leader-election-role + app.kubernetes.io/component: operator + app.kubernetes.io/created-by: nephio app.kubernetes.io/part-of: free5gc-operator - name: free5gc-operator-leader-election-role - namespace: free5gc + rules: - apiGroups: - "" diff --git a/free5gc-operator/app/controller/rolebinding-leader-election.yaml b/free5gc-operator/operator/rolebinding-leader-election.yaml similarity index 64% rename from free5gc-operator/app/controller/rolebinding-leader-election.yaml rename to free5gc-operator/operator/rolebinding-leader-election.yaml index 7960370..7828732 100644 --- a/free5gc-operator/app/controller/rolebinding-leader-election.yaml +++ b/free5gc-operator/operator/rolebinding-leader-election.yaml @@ -1,15 +1,16 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding + metadata: + namespace: free5gc + name: free5gc-operator-leader-election-role-binding labels: - app.kubernetes.io/component: tbd - app.kubernetes.io/instance: tbd - app.kubernetes.io/managed-by: kpt - app.kubernetes.io/name: free5gc-operator + app.kubernetes.io/name: rolebinding + app.kubernetes.io/instance: free5gc-operator-leader-election-role-binding + app.kubernetes.io/component: operator + app.kubernetes.io/created-by: nephio app.kubernetes.io/part-of: free5gc-operator - app.kubernetes.io/version: tbd - name: free5gc-operator-leader-election-role-binding - namespace: free5gc + roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/free5gc-operator/operator/serviceaccount.yaml b/free5gc-operator/operator/serviceaccount.yaml new file mode 100644 index 0000000..1b2d401 --- /dev/null +++ b/free5gc-operator/operator/serviceaccount.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: ServiceAccount + +metadata: + namespace: free5gc + name: free5gc-operator + labels: + app.kubernetes.io/name: serviceaccount + app.kubernetes.io/instance: free5gc-operator + app.kubernetes.io/component: operator + app.kubernetes.io/created-by: nephio + app.kubernetes.io/part-of: free5gc-operator diff --git a/free5gc-operator/package-context.yaml b/free5gc-operator/package-context.yaml index 6c33d9e..db772cb 100644 --- a/free5gc-operator/package-context.yaml +++ b/free5gc-operator/package-context.yaml @@ -1,8 +1,10 @@ apiVersion: v1 kind: ConfigMap + metadata: name: kptfile.kpt.dev annotations: config.kubernetes.io/local-config: "true" + data: - name: example + name: nehpio