From 8a082c47a1bc24e4fd921b15a208962ad3f75643 Mon Sep 17 00:00:00 2001 From: Joe Kratzat Date: Wed, 9 Mar 2022 14:48:57 -0500 Subject: [PATCH] docs: add a simple local development guide --- .gitignore | 3 +++ DEVELOPMENT.md | 41 ++++++++++++++++++++++++++++++++++ hack/auth-config-template.yaml | 12 ++++++++++ 3 files changed, 56 insertions(+) create mode 100644 DEVELOPMENT.md create mode 100644 hack/auth-config-template.yaml diff --git a/.gitignore b/.gitignore index 5b304658d..e0a6776f9 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,6 @@ test/e2e/data/infrastructure-oci/v1beta1/cluster-template-bare-metal.yaml test/e2e/data/infrastructure-oci/v1beta1/cluster-template-custom-networking-seclist.yaml test/e2e/data/infrastructure-oci/v1beta1/cluster-template-custom-networking-nsg.yaml test/e2e/data/infrastructure-oci/v1beta1/cluster-template-multiple-node-nsg.yaml + +# local development files +auth-config.yaml diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 000000000..779af3e45 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,41 @@ +# Development + +The simplest way to test the code is to run it from local. +If you have `capoci-controller-manager` running in your management cluster, please scale down the deployment: +```bash +kubectl scale deployment/capoci-controller-manager --replicas=0 -n cluster-api-provider-oci-system +``` +Create and modify the auth-config.yaml file: +```bash +cp /hack/auth-config-template.yaml /auth-config.yaml +``` +Then modify the file with your information. + +Then run the following commands: +```bash +export AUTH_CONFIG_DIR="/auth-config.yaml" +make run +``` +The above step will run the code locally using your local management cluster. + +If you want to run your changes using a docker built image execute the following steps: + +```bash +export TAG= +export REGISTRY=".ocir.io/" +make docker-build +``` +`region-key` for example, phx. See the [Availability by Region](https://docs.oracle.com/en-us/iaas/Content/Registry/Concepts/registryprerequisites.htm#Availab) topic in the Oracle Cloud Infrastructure Registry +documentation. + +`namespace` is the auto-generated Object Storage namespace string of the tenancy (as shown on the Tenancy Information page) +that owns the repository to which you want to push the image. + +Push the resulting docker image to the repository. For more info on how to push to OCIR see https://www.oracle.com/webfolder/technetwork/tutorials/obe/oci/registry/index.html + +Execute the following steps to install the image + +```bash +make release-manifests +kubectl apply -f out/infrastructure-oci/v0.1.0-alpha1/infrastructure-components.yaml +``` \ No newline at end of file diff --git a/hack/auth-config-template.yaml b/hack/auth-config-template.yaml new file mode 100644 index 000000000..b1e261924 --- /dev/null +++ b/hack/auth-config-template.yaml @@ -0,0 +1,12 @@ +# see Region Identifier in https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm +# for a list of regions +region: +tenancy: +user: +key: | + -----BEGIN RSA PRIVATE KEY----- + + -----END RSA PRIVATE KEY----- +fingerprint: + +useInstancePrincipals: false \ No newline at end of file