- Install make.
$ xcode-select --install
on macOS.$ sudo apt-get install build-essential
on Ubuntu Linux$ sudo dnf install make gcc
on Oracle Linux
- Install Go
- Install KIND
$ GO111MODULE="on" go get sigs.k8s.io/[email protected]
.
- Install Kustomize
- Install envsubst
$ go get github.com/a8m/envsubst/cmd/envsubst
Fork the cluster-api-provider-oci repo
.
See the forking and
cloning
documentation for more details.
Example:
cd "$(go env GOPATH)"/src
mkdir sigs.k8s.io
cd sigs.k8s.io/
git clone [email protected]:<GITHUB USERNAME>/cluster-api-provider-oci.git
cd cluster-api-provider-oci
git remote add upstream [email protected]:orale/cluster-api-provider-oci.git
git fetch upstream
The simplest way to test the code is to run it on your local development workstation.
If you have capoci-controller-manager
running in your management cluster,
please scale down the deployment, otherwise running your development build will conflict with the
currently running capoci-controller-manager
:
kubectl scale deployment/capoci-controller-manager --replicas=0 -n cluster-api-provider-oci-system
To build, run and test all your code changes locally, copy the
hack/auth-config-template.yaml
file to <path-to-your-repo>/auth-config.yml
in your
cloned copy of the repository and modify it to match your local configuration.
Then run the following commands:
export AUTH_CONFIG_DIR="<path-to-your-repo>/auth-config.yaml"
make run
If you want to test your changes using an image built locally using docker build
, execute the
following steps:
export TAG=<tag>
export REGISTRY="<region>.ocir.io/<namespace>"
make docker-build
region
for example, phx
or us-phoenix-1
. See the
Available Endpoints
topic in the Oracle Cloud Infrastructure Registry (OCIR) 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 container 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
make release-manifests
kubectl apply -f out/infrastructure-oci/v0.1.1-development/infrastructure-components.yaml