diff --git a/charts/member-agent/README.md b/charts/member-agent/README.md index 498261661..4c74d64fb 100644 --- a/charts/member-agent/README.md +++ b/charts/member-agent/README.md @@ -29,27 +29,27 @@ helm upgrade member-agent member-agent/ --namespace fleet-system ## Parameters -| Parameter | Description | Default | -|:-------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------| -| replicaCount | The number of member-agent replicas to deploy | `1` | -| image.repository | Image repository | `ghcr.io/azure/azure/fleet/member-agent` | -| image.pullPolicy | Image pullPolicy | `IfNotPresent` | -| image.tag | The image tag to use | `v0.1.0` | -| affinity | The node affinity to use for pod scheduling | `{}` | -| tolerations | The toleration to use for pod scheduling | `[]` | -| resources | The resource request/limits for the container image | limits: "2" CPU, 4Gi, requests: 100m CPU, 128Mi | -| namespace | Namespace that this Helm chart is installed on. | `fleet-system` | -| logVerbosity | Log level. Uses V logs (klog) | `3` | -| propertyProvider | The property provider to use with the member agent; if none is specified, the Fleet member agent will start with no property provider (i.e., the agent will expose no cluster properties, and collect only limited resource usage information) | `` | -| region | The region where the member cluster resides | `` | -| config.cloudConfig | The cloud provider configuration | **required if property provider is set to azure** | +| Parameter | Description | Default | +|:------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------| +| replicaCount | The number of member-agent replicas to deploy | `1` | +| image.repository | Image repository | `ghcr.io/azure/azure/fleet/member-agent` | +| image.pullPolicy | Image pullPolicy | `IfNotPresent` | +| image.tag | The image tag to use | `v0.1.0` | +| affinity | The node affinity to use for pod scheduling | `{}` | +| tolerations | The toleration to use for pod scheduling | `[]` | +| resources | The resource request/limits for the container image | limits: "2" CPU, 4Gi, requests: 100m CPU, 128Mi | +| namespace | Namespace that this Helm chart is installed on. | `fleet-system` | +| logVerbosity | Log level. Uses V logs (klog) | `3` | +| propertyProvider | The property provider to use with the member agent; if none is specified, the Fleet member agent will start with no property provider (i.e., the agent will expose no cluster properties, and collect only limited resource usage information) | `` | +| region | The region where the member cluster resides | `` | +| config.azureCloudConfig | The cloud provider configuration | **required if property provider is set to azure** | ## Override Azure cloud config **If PropertyProvider feature is set to azure, then a cloud configuration is required.** Cloud configuration provides resource metadata and credentials for `fleet-member-agent` to manipulate Azure resources. It's embedded into a Kubernetes secret and mounted to the pods. -The values can be modified under `config.cloudConfig` section in values.yaml or can be provided as a separate file. +The values can be modified under `config.azureCloudConfig` section in values.yaml or can be provided as a separate file. | configuration value | description | Remark | @@ -71,7 +71,7 @@ You can create a file `azure.yaml` with the following content, and pass it to `h ```yaml config: - cloudConfig: + azureCloudConfig: cloud: "AzurePublicCloud" tenantId: "00000000-0000-0000-0000-000000000000" subscriptionId: "00000000-0000-0000-0000-000000000000" diff --git a/charts/member-agent/templates/cloudconfig.yaml b/charts/member-agent/templates/cloudconfig.yaml index e9f889afd..383b35a67 100644 --- a/charts/member-agent/templates/cloudconfig.yaml +++ b/charts/member-agent/templates/cloudconfig.yaml @@ -6,5 +6,5 @@ metadata: namespace: {{ .Values.namespace }} type: Opaque data: - config.json: {{ .Values.config.cloudConfig | toJson | indent 4 | b64enc | quote }} + config.json: {{ .Values.config.azureCloudConfig | toJson | indent 4 | b64enc | quote }} {{- end }} diff --git a/charts/member-agent/values.yaml b/charts/member-agent/values.yaml index 1d97fbea0..741050636 100644 --- a/charts/member-agent/values.yaml +++ b/charts/member-agent/values.yaml @@ -35,7 +35,7 @@ config: identityKey: "identity-key-path" identityCert: "identity-cert-path" CABundle: "ca-bundle-path" - cloudConfig: + azureCloudConfig: cloud: "" tenantId: "" subscriptionId: "" diff --git a/cmd/memberagent/main.go b/cmd/memberagent/main.go index 6fd52b84d..052833101 100644 --- a/cmd/memberagent/main.go +++ b/cmd/memberagent/main.go @@ -49,7 +49,6 @@ import ( "go.goms.io/fleet/pkg/propertyprovider" "go.goms.io/fleet/pkg/propertyprovider/azure" "go.goms.io/fleet/pkg/utils" - azureCloudConfig "go.goms.io/fleet/pkg/utils/cloudconfig/azure" "go.goms.io/fleet/pkg/utils/httpclient" //+kubebuilder:scaffold:imports ) @@ -369,13 +368,8 @@ func Start(ctx context.Context, hubCfg, memberConfig *rest.Config, hubOpts, memb klog.V(2).Info("setting up the Azure property provider") // Note that the property provider, though initialized here, is not started until // the specific instance wins the leader election. - cloudConfig, err := azureCloudConfig.NewCloudConfigFromFile(*cloudConfigFile) - if err != nil { - klog.ErrorS(err, "Unable to load cloud config", "file name", *cloudConfigFile) - return fmt.Errorf("unable to load cloud config: %w", err) - } - cloudConfig.SetUserAgent("fleet-member-agent") - klog.V(1).InfoS("Cloud config loaded successfully", "config", cloudConfig) + klog.V(1).InfoS("Property Provider is azure, loading cloud config", "cloudConfigFile", *cloudConfigFile) + // TODO (britaniar): load cloud config for Azure property provider. pp = azure.New(region) default: // Fall back to not using any property provider if the provided type is none or diff --git a/test/e2e/azure_valid_config.yaml b/test/e2e/azure_valid_config.yaml index 1ae76fcf6..38d7b5f2c 100644 --- a/test/e2e/azure_valid_config.yaml +++ b/test/e2e/azure_valid_config.yaml @@ -1,5 +1,5 @@ config: - cloudConfig: + azureCloudConfig: cloud: "AzurePublicCloud" tenantId: "00000000-0000-0000-0000-000000000000" subscriptionId: "00000000-0000-0000-0000-000000000000" diff --git a/test/e2e/setup.sh b/test/e2e/setup.sh index 50754bbcc..dc61a89e0 100755 --- a/test/e2e/setup.sh +++ b/test/e2e/setup.sh @@ -186,7 +186,7 @@ do --set enableV1Beta1APIs=true \ --set propertyProvider=$PROPERTY_PROVIDER \ --set region=${REGIONS[$i]} \ - -f azure_valid_config.yaml + $( [ "$PROPERTY_PROVIDER" = "azure" ] && echo "-f azure_valid_config.yaml" ) else helm install member-agent ../../charts/member-agent/ \ --set config.hubURL=$HUB_SERVER_URL \ @@ -202,7 +202,7 @@ do --set enableV1Alpha1APIs=false \ --set enableV1Beta1APIs=true \ --set propertyProvider=$PROPERTY_PROVIDER \ - -f azure_valid_config.yaml + $( [ "$PROPERTY_PROVIDER" = "azure" ] && echo "-f azure_valid_config.yaml" ) fi done