@@ -7,7 +7,7 @@ bits disabled. To enable them, we need to:
7
7
8
8
- Enable ` patches/webhook_in_<kind>.yaml ` and
9
9
` patches/cainjection_in_<kind>.yaml ` in
10
- ` config/crds /kustomization.yaml ` file.
10
+ ` config/crd /kustomization.yaml ` file.
11
11
12
12
- Enable ` ../certmanager ` and ` ../webhook ` directories under the
13
13
` bases ` section in ` config/default/kustomization.yaml ` file.
@@ -18,6 +18,15 @@ bits disabled. To enable them, we need to:
18
18
- Enable all the vars under the ` CERTMANAGER ` section in
19
19
` config/default/kustomization.yaml ` file.
20
20
21
+ Additionally, we'll need to set the ` CRD_OPTIONS ` variable to just
22
+ ` "crd" ` , removing the ` trivialVersions ` option (this ensures that we
23
+ actually [ generate validation for each version] [ ref-multiver ] , instead of
24
+ telling Kubernetes that they're the same):
25
+
26
+ ``` makefile
27
+ CRD_OPTIONS ?= "crd"
28
+ ```
29
+
21
30
Now we have all our code changes and manifests in place, so let's deploy it to
22
31
the cluster and test it out.
23
32
28
37
[ 0.9.0-alpha.0] ( https://github.com/jetstack/cert-manager/releases/tag/v0.9.0-alpha.0 )
29
38
release.
30
39
31
- Once all our ducks are in a row with certificates, we can run ` make deploy ` (as normal)
32
- to deploy all the bits (i.e. the controller-manager deployment) onto the cluster.
40
+ Once all our ducks are in a row with certificates, we can run `make
41
+ install deploy` (as normal) to deploy all the bits (CRD,
42
+ controller-manager deployment) onto the cluster.
33
43
34
44
## Testing
35
45
@@ -45,14 +55,14 @@ We'll make a v2 version based on our v1 version (put it under `config/samples`)
45
55
Then, we can create it on the cluster:
46
56
47
57
``` shell
48
- kubectl apply -f config/samples/batch_v2_cronjob.yaml`
58
+ kubectl apply -f config/samples/batch_v2_cronjob.yaml
49
59
```
50
60
51
61
If we've done everything correctly, it should create successfully,
52
62
and we should be able to fetch it using both the v2 resource
53
63
54
64
``` shell
55
- kubectl get cronjobs.v2.tutorial.kubebuilder.io -o yaml
65
+ kubectl get cronjobs.v2.batch. tutorial.kubebuilder.io -o yaml
56
66
```
57
67
58
68
``` yaml
@@ -62,7 +72,7 @@ kubectl get cronjobs.v2.tutorial.kubebuilder.io -o yaml
62
72
and the v1 resource
63
73
64
74
``` shell
65
- kubectl get cronjobs.v1.tutorial.kubebuilder.io -o yaml
75
+ kubectl get cronjobs.v1.batch. tutorial.kubebuilder.io -o yaml
66
76
```
67
77
``` yaml
68
78
{{#include ./testdata/project/config/samples/batch_v2_cronjob.yaml}}
@@ -76,3 +86,5 @@ reconcile, even though our controller is written against our v1 API version.
76
86
77
87
## Troubleshooting
78
88
TODO(../TODO.md) steps for troubleshoting
89
+
90
+ [ ref-multiver ] : /reference/generating-crd.md#multiple-versions " Generating CRDs: Multiple Versions "
0 commit comments