Skip to content

Commit b4d8042

Browse files
authored
Merge pull request #2 from alphagov/add-codeowners-and-README
Add `CODEOWNERS` and README
2 parents 6931664 + 22a7342 commit b4d8042

2 files changed

Lines changed: 95 additions & 3 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Platform Engineering review required
2+
* @alphagov/gov-uk-platform-engineering

README.md

Lines changed: 93 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,104 @@
11
# GOV.UK Job Request Operator
22

3-
This is a k8s operator that is used to make job requests built with [operator-sdk](https://sdk.operatorframework.io/).
3+
This is a k8s operator that is used to make job requests built with [kube-builder](https://github.com/kubernetes-sigs/kubebuilder).
44

55
## Usage
66

7-
To install the required dependencies::
7+
To install the required dependencies:
88

99
```shell
10-
brew install operator-sdk
10+
brew install kubebuilder
1111
brew install helm
12+
brew install k3d
13+
```
14+
15+
### Custom Resource Definition (CRD)
16+
17+
```
18+
apiVersion: platform.gov.uk/v1
19+
kind: JobRequest
20+
metadata:
21+
labels:
22+
app.kubernetes.io/name: govuk-job-request-operator
23+
app.kubernetes.io/managed-by: kustomize
24+
name: jobrequest-sample
25+
spec:
26+
foo: bar
27+
```
28+
29+
### Create and generate the manifests
30+
31+
1. Create the manifests
32+
33+
```
34+
make manifests
35+
```
36+
37+
2. Start a k3d cluster
38+
39+
```
40+
k3d cluster create cluster --api-port 6550
41+
```
42+
43+
3. Install the CRDs into the cluster
44+
45+
```
46+
make install
47+
```
48+
49+
### Run the controller locally
50+
51+
1. Run the controller locally
52+
53+
This will run the controller locally and not in the cluster.
54+
55+
```
56+
make run
57+
```
58+
59+
2. Create a custom resource
60+
61+
Edit `platform_v1_jobrequest.yaml` to the following:
62+
63+
```
64+
spec:
65+
foo: bar
66+
```
67+
68+
3. Apply the resource
69+
70+
```
71+
kubectl apply -k config/samples
72+
```
73+
74+
### Run the controller in the cluster
75+
76+
1. Build the controller in a docker image
77+
78+
```
79+
make docker-build
80+
```
81+
82+
2. Modify the `manager` manifest
83+
84+
Edit the `manager` Deployment in `config/manager/manager.yaml` to include the following:
85+
86+
```
87+
imagePullPolicy: IfNotPresent
88+
```
89+
90+
3. Load the image into the cluster
91+
92+
```
93+
k3d image import controller:latest -c cluster
94+
```
95+
96+
### Generate Helm chart
97+
98+
1. Generate a Helm chart
99+
100+
```
101+
kubebuilder edit --plugins=helm/v2-alpha
12102
```
13103

14104
## Team

0 commit comments

Comments
 (0)