Skip to content

Commit 8a082c4

Browse files
committed
docs: add a simple local development guide
1 parent d5f1495 commit 8a082c4

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ test/e2e/data/infrastructure-oci/v1beta1/cluster-template-bare-metal.yaml
4444
test/e2e/data/infrastructure-oci/v1beta1/cluster-template-custom-networking-seclist.yaml
4545
test/e2e/data/infrastructure-oci/v1beta1/cluster-template-custom-networking-nsg.yaml
4646
test/e2e/data/infrastructure-oci/v1beta1/cluster-template-multiple-node-nsg.yaml
47+
48+
# local development files
49+
auth-config.yaml

DEVELOPMENT.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Development
2+
3+
The simplest way to test the code is to run it from local.
4+
If you have `capoci-controller-manager` running in your management cluster, please scale down the deployment:
5+
```bash
6+
kubectl scale deployment/capoci-controller-manager --replicas=0 -n cluster-api-provider-oci-system
7+
```
8+
Create and modify the auth-config.yaml file:
9+
```bash
10+
cp <repo-path>/hack/auth-config-template.yaml <repo-path>/auth-config.yaml
11+
```
12+
Then modify the file with your information.
13+
14+
Then run the following commands:
15+
```bash
16+
export AUTH_CONFIG_DIR="<repo-path>/auth-config.yaml"
17+
make run
18+
```
19+
The above step will run the code locally using your local management cluster.
20+
21+
If you want to run your changes using a docker built image execute the following steps:
22+
23+
```bash
24+
export TAG=<tag>
25+
export REGISTRY="<region-key>.ocir.io/<namespace>"
26+
make docker-build
27+
```
28+
`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
29+
documentation.
30+
31+
`namespace` is the auto-generated Object Storage namespace string of the tenancy (as shown on the Tenancy Information page)
32+
that owns the repository to which you want to push the image.
33+
34+
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
35+
36+
Execute the following steps to install the image
37+
38+
```bash
39+
make release-manifests
40+
kubectl apply -f out/infrastructure-oci/v0.1.0-alpha1/infrastructure-components.yaml
41+
```

hack/auth-config-template.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# see Region Identifier in https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm
2+
# for a list of regions
3+
region: <region>
4+
tenancy: <tenancy OCID>
5+
user: <user OCID>
6+
key: |
7+
-----BEGIN RSA PRIVATE KEY-----
8+
<key info>
9+
-----END RSA PRIVATE KEY-----
10+
fingerprint: <fingerprint>
11+
12+
useInstancePrincipals: false

0 commit comments

Comments
 (0)