Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Cleanup "make run" documentation #1052

Merged
merged 25 commits into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0ed2519
Merge pull request #18 from Azure/master
WilliamMortlMicrosoft Apr 3, 2020
71a5ccc
Merge pull request #19 from Azure/master
WilliamMortlMicrosoft Apr 6, 2020
26aff09
Merge pull request #20 from Azure/master
WilliamMortlMicrosoft Apr 7, 2020
4869809
Merge pull request #21 from Azure/master
WilliamMortlMicrosoft Apr 8, 2020
48d9e77
Merge pull request #22 from Azure/master
WilliamMortlMicrosoft Apr 10, 2020
17b4a4a
Merge pull request #23 from Azure/master
WilliamMortlMicrosoft Apr 13, 2020
c9d6227
Merge pull request #24 from Azure/master
WilliamMortlMicrosoft Apr 13, 2020
e1a1e4a
Merge pull request #25 from Azure/master
WilliamMortlMicrosoft Apr 14, 2020
0fa4980
Merge pull request #26 from Azure/master
WilliamMortlMicrosoft Apr 15, 2020
afdab93
Merge pull request #27 from Azure/master
WilliamMortlMicrosoft Apr 16, 2020
5fe07e6
Merge pull request #28 from Azure/master
WilliamMortlMicrosoft Apr 19, 2020
ffae6f5
Merge pull request #29 from Azure/master
WilliamMortlMicrosoft Apr 20, 2020
0cd7941
Merge pull request #30 from Azure/master
WilliamMortlMicrosoft Apr 21, 2020
0d671f5
Merge pull request #31 from Azure/master
WilliamMortlMicrosoft Apr 22, 2020
3166ecd
Merge pull request #32 from Azure/master
WilliamMortlMicrosoft Apr 22, 2020
81d67f9
Merge pull request #33 from Azure/master
WilliamMortlMicrosoft Apr 23, 2020
4619ee6
Merge pull request #34 from Azure/master
WilliamMortlMicrosoft Apr 24, 2020
d6a8761
Merge pull request #35 from Azure/master
WilliamMortlMicrosoft Apr 26, 2020
17f4fae
Merge pull request #36 from Azure/master
WilliamMortlMicrosoft May 1, 2020
cf017a8
Merge pull request #37 from Azure/master
WilliamMortlMicrosoft May 6, 2020
1d0e17f
Merge pull request #38 from Azure/master
WilliamMortlMicrosoft May 11, 2020
1b42eb5
Merge pull request #39 from Azure/master
WilliamMortlMicrosoft May 12, 2020
8849163
first
May 14, 2020
f2ac98b
Merge branch 'master' into documentation
WilliamMortlMicrosoft May 14, 2020
ebfa93c
Merge branch 'master' into documentation
jananivMS May 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
export GO111MODULE=on
```

3. Build the image and push it to docker hub.
3. Log into Docker Hub and then Build the image and push it to Docker Hub.

```shell
docker login
Expand Down
53 changes: 47 additions & 6 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
export GO111MODULE=on
```

3. Install test certificates using `make generate-test-certs`.
3. Make sure all environment variables have been set.

4. Install test certificates using `make generate-test-certs`.

4. Install the CRDs defined in the config/crd/bases folder using the command
5. Install the CRDs defined in the config/crd/bases folder using the command
`make install`
You will see output as below.

Expand All @@ -26,7 +28,46 @@
customresourcedefinition.apiextensions.k8s.io/azuresqlservers.azure.microsoft.com configured
```

5. Run the operator locally using
6. Copy the generated certificates to the correct location by first attempting to run the operator locally using
```make run```
This will cause the operator to run (briefly) and will display an error (as well the correct location to copy generated certificates to). You will see something similar to this in the terminal window indicating that the controller started running and then subsequently failed:

```
go fmt ./...
go vet ./...
go run ./main.go

...

2020-05-13T17:04:26.587-0700 INFO controller-runtime.builder skip registering a validating webhook, admission.Validator interface is not implemented {"GVK": "azure.microsoft.com/v1alpha1, Kind=AzureSqlFirewallRule"}
2020-05-13T17:04:26.587-0700 INFO controller-runtime.builder conversion webhook enabled {"object": {"metadata":{"creationTimestamp":null},"spec":{"server":""},"status":{}}}
2020-05-13T17:04:26.587-0700 INFO controller-runtime.builder skip registering a mutating webhook, admission.Defaulter interface is not implemented {"GVK": "azure.microsoft.com/v1alpha1, Kind=AzureSqlFailoverGroup"}
2020-05-13T17:04:26.587-0700 INFO controller-runtime.builder skip registering a validating webhook, admission.Validator interface is not implemented {"GVK": "azure.microsoft.com/v1alpha1, Kind=AzureSqlFailoverGroup"}
2020-05-13T17:04:26.587-0700 INFO controller-runtime.builder conversion webhook enabled {"object": {"metadata":{"creationTimestamp":null},"spec":{"location":"","server":"","failoverpolicy":"","failovergraceperiod":0,"secondaryserver":"","secondaryserverresourcegroup":"","databaselist":null},"status":{}}}
2020-05-13T17:04:26.587-0700 INFO controller-runtime.builder skip registering a mutating webhook, admission.Defaulter interface is not implemented {"GVK": "azure.microsoft.com/v1alpha1, Kind=BlobContainer"}
2020-05-13T17:04:26.587-0700 INFO controller-runtime.builder skip registering a validating webhook, admission.Validator interface is not implemented {"GVK": "azure.microsoft.com/v1alpha1, Kind=BlobContainer"}
2020-05-13T17:04:26.587-0700 INFO controller-runtime.builder conversion webhook enabled {"object": {"metadata":{"creationTimestamp":null},"spec":{"location":""},"status":{}}}
2020-05-13T17:04:26.587-0700 INFO setup starting manager
2020-05-13T17:04:26.587-0700 INFO controller-runtime.webhook.webhooks starting webhook server
2020-05-13T17:04:26.587-0700 INFO controller-runtime.manager starting metrics server {"path": "/metrics"}
2020-05-13T17:04:26.588-0700 DEBUG controller-runtime.manager non-leader-election runnable finished {"runnable type": "*webhook.Server"}
2020-05-13T17:04:26.588-0700 INFO controller-runtime.controller Starting EventSource {"controller": "keyvault", "source": "kind source: /, Kind="}
2020-05-13T17:04:26.588-0700 ERROR setup problem running manager {"error": "open /var/folders/1_/d50yhxgd357cfl0yjdclppfc0000gn/T/k8s-webhook-server/serving-certs/tls.crt: no such file or directory"}
github.com/go-logr/zapr.(*zapLogger).Error
/Users/username/Code/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
main.main
/Users/username/Code/go/src/github.com/WilliamMortlMicrosoft/azure-service-operator/main.go:781
runtime.main
/usr/local/Cellar/go/1.14.2_1/libexec/src/runtime/proc.go:203
exit status 1
make: *** [run] Error 1`
```

Look for the listed directory given in the *problem running manager* log entry, above that directory is: "/var/folders/1_/d50yhxgd357cfl0yjdclppfc0000gn/T/". Next, run the following command `cp -r /tmp/k8s-webhook-server /var/folders/1_/d50yhxgd357cfl0yjdclppfc0000gn/T/`.

Please note, copying the generated certificates into the this folder only needs to be done the first time (or when the local Kubernetes cluster is cleared). You do not need to do this step every time.

7. Run the operator locally using
```make run```
This will cause the operator to run and "watch" for events on this terminal. You will need to open a new terminal to trigger the creation of a custom resource.

Expand Down Expand Up @@ -66,15 +107,15 @@
2019-09-24T12:18:10.626-0600 INFO controller-runtime.controller Starting workers {"controller": "eventhubnamespace", "worker count": 1}
```

6. Open a new terminal window. Trigger the creation of a custom resource using kubectl and the sample YAML file provided.
8. Open a new terminal window. Trigger the creation of a custom resource using kubectl and the sample YAML file provided.
For instance, you would use the following command to create a SQL server:

```shell
kubectl apply -f config/samples/azure_v1alpha1_azuresqlserver.yaml
azuresqlserver.azure.microsoft.com/sqlserver-sample created
```

7. You should see logs on the other terminal from the operator when this custom resource is being created.
9. You should see logs on the other terminal from the operator when this custom resource is being created.

```
2019-09-24T12:27:12.450-0600 DEBUG controller-runtime.manager.events Normal {"object": {"kind":"AzureSqlServer","namespace":"default","name":"sqlserver-sample1","uid":"ed3774af-def8-11e9-90c4-025000000001","apiVersion":"azure.microsoft.com/v1alpha1","resourceVersion":"194427"}, "reason": "Updated", "message": "finalizer azuresqlserver.finalizers.azure.com added"}
Expand All @@ -93,7 +134,7 @@
2019-09-24T12:28:20.331-0600 DEBUG controller-runtime.manager.events Normal {"object": {"kind":"AzureSqlServer","namespace":"default","name":"sqlserver-sample1","uid":"ed3774af-def8-11e9-90c4-025000000001","apiVersion":"azure.microsoft.com/v1alpha1","resourceVersion":"194518"}, "reason": "Provisioned", "message": "sqlserver sqlserver-sample1 provisioned "}
```

8. Once the operator is running locally, in order to view debugging (Prometheus-based) metrics for the Azure operator, open a web browser and navigate to the [Metrics Endpoint](http://127.0.0.1:8080/metrics).
10. Once the operator is running locally, in order to view debugging (Prometheus-based) metrics for the Azure operator, open a web browser and navigate to the [Metrics Endpoint](http://127.0.0.1:8080/metrics).

If you are using the Kubernetes cluster that comes with "Docker Desktop" and would like to view the Prometheus metrics, you can redirect port 8080 to the local machine using the following command:

Expand Down