Kubernetes custom resources and controllers of Fybrik.
The manager binary includes all of the controllers that this project defines, but you need to select which of the
controllers to run by passing one or more of the following command line arguments:
enable-all-controllersto enable all controllersenable-application-controllerto enable the controller forFybrikApplicationenable-blueprint-controllerto enable the controller forBlueprint
Beyond testing, you may run and debug the manager outside the cluster using the following instructions.
Use one of below methods to prepare the fybrik environment.
-
Install Fybrik using the Quick Start guide.
-
Follow the instructions to use tekton pipeline to deploy the fybrik components to your existing cluster.
Components such as connectors need to be running before you run the manager. This can be done by one of these options:
- Running components locally directly (no instructions provided)
- Running components in a cluster
For option 2, the Helm installation allows you to pick which components to install.
Follow the installation guide as usual,the fybrik crd needs to be
installed before installing fybrik as is, but in the Helm installation for the control plane
add --set manager.enabled=false to skip the deployment of the manager. For example:
helm install fybrik charts/fybrik --set global.tag=master --set manager.enabled=false --set coordinator.catalog=katalog -n fybrik-system --waitIf you are using the local development images please use the 0.0.0 tag:
helm install fybrik charts/fybrik --set global.tag=0.0.0 --set manager.enabled=false --set coordinator.catalog=katalog -n fybrik-system --waitComponents such as connectors need to be reachable over localhost. If you chose to run these components in a cluster you can use port-forward. For example:
kubectl -n fybrik-system port-forward svc/katalog-connector 49152:8080 &
kubectl -n fybrik-system port-forward svc/opa-connector 49153:8080 &The main configuration map is not available when running locally. Therefore, you need to define configuration as environment variables.
Create .env file in the root folder of the project. For example:
ClusterName="thegreendragon"
Zone="hobbiton"
VaultAuthPath="kind"
Region="theshire"
VAULT_ADDRESS="http://vault.fybrik-system:8200"
MAIN_POLICY_MANAGER_NAME="opa"
MAIN_POLICY_MANAGER_CONNECTOR_URL="http://localhost:49153"
CATALOG_PROVIDER_NAME="katalog"
CATALOG_CONNECTOR_URL="http://localhost:49152"
VAULT_MODULES_ROLE="module"
ENABLE_WEBHOOKS="false"
VAULT_ENABLED="true"
DATA_DIR="/tmp"If the manager works with a Razee service, you also need to add the following environment variables:
RAZEE_URL=<Razee access point> # e.g. "http://localhost:3333/graphql"
# you should define either RAZEE_USER/RAZEE_PASSWORD or API_KEY, if both are defined, RAZEE_USER/RAZEE_PASSWORD will be used.
RAZEE_USER=<Razee user>
RAZEE_PASSWORD=<Razee password>
API_KEY=<Razee api key>If you plan to run manager from the command line, then run the following to export all of the variables:
set -a; . .env; set +acp -R ../charts/fybrik/files/taxonomy /tmp/
cp -R ../charts/fybrik/files/adminconfig /tmp/You can now run the manager from the manager folder using one of these options:
make rungo run main.go --enable-all-controllers --metrics-bind-addr=0 --health-probe-addr=127.0.0.1:8088
If you wish to debug it from an IDE then be sure to configure the environment variables properly as described in the previous step.
Below is a launch.json file for VSCode:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/manager/main.go",
"envFile": "${workspaceFolder}/.env",
"args": ["--metrics-bind-addr=0", "--health-probe-addr=127.0.0.1:8088", "--enable-all-controllers"]
}
]
}The rest of this README describes the directory structure.
Holds the Customer Resource Definitions (CRDs) of the project:
app.fybrik.io/v1beta1: IncludesFybrikApplication, administrator APIsFybrikModuleandFybrikBucket, and internal CRDsBlueprintandPlotter.
Holds the customer controllers of the project:
controllers/appholds the controllers forapp.fybrik.ioAPIsFybrikApplication,BlueprintandPlotter.
Includes resources that are used in unit tests and in integration tests.