github.com/verrazzano/verrazzano@v1.7.0/application-operator/README.md (about) 1 [![Go Report Card](https://goreportcard.com/badge/github.com/verrazzano/verrazzano-application-operator)](https://goreportcard.com/report/github.com/verrazzano/verrazzano-application-operator) 2 3 # Verrazzano Application Operator 4 5 ## Prerequisites 6 * `kustomize` v3.1.0+ 7 * `kubebuilder` 2.3.1+ 8 * `go` version v1.15.7 9 * Docker 10 * `kubectl` 11 12 ## Build the Verrazzano application operator 13 * To generate DeepCopy and DeepCopyInto methods for changes in types in APIs 14 ``` 15 make generate 16 ``` 17 18 * To generate manifests, for example, CRD, RBAC, and such: 19 ``` 20 make manifests 21 ``` 22 23 * To do all the source code checks, such as `fmt`, `lint`, and such: 24 ``` 25 make check 26 ``` 27 28 * To build the operator and generated code: 29 ``` 30 make go-install 31 ``` 32 33 ## Test the Verrazzano application operator 34 35 You need a Kubernetes cluster to run against. 36 37 * Install the CRDs into the cluster: 38 ``` 39 make install-crds 40 ``` 41 42 * Run the operator. This will run in the foreground, so switch to a new terminal if you want to leave it running. 43 ``` 44 make run 45 ``` 46 47 * Run the operator with webhooks: 48 * Run `installer/scripts/4-install-vz-oam.sh` to create `build/webhook-certs` 49 * Run the operator with webhooks enabled: 50 ``` 51 go run main.go --kubeconfig=${KUBECONFIG} --cert-dir=build/webhook-certs 52 ``` 53 * Test the webhook endpoint: 54 ``` 55 curl -X POST --insecure \ 56 https://localhost:9443/appconfig-defaulter \ 57 -H 'Content-Type: application/json' \ 58 -d @test/integ/testdata/hello-app_appconfig-defaulter-request.json 59 ``` 60 61 * Create a custom resource. You will notice that messages are logged to the operator 62 when the custom resource is applied. 63 ``` 64 kubectl apply -f config/samples/ 65 ``` 66 67 * Delete the custom resource. You will notice that messages are logged to the operator 68 when the custom resource is deleted. 69 ``` 70 kubectl delete -f config/samples/ 71 ``` 72 * Uninstall the CRDs from the cluster: 73 ``` 74 make uninstall-crds 75 ``` 76 77 ## Build and push Docker images 78 79 * To build the Docker image: 80 ``` 81 make docker-build 82 83 * To push the Docker image: 84 ``` 85 make docker-push 86 ```