This is a CMake-based project. Build targets include:
ALL_BUILD
(default target) buildsappgw-ingress
anddockerize
targetdevenv
builds a docker image with configured development environmentvendor
installs dependency usinggo mod
in a docker container with image fromdevenv
targetappgw-ingress
builds the binary for this controller in a docker container with image fromdevenv
targetdockerize
builds a docker image with the binary fromappgw-ingress
targetdockerpush
pushes the docker image to a container registry with prefix defined in CMake variable<deployment_push_prefix>
To run the CMake targets:
mkdir build && cd build
creates and enters a build directorycmake ..
generates project configuration in the build directorycmake --build .
to build the default target, orcmake --build . --target <target_name>
to specify a target to run from above
This section outlines the environment variables and files necessary to successfully compile and run the Go binary, then connect it to an Azure Kubernetes Service.
In order to run the Go binary locally and control a remote AKS server, you need Azure credentials. These will be stored in a JSON file in your home directory.
Follow these instructions to create the $HOME/.azure/azureAuth.json
file. The file is generated via:
az ad sp create-for-rbac --subscription <your-azure-subscription-id> --sdk-auth > $HOME/.azure/azureAuth.json
The file will contain a JSON blob with the following shape:
{
"clientId": "...",
"clientSecret": "...",
"subscriptionId": "<your-azure-resource-group>",
"tenantId": "...",
"activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
"resourceManagerEndpointUrl": "https://management.azure.com/",
"activeDirectoryGraphResourceId": "https://graph.windows.net/",
"sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
"galleryEndpointUrl": "https://gallery.azure.com/",
"managementEndpointUrl": "https://management.core.windows.net/"
}
In the scripts
directory you will find start.sh
. This script builds and runs the ingress controller on your local machine and connects to a remote AKS cluster. A .env
file in the root of the repository is required.
Steps to run ingress controller:
- Configure:
cp .env.example .env
and modify the environment variables in.env
to match your config - Run:
./scripts/start.sh