Skip to content

Commit

Permalink
Merge pull request #1897 from maqiuyujoyce/202405-update-contribution…
Browse files Browse the repository at this point in the history
…-doc

Update the contribution guide
  • Loading branch information
google-oss-prow[bot] authored May 28, 2024
2 parents 191bb8b + 22f325c commit a4c2af8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
53 changes: 33 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,25 +144,33 @@ repo to quickly set up a local dev environment.
1. Now that you have everything set up, you can build your own images and then
deploy the Config Connector CRDs and workloads (including controller
manager, webhooks, etc...) into your test GKE cluster. Note deploying 300+
CRDs into your test cluster can take **a long time** to complete. If you are
only testing/fixing issues for a few CRDs. You can instead just apply the
CRDs you are going to work on. As an example, we want to deploy CRD
`ArtifactRegistryRepositories` because we want to validate creation of this
resource in the next step. So we can do:
```shell
cd ~/go/src/github.com/YOUR_USERNAME/k8s-config-connector
make manifests
kubectl apply -f config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_artifactregistryrepositories.artifactregistry.cnrm.cloud.google.com.yaml
```
And then we build/push the locally built images and deploy the workloads
using the command below:
```shell
make deploy-controller
```
manager, webhooks, etc...) into your test GKE cluster.
1. Note deploying 300+ CRDs into your test cluster can take **a long time**
to complete. If you are only testing/fixing issues for a few CRDs. You
can instead just apply the CRDs you are going to work on. As an example,
we want to deploy CRD `ArtifactRegistryRepositories` because we want to
validate creation of this resource in the next step. So we can do:
```shell
cd ~/go/src/github.com/YOUR_USERNAME/k8s-config-connector
make manifests
kubectl apply -f config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_artifactregistryrepositories.artifactregistry.cnrm.cloud.google.com.yaml
```
1. We need to install the following two CRDs as they are hard dependencies
to reconcile all the other supported CRDs:
```shell
kubectl apply -f operator/config/crd/bases/core.cnrm.cloud.google.com_configconnectors.yaml
kubectl apply -f operator/config/crd/bases/core.cnrm.cloud.google.com_configconnectorcontexts.yaml
```
1. Then we build/push the locally built images and deploy the workloads
using the command below:
```shell
make deploy-controller
```
### Validate your environment
Expand Down Expand Up @@ -198,6 +206,12 @@ by creating an Artifact Registry resource through Config Connector.
cluster is properly functioning and actuating K8s resources onto GCP.
### Setup Troubleshooting
#### Looking for error logs
You can look for error logs by checking the controller logs following the steps
[here](https://cloud.google.com/config-connector/docs/troubleshooting#check-controller-logs).
#### Pods fail to pull image
When the cluster is created without providing a service account, a Compute Engine service account is created for the cluster. Users must grant the service account permission to pull images from the project registry.
Expand Down Expand Up @@ -226,7 +240,6 @@ kubectl apply -f operator/config/crd/bases/core.cnrm.cloud.google.com_configconn
make deploy-controller && kubectl delete pods --namespace cnrm-system --all
```
### Make a Code Change
At this point, your cluster is running a CNRM Controller Manager image built on
Expand Down
2 changes: 1 addition & 1 deletion README.ChangingTerraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Until a long-term strategy is established, modifying this local Git Subtree may
Craft a clear commit message. Include a concise title and detailed description outlining the changes and their purpose. Refer to the provided examples for guidance.

1. Generate Files (Optional):
If adding new fields to an existing resource, run `make generate manifests resource-docs generate-go-client` to update all the generated files. Then add the generated files as a separate commit.
If adding new fields to an existing resource, run `make ready-pr` to update all the generated files. Then add the generated files as a separate commit.

1. Test Your change:
* [Run tests](README.NewResourceFromTerraform.md#run-tests) associated with the modified resource/CRD.
Expand Down

0 comments on commit a4c2af8

Please sign in to comment.