RIC:1060: Change in PTL
[ric-plt/ric-dep.git] / depRicKubernetesOperator / README.md
1 # depriclatest\r
2 The depric Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of RIC services and instances.\r
3 \r
4 # To deploy K8s Operator \r
5 1. Build the docker image:\r
6 ```sh\r
7 make docker-build docker-push IMG=registry/depriclatest-operator:latest\r
8 ```\r
9 2. deploy the operator using above image:\r
10 \r
11 ```sh\r
12 make deploy IMG=registry/depriclatest-operator:latest\r
13 ```\r
14 \r
15 # To Deploy/Undeploy RIC \r
16 \r
17 ## Deploy RIC\r
18 For deploying RIC apply a sample manifest based on the new operator CRD :\r
19 \r
20 kubectl apply -f config/samples/ricdeploy_v1_ricplatform.yaml\r
21 \r
22 ## Undeploy RIC\r
23 For undeploying RIC apply a sample manifest based on the new operator CRD :\r
24 \r
25 kubectl apply -f config/samples/ricdeploy_v1_ricplatform.yaml\r
26 \r
27 ## Description\r
28 // TODO(user): An in-depth paragraph about your project and overview of use\r
29 \r
30 ## Getting Started\r
31 You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.\r
32 **Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).\r
33 \r
34 ### Running on the cluster\r
35 1. Install Instances of Custom Resources:\r
36 \r
37 ```sh\r
38 kubectl apply -f config/samples/\r
39 ```\r
40 \r
41 2. Build and push your image to the location specified by `IMG`:\r
42 \r
43 ```sh\r
44 make docker-build docker-push IMG=<some-registry>/depriclatest:tag\r
45 ```\r
46 \r
47 3. Deploy the controller to the cluster with the image specified by `IMG`:\r
48 \r
49 ```sh\r
50 make deploy IMG=<some-registry>/depriclatest:tag\r
51 ```\r
52 \r
53 ### Uninstall CRDs\r
54 To delete the CRDs from the cluster:\r
55 \r
56 ```sh\r
57 make uninstall\r
58 ```\r
59 \r
60 ### Undeploy controller\r
61 UnDeploy the controller from the cluster:\r
62 \r
63 ```sh\r
64 make undeploy\r
65 ```\r
66 \r
67 ## Contributing\r
68 // TODO(user): Add detailed information on how you would like others to contribute to this project\r
69 \r
70 ### How it works\r
71 This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).\r
72 \r
73 It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),\r
74 which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.\r
75 \r
76 ### Test It Out\r
77 1. Install the CRDs into the cluster:\r
78 \r
79 ```sh\r
80 make install\r
81 ```\r
82 \r
83 2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):\r
84 \r
85 ```sh\r
86 make run\r
87 ```\r
88 \r
89 **NOTE:** You can also run this in one step by running: `make install run`\r
90 \r
91 ### Modifying the API definitions\r
92 If you are editing the API definitions, generate the manifests such as CRs or CRDs using:\r
93 \r
94 ```sh\r
95 make manifests\r
96 ```\r
97 \r
98 **NOTE:** Run `make --help` for more information on all potential `make` targets\r
99 \r
100 More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)\r
101 \r
102 ## License\r
103 \r
104 Copyright 2023.\r
105 \r
106 Licensed under the Apache License, Version 2.0 (the "License");\r
107 you may not use this file except in compliance with the License.\r
108 You may obtain a copy of the License at\r
109 \r
110     http://www.apache.org/licenses/LICENSE-2.0\r
111 \r
112 Unless required by applicable law or agreed to in writing, software\r
113 distributed under the License is distributed on an "AS IS" BASIS,\r
114 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
115 See the License for the specific language governing permissions and\r
116 limitations under the License.\r
117 \r