1
1
# armada-operator
2
- ` armada-operator ` is a small [ go] ( https://go.dev/ ) project to automate the
3
- installation (and eventually management) of a fully-functional
4
- [ Armada] ( https://github.com/armadaproject/armada ) deployment
5
- to a [ Kubernetes] ( https://kubernetes.io/ ) cluster using the Kubernetes
6
- [ operator pattern] ( https://kubernetes.io/docs/concepts/extend-kubernetes/operator/ ) .
7
2
8
- ## Description
9
- Armada is a multi-Kubernetes batch job scheduler. This operator aims to make
10
- Armada easy to deploy and, well, operate in a Kubernetes cluster.
3
+ [ ![ GoReport Widget]] [ GoReport Status ]
4
+ [ ![ Latest Release] ( https://img.shields.io/github/v/release/armadaproject/armada-operator?include_prereleases )] ( https://github.com/armadaproject/armada-operator/releases/latest )
11
5
12
- ## Quickstart
6
+ [ GoReport Widget ] : https://goreportcard.com/badge/github.com/armadaproject/armada-operator
7
+ [ GoReport Status ] : https://goreportcard.com/report/github.com/armadaproject/armada-operator
13
8
14
- Want to start hacking right away?
15
-
16
- You’ll need a Kubernetes cluster to run the operator. You can use
17
- [ KIND] ( https://sigs.k8s.io/kind ) to run a local cluster for testing, or you
18
- can run against a remote cluster.
19
-
20
- ** Note:** Your controller will automatically use the current context in your
21
- kubeconfig file (i.e. whatever cluster ` kubectl cluster-info ` shows).
22
-
23
- ### Start a Development Cluster
9
+ Armada Operator is a Kubernetes-native Operator for simpler installation of [ Armada] ( https://armadaproject.io ) .
10
+ This project introduces CRDs for Armada services and provides a controller to manage the lifecycle of these services.
24
11
25
- This section assumes you have [ KIND] ( https://sigs.k8s.io/kind ) installed.
12
+ ## How it works
13
+ This project aims to follow the Kubernetes [ Operator pattern] ( https://kubernetes.io/docs/concepts/extend-kubernetes/operator/ )
26
14
27
- If you do not have a Kubernetes cluster to test against, you can start one using the following command:
28
- ``` bash
29
- make create-dev-cluster
30
- ```
15
+ It uses [ Controllers] ( https://kubernetes.io/docs/concepts/architecture/controller/ )
16
+ which provides a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster
31
17
32
- ### Install using Helm
18
+ ## Installation
33
19
34
- First, add the ` gresearch ` public Helm registry:
35
- ``` bash
36
- helm repo add gresearch https://g-research.github.io/charts
37
- ```
20
+ You’ll need a Kubernetes cluster to run the Armada Operator. You can use
21
+ [ KIND] ( https://sigs.k8s.io/kind ) to run a local cluster for testing, or you
22
+ can run against a remote cluster.
38
23
39
- After that, you can install the Armada Operator using Helm :
24
+ To install the latest release of Armada Operator in your cluster, run the following commands :
40
25
``` bash
26
+ # Add the G-Research Helm repository
27
+ helm repo add gresearch https://gresearch.github.io/armada-operator
28
+ # Install the Armada Operator
41
29
helm install armada-operator gresearch/armada-operator --namespace armada-system --create-namespace
42
30
```
43
31
44
- ### Build & install from scratch
32
+ The Armada Operator will be installed in the ` armada-system ` namespace.
45
33
46
- Run the following command to install all Armada external dependencies (Apache Pulsar, Redis, PostgreSQL, NGINX, Prometheus)
47
- ``` bash
48
- make dev-setup
49
- ```
34
+ ### Installing Armada
50
35
51
- Then:
36
+ In order to install Armada, first you will need to install the Armada external dependencies:
37
+ * [ Pulsar] ( https://pulsar.apache.org/ )
38
+ * [ Redis] ( https://redis.io/ )
39
+ * [ Postgres] ( https://www.postgresql.org/ )
40
+
41
+ You can install the required dependencies either manually or by running the following command:
52
42
``` bash
53
- make dev- install-controller
43
+ make install-armada-deps
54
44
```
55
- Which will:
56
- - install each CRD supported by the armada-operator on the cluster
57
- - create a pod inside the kind cluster running the armada-operator controllers
58
45
59
- ** Note:** You may need to wait for some services (like Pulsar) to finish
60
- coming up to proceed to the next step. Check the status of
61
- the cluster with ` $ kubectl get -n armada pods ` .
46
+ ** Note:** You may need to wait for some services (like Pulsar) to finish
47
+ coming up to proceed to the next step.
62
48
63
49
Finally:
64
50
``` bash
65
- kubectl apply -n armada -f $( REPO_ROOT) /dev/quickstart/armada-crds.yaml
51
+ # Create armada namespace
52
+ kubectl create namespace armada
53
+ # Install Armada components
54
+ kubectl apply -n armada -f dev/quickstart/armada-crds-minimal.yaml
66
55
```
67
56
68
57
Which will deploy samples of each CRD. Once every Armada service is deployed,
69
- you should have a fully functional install of Armada running .
58
+ you should have a fully functional installation of Armada.
70
59
71
- To stop the development cluster:
60
+ ## Documentation
61
+
62
+ For a step-by-step guide on how to install Armada using the Armada Operator and interact with Armada API,
63
+ please read the Quickstart guide in the [ documentation] ( ./dev/quickstart/README.md ) and follow runbooks in the ` dev/runbooks/ ` directory.
64
+
65
+ ## Local development
66
+
67
+ Want to start hacking right away?
68
+
69
+ ** Note:** Your controller will automatically use the current context in your
70
+ kubeconfig file (i.e. whatever cluster ` kubectl cluster-info ` shows).
71
+
72
+ ### Start a Development Cluster
73
+
74
+ This section assumes you have [ KIND] ( https://sigs.k8s.io/kind ) installed.
75
+
76
+ If you do not have a Kubernetes cluster to test against, you can start one using the following command:
72
77
``` bash
73
- make delete-dev -cluster
78
+ make kind-create -cluster
74
79
```
75
80
76
- This will totally destroy your development Kind cluster.
77
-
78
- ### Local development
81
+ ### Build & install from scratch
79
82
80
- Before running the Operator, we first need to install the CRDs by running the following command:
83
+ Run the following ` make ` command:
81
84
``` bash
82
- make install
85
+ make kind-deploy
83
86
```
87
+ This command will do the following:
88
+ - Build the ` armada-operator ` binary for ` linux/amd64 `
89
+ - Build the ` armada-operator ` Docker image
90
+ - Load the Docker image into the ` kind ` cluster
91
+ - Install each CRD supported by the ` armada-operator ` on the cluster
92
+ - Install the ` armada-operator ` on the cluster using ` kustomize `
93
+
94
+ ### Run locally
84
95
85
- To run the operator locally, you can use the following command :
96
+ In order to run the operator locally, you can use one of the following commands :
86
97
``` bash
98
+ # Run the operator locally with webhooks enabled
87
99
make run
100
+ # Run the operator locally with webhooks disabled
101
+ make run-no-webhook
88
102
```
89
103
90
- To uninstall the Operator CRDs, you can use the following command:
104
+ ### Stop the Development Cluster
105
+
106
+ To stop the development cluster:
91
107
``` bash
92
- make uninstall
108
+ make kind-delete-cluster
93
109
```
94
110
111
+ This will totally destroy your development Kind cluster.
112
+
95
113
## Contributing
96
114
97
115
Please feel free to contribute bug-reports or ideas for enhancements via
@@ -105,24 +123,21 @@ pass.
105
123
106
124
Please test contributions thoroughly before requesting reviews. At a minimum:
107
125
``` bash
126
+ # Lint code using golangci-lint.
127
+ make lint
128
+ # Run unit tests.
108
129
make test-unit
130
+ # Run integration tests.
109
131
make test-integration
110
- make lint
111
132
```
112
133
should all succeed without error.
113
134
114
135
Add and change appropriate unit and integration tests to ensure your changes
115
136
are covered by automated tests and appear to be correct.
116
137
117
- ### How it works
118
- This project aims to follow the Kubernetes [ Operator pattern] ( https://kubernetes.io/docs/concepts/extend-kubernetes/operator/ )
119
-
120
- It uses [ Controllers] ( https://kubernetes.io/docs/concepts/architecture/controller/ )
121
- which provides a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster
122
-
123
138
## License
124
139
125
- Copyright 2023 .
140
+ Copyright 2024 .
126
141
127
142
Licensed under the Apache License, Version 2.0 (the "License");
128
143
you may not use this file except in compliance with the License.
0 commit comments