This short guide is focused on configuring the CN-WAN Operator to use and configure Service Directory.
The included directory artifacts/settings
contains a settings.yaml
for you to modify with the appropriate values.
For your convenience, here is how the settings for the CN-WAN Operator looks like:
watchNamespacesByDefault: false
serviceAnnotations: []
serviceRegistry:
etcd:
prefix: <prefix>
authentication: <your-authentication-type>
endpoints:
- host: <host-1>
port: <port-1>
- host: <host-2>
port: <port-2>
gcpServiceDirectory:
defaultRegion: <region>
projectID: <project>
awsCloudMap:
defaultRegion: <region>
cloudMetadata:
network: auto
subNetwork: auto
We will only cover Service Directory settings here, so you can go ahead and remove some settings:
watchNamespacesByDefault: false
serviceAnnotations: []
serviceRegistry:
gcpServiceDirectory:
defaultRegion: <region>
projectID: <project>
namespace
and service
settings are covered in the main documentation. Let's now only focus on serviceRegistry
options.
If you are running the operator on GKE and want to use Service Directory on the current region and project, you may omit some fields: the operator will retrieve them automatically.
For example, if your Google Cloud Project ID is my-project-id
and your cluster zone is us-east1-d
you may write the settings as this -- other data is omitted for clarity:
serviceRegistry:
gcpServiceDirectory: {}
The operator will then automatically fill defaultRegion
to us-east1
-- please remember that Service Directory is region-based, not zone-based -- and projectID
to my-project-id
.
Please remember that this will only work if you are running inside GKE and won't work with other clusters, in which case you will have to manually override both fields.
This is the region where you want the CN-WAN Operator to put objects into. You should choose a region as close as possible to your cluster or the end user of Service Directory.
If empty and the operator is running on GKE, this value will automatically be set to the region where the cluster is in.
This is the ID of the Google project where you want to use Service Directory. It is not the project's name.
You can find this on you Google console.
If empty and the operator is running on GKE, this value will automatically be set to the project ID where the cluster is in.
In this example, you are telling the CN-WAN Operator:
- to use
us-west1
as default region - to use
project-example-1234
as the project ID.
Here is the settings example - we omit namespace
and service
settings for brevity:
namespace: ...
service: ...
serviceRegistry:
gcpServiceDirectory:
defaultRegion: us-west1
projectID: project-example-1234