Skip to content

Commit 177ba2e

Browse files
committed
cleanup documentation; cleanup makefile; fix minor bugs
1 parent 12042db commit 177ba2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+17106
-15745
lines changed

.dockerignore

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
22
# Ignore build and test binaries.
33
bin/
4+
!bin/app/
45
testbin/
6+
charts/
7+
cmd/
8+
config/
9+
dev/
10+
hack/
11+
internal/
12+
scripts/
13+
test/

Dockerfile.old

-33
This file was deleted.

Makefile

+193-165
Large diffs are not rendered by default.

README.md

+78-63
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,115 @@
11
# 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/).
72

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)
115

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
138

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.
2411

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/)
2614

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
3117

32-
### Install using Helm
18+
## Installation
3319

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.
3823

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:
4025
```bash
26+
# Add the G-Research Helm repository
27+
helm repo add gresearch https://gresearch.github.io/armada-operator
28+
# Install the Armada Operator
4129
helm install armada-operator gresearch/armada-operator --namespace armada-system --create-namespace
4230
```
4331

44-
### Build & install from scratch
32+
The Armada Operator will be installed in the `armada-system` namespace.
4533

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
5035

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:
5242
```bash
53-
make dev-install-controller
43+
make install-armada-deps
5444
```
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
5845

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.
6248

6349
Finally:
6450
```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
6655
```
6756

6857
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.
7059

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:
7277
```bash
73-
make delete-dev-cluster
78+
make kind-create-cluster
7479
```
7580

76-
This will totally destroy your development Kind cluster.
77-
78-
### Local development
81+
### Build & install from scratch
7982

80-
Before running the Operator, we first need to install the CRDs by running the following command:
83+
Run the following `make` command:
8184
```bash
82-
make install
85+
make kind-deploy
8386
```
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
8495

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:
8697
```bash
98+
# Run the operator locally with webhooks enabled
8799
make run
100+
# Run the operator locally with webhooks disabled
101+
make run-no-webhook
88102
```
89103

90-
To uninstall the Operator CRDs, you can use the following command:
104+
### Stop the Development Cluster
105+
106+
To stop the development cluster:
91107
```bash
92-
make uninstall
108+
make kind-delete-cluster
93109
```
94110

111+
This will totally destroy your development Kind cluster.
112+
95113
## Contributing
96114

97115
Please feel free to contribute bug-reports or ideas for enhancements via
@@ -105,24 +123,21 @@ pass.
105123

106124
Please test contributions thoroughly before requesting reviews. At a minimum:
107125
```bash
126+
# Lint code using golangci-lint.
127+
make lint
128+
# Run unit tests.
108129
make test-unit
130+
# Run integration tests.
109131
make test-integration
110-
make lint
111132
```
112133
should all succeed without error.
113134

114135
Add and change appropriate unit and integration tests to ensure your changes
115136
are covered by automated tests and appear to be correct.
116137

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-
123138
## License
124139

125-
Copyright 2023.
140+
Copyright 2024.
126141

127142
Licensed under the Apache License, Version 2.0 (the "License");
128143
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)