|
1 |
| -# uniflow-operator |
2 |
| -// TODO(user): Add simple overview of use/purpose |
| 1 | +Uniflow Operator |
3 | 2 |
|
4 |
| -## Description |
5 |
| -// TODO(user): An in-depth paragraph about your project and overview of use |
| 3 | +The Uniflow Operator is a Kubernetes controller designed for managing Service and Revision resources. It tracks workflow changes and ensures seamless deployment of serverless workloads using Knative. This operator simplifies the orchestration and versioning of workflows in dynamic environments. |
6 | 4 |
|
7 |
| -## Getting Started |
| 5 | +Features |
8 | 6 |
|
9 |
| -### Prerequisites |
10 |
| -- go version v1.21.0+ |
11 |
| -- docker version 17.03+. |
12 |
| -- kubectl version v1.11.3+. |
13 |
| -- Access to a Kubernetes v1.11.3+ cluster. |
| 7 | +Dynamic Revision Management |
14 | 8 |
|
15 |
| -### To Deploy on the cluster |
16 |
| -**Build and push your image to the location specified by `IMG`:** |
| 9 | + • Automatically creates and manages Revision resources based on Service updates. |
| 10 | + • Supports version control for services and workflows. |
17 | 11 |
|
18 |
| -```sh |
19 |
| -make docker-build docker-push IMG=<some-registry>/uniflow-operator:tag |
20 |
| -``` |
| 12 | +Efficient Resource Cleanup |
21 | 13 |
|
22 |
| -**NOTE:** This image ought to be published in the personal registry you specified. |
23 |
| -And it is required to have access to pull the image from the working environment. |
24 |
| -Make sure you have the proper permission to the registry if the above commands don’t work. |
| 14 | + • Automatically removes outdated Revisions while retaining the latest version. |
| 15 | + • Ensures optimal resource utilization. |
25 | 16 |
|
26 |
| -**Install the CRDs into the cluster:** |
| 17 | +Knative Integration |
27 | 18 |
|
28 |
| -```sh |
29 |
| -make install |
30 |
| -``` |
| 19 | + • Leverages Knative Serving to provide serverless deployment for workflows. |
| 20 | + • Supports real-time and scalable workload management. |
31 | 21 |
|
32 |
| -**Deploy the Manager to the cluster with the image specified by `IMG`:** |
| 22 | +Event-Driven Reconciliation |
33 | 23 |
|
34 |
| -```sh |
35 |
| -make deploy IMG=<some-registry>/uniflow-operator:tag |
36 |
| -``` |
| 24 | + • Listens to workflow changes and dynamically updates Kubernetes resources. |
| 25 | + • Ensures system state aligns with user-defined specifications. |
37 | 26 |
|
38 |
| -> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin |
39 |
| -privileges or be logged in as admin. |
| 27 | +Getting Started |
40 | 28 |
|
41 |
| -**Create instances of your solution** |
42 |
| -You can apply the samples (examples) from the config/sample: |
| 29 | +Prerequisites |
43 | 30 |
|
44 |
| -```sh |
45 |
| -kubectl apply -k config/samples/ |
46 |
| -``` |
| 31 | + • Kubernetes 1.24 or later |
| 32 | + • Knative Serving installed |
| 33 | + • Helm 3 (optional for installation) |
47 | 34 |
|
48 |
| ->**NOTE**: Ensure that the samples has default values to test it out. |
| 35 | +Installation |
49 | 36 |
|
50 |
| -### To Uninstall |
51 |
| -**Delete the instances (CRs) from the cluster:** |
| 37 | +1. Clone the Repository |
52 | 38 |
|
53 |
| -```sh |
54 |
| -kubectl delete -k config/samples/ |
55 |
| -``` |
| 39 | +git clone https://github.com/siyul-park/uniflow-operator.git |
| 40 | +cd uniflow-operator |
56 | 41 |
|
57 |
| -**Delete the APIs(CRDs) from the cluster:** |
| 42 | +2. Deploy Custom Resource Definitions (CRDs) |
58 | 43 |
|
59 |
| -```sh |
60 |
| -make uninstall |
61 |
| -``` |
| 44 | +kubectl apply -f config/crd/bases |
62 | 45 |
|
63 |
| -**UnDeploy the controller from the cluster:** |
| 46 | +3. Deploy the Controller |
64 | 47 |
|
65 |
| -```sh |
66 |
| -make undeploy |
67 |
| -``` |
| 48 | +kubectl apply -f config/manager |
68 | 49 |
|
69 |
| -## Project Distribution |
| 50 | +4. Verify Deployment |
70 | 51 |
|
71 |
| -Following are the steps to build the installer and distribute this project to users. |
| 52 | +kubectl get pods -n uniflow-system |
72 | 53 |
|
73 |
| -1. Build the installer for the image built and published in the registry: |
| 54 | +Usage |
74 | 55 |
|
75 |
| -```sh |
76 |
| -make build-installer IMG=<some-registry>/uniflow-operator:tag |
77 |
| -``` |
| 56 | +Define a Service |
78 | 57 |
|
79 |
| -NOTE: The makefile target mentioned above generates an 'install.yaml' |
80 |
| -file in the dist directory. This file contains all the resources built |
81 |
| -with Kustomize, which are necessary to install this project without |
82 |
| -its dependencies. |
| 58 | +Create a Service manifest: |
83 | 59 |
|
84 |
| -2. Using the installer |
| 60 | +apiVersion: uniflow.dev/v1 |
| 61 | +kind: Service |
| 62 | +metadata: |
| 63 | + name: example-service |
| 64 | +spec: |
| 65 | + template: |
| 66 | + metadata: |
| 67 | + labels: |
| 68 | + app: example |
| 69 | + spec: |
| 70 | + containers: |
| 71 | + - name: example-container |
| 72 | + image: example-image:latest |
85 | 73 |
|
86 |
| -Users can just run kubectl apply -f <URL for YAML BUNDLE> to install the project, i.e.: |
| 74 | +Apply the configuration: |
87 | 75 |
|
88 |
| -```sh |
89 |
| -kubectl apply -f https://raw.githubusercontent.com/<org>/uniflow-operator/<tag or branch>/dist/install.yaml |
90 |
| -``` |
| 76 | +kubectl apply -f service.yaml |
91 | 77 |
|
92 |
| -## Contributing |
93 |
| -// TODO(user): Add detailed information on how you would like others to contribute to this project |
| 78 | +Monitor Revisions |
94 | 79 |
|
95 |
| -**NOTE:** Run `make help` for more information on all potential `make` targets |
| 80 | +Check created Revisions: |
96 | 81 |
|
97 |
| -More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) |
| 82 | +kubectl get revisions -n <namespace> |
98 | 83 |
|
99 |
| -## License |
| 84 | +Inspect Service status: |
100 | 85 |
|
101 |
| -Copyright 2024. |
| 86 | +kubectl describe service example-service |
102 | 87 |
|
103 |
| -Licensed under the Apache License, Version 2.0 (the "License"); |
104 |
| -you may not use this file except in compliance with the License. |
105 |
| -You may obtain a copy of the License at |
| 88 | +Development |
106 | 89 |
|
107 |
| - http://www.apache.org/licenses/LICENSE-2.0 |
| 90 | +Local Development |
108 | 91 |
|
109 |
| -Unless required by applicable law or agreed to in writing, software |
110 |
| -distributed under the License is distributed on an "AS IS" BASIS, |
111 |
| -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
112 |
| -See the License for the specific language governing permissions and |
113 |
| -limitations under the License. |
| 92 | + 1. Install Dependencies |
114 | 93 |
|
| 94 | +go mod tidy |
| 95 | + |
| 96 | + |
| 97 | + 2. Run the Controller |
| 98 | + |
| 99 | +make run |
| 100 | + |
| 101 | + |
| 102 | + 3. Apply Resources Locally |
| 103 | + |
| 104 | +kubectl apply -f examples/service.yaml |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | +Run Tests |
| 109 | + |
| 110 | +make test |
| 111 | + |
| 112 | +Contributing |
| 113 | + |
| 114 | +Steps to Contribute |
| 115 | + |
| 116 | + 1. Fork the repository. |
| 117 | + 2. Create a feature branch: |
| 118 | + |
| 119 | +git checkout -b feature/my-feature |
| 120 | + |
| 121 | + |
| 122 | + 3. Commit your changes: |
| 123 | + |
| 124 | +git commit -m "Add my feature" |
| 125 | + |
| 126 | + |
| 127 | + 4. Push the branch: |
| 128 | + |
| 129 | +git push origin feature/my-feature |
| 130 | + |
| 131 | + |
| 132 | + 5. Create a pull request in the repository. |
| 133 | + |
| 134 | +Code Standards |
| 135 | + |
| 136 | + • Follow the Go Code Style. |
| 137 | + • Write tests for new features. |
| 138 | + • Ensure code passes golangci-lint checks. |
| 139 | + |
| 140 | +License |
| 141 | + |
| 142 | +This project is licensed under the Apache License 2.0. |
| 143 | + |
| 144 | +Contact |
| 145 | + |
| 146 | +For questions or issues, please open an issue in the GitHub repository. |
0 commit comments