From 79f158db39636b6ed97aa6b5985799bb782629b3 Mon Sep 17 00:00:00 2001 From: yoobinshin Date: Thu, 14 Aug 2025 09:51:13 -0400 Subject: [PATCH 1/4] add crd installer to member-agent-arc helm chart --- charts/member-agent-arc/templates/deployment.yaml | 13 +++++++++++++ charts/member-agent-arc/values.yaml | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/charts/member-agent-arc/templates/deployment.yaml b/charts/member-agent-arc/templates/deployment.yaml index 545789f5c..a11c5d446 100644 --- a/charts/member-agent-arc/templates/deployment.yaml +++ b/charts/member-agent-arc/templates/deployment.yaml @@ -15,6 +15,19 @@ spec: app.kubernetes.io/name: fleet-member-agent spec: serviceAccountName: fleet-member-agent-sa + {{- if and .Values.crdInstaller.enabled .Values.enableV1Beta1APIs }} + initContainers: + - name: crd-installer + imagePullPolicy: IfNotPresent + image: "{{ .Values.crdInstaller.image.repository }}:{{ .Values.crdInstaller.image.tag }}" + args: + - --mode=member + - --v={{ .Values.crdInstaller.logVerbosity }} + securityContext: + capabilities: + drop: + - ALL + {{- end }} containers: - name: addon-token-adapter imagePullPolicy: IfNotPresent diff --git a/charts/member-agent-arc/values.yaml b/charts/member-agent-arc/values.yaml index 61833e4b5..7b1c56a49 100644 --- a/charts/member-agent-arc/values.yaml +++ b/charts/member-agent-arc/values.yaml @@ -14,6 +14,13 @@ refreshtoken: repository: mcr.microsoft.com/aks/fleet/refresh-token tag: "${REFRESH_TOKEN_IMAGE_VERSION}" +crdInstaller: + enabled: false + image: + repository: mcr.microsoft.com/aks/fleet/refresh-token/fleet/crd-installer + tag: "${CRD_INSTALLER_IMAGE_VERSION}" + logVerbosity: 2 + logVerbosity: 5 namespace: fleet-system From 5fb85fe8555fb2507fa30e2e831a7f3b5c801826 Mon Sep 17 00:00:00 2001 From: yoobinshin Date: Thu, 14 Aug 2025 09:53:12 -0400 Subject: [PATCH 2/4] remove appliedworks CRD from arc helm chart --- .../templates/crds/appliedworks.yaml | 229 ------------------ 1 file changed, 229 deletions(-) delete mode 100644 charts/member-agent-arc/templates/crds/appliedworks.yaml diff --git a/charts/member-agent-arc/templates/crds/appliedworks.yaml b/charts/member-agent-arc/templates/crds/appliedworks.yaml deleted file mode 100644 index e96c26004..000000000 --- a/charts/member-agent-arc/templates/crds/appliedworks.yaml +++ /dev/null @@ -1,229 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.16.0 - name: appliedworks.placement.kubernetes-fleet.io - labels: - kubernetes.azure.com/managedby: fleet -spec: - group: placement.kubernetes-fleet.io - names: - categories: - - fleet - - fleet-placement - kind: AppliedWork - listKind: AppliedWorkList - plural: appliedworks - singular: appliedwork - scope: Cluster - versions: - - name: v1 - schema: - openAPIV3Schema: - description: |- - AppliedWork represents an applied work on managed cluster that is placed - on a managed cluster. An appliedwork links to a work on a hub recording resources - deployed in the managed cluster. - When the agent is removed from managed cluster, cluster-admin on managed cluster - can delete appliedwork to remove resources deployed by the agent. - The name of the appliedwork must be the same as {work name} - The namespace of the appliedwork should be the same as the resource applied on - the managed cluster. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: Spec represents the desired configuration of AppliedWork. - properties: - workName: - description: WorkName represents the name of the related work on the - hub. - type: string - workNamespace: - description: WorkNamespace represents the namespace of the related - work on the hub. - type: string - required: - - workName - - workNamespace - type: object - status: - description: Status represents the current status of AppliedWork. - properties: - appliedResources: - description: |- - AppliedResources represents a list of resources defined within the Work that are applied. - Only resources with valid GroupVersionResource, namespace, and name are suitable. - An item in this slice is deleted when there is no mapped manifest in Work.Spec or by finalizer. - The resource relating to the item will also be removed from managed cluster. - The deleted resource may still be present until the finalizers for that resource are finished. - However, the resource will not be undeleted, so it can be removed from this list and eventual consistency is preserved. - items: - description: |- - AppliedResourceMeta represents the group, version, resource, name and namespace of a resource. - Since these resources have been created, they must have valid group, version, resource, namespace, and name. - properties: - group: - description: Group is the group of the resource. - type: string - kind: - description: Kind is the kind of the resource. - type: string - name: - description: Name is the name of the resource - type: string - namespace: - description: |- - Namespace is the namespace of the resource, the resource is cluster scoped if the value - is empty - type: string - ordinal: - description: |- - Ordinal represents an index in manifests list, so the condition can still be linked - to a manifest even though manifest cannot be parsed successfully. - type: integer - resource: - description: Resource is the resource type of the resource - type: string - uid: - description: |- - UID is set on successful deletion of the Kubernetes resource by controller. The - resource might be still visible on the managed cluster after this field is set. - It is not directly settable by a client. - type: string - version: - description: Version is the version of the resource. - type: string - required: - - ordinal - type: object - type: array - type: object - required: - - spec - type: object - served: true - storage: false - subresources: - status: {} - - name: v1beta1 - schema: - openAPIV3Schema: - description: |- - AppliedWork represents an applied work on managed cluster that is placed - on a managed cluster. An appliedwork links to a work on a hub recording resources - deployed in the managed cluster. - When the agent is removed from managed cluster, cluster-admin on managed cluster - can delete appliedwork to remove resources deployed by the agent. - The name of the appliedwork must be the same as {work name} - The namespace of the appliedwork should be the same as the resource applied on - the managed cluster. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: Spec represents the desired configuration of AppliedWork. - properties: - workName: - description: WorkName represents the name of the related work on the - hub. - type: string - workNamespace: - description: WorkNamespace represents the namespace of the related - work on the hub. - type: string - required: - - workName - - workNamespace - type: object - status: - description: Status represents the current status of AppliedWork. - properties: - appliedResources: - description: |- - AppliedResources represents a list of resources defined within the Work that are applied. - Only resources with valid GroupVersionResource, namespace, and name are suitable. - An item in this slice is deleted when there is no mapped manifest in Work.Spec or by finalizer. - The resource relating to the item will also be removed from managed cluster. - The deleted resource may still be present until the finalizers for that resource are finished. - However, the resource will not be undeleted, so it can be removed from this list and eventual consistency is preserved. - items: - description: |- - AppliedResourceMeta represents the group, version, resource, name and namespace of a resource. - Since these resources have been created, they must have valid group, version, resource, namespace, and name. - properties: - group: - description: Group is the group of the resource. - type: string - kind: - description: Kind is the kind of the resource. - type: string - name: - description: Name is the name of the resource. - type: string - namespace: - description: |- - Namespace is the namespace of the resource, the resource is cluster scoped if the value - is empty. - type: string - ordinal: - description: |- - Ordinal represents an index in manifests list, so the condition can still be linked - to a manifest even though manifest cannot be parsed successfully. - type: integer - resource: - description: Resource is the resource type of the resource. - type: string - uid: - description: |- - UID is set on successful deletion of the Kubernetes resource by controller. The - resource might be still visible on the managed cluster after this field is set. - It is not directly settable by a client. - type: string - version: - description: Version is the version of the resource. - type: string - required: - - ordinal - type: object - type: array - type: object - required: - - spec - type: object - served: true - storage: true - subresources: - status: {} From 0a13d701b1514a85ea44848d9c57816619be32b2 Mon Sep 17 00:00:00 2001 From: yoobinshin Date: Thu, 14 Aug 2025 09:57:23 -0400 Subject: [PATCH 3/4] enable crdInstaller by default --- charts/member-agent-arc/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/member-agent-arc/values.yaml b/charts/member-agent-arc/values.yaml index 7b1c56a49..e88844ca9 100644 --- a/charts/member-agent-arc/values.yaml +++ b/charts/member-agent-arc/values.yaml @@ -15,7 +15,7 @@ refreshtoken: tag: "${REFRESH_TOKEN_IMAGE_VERSION}" crdInstaller: - enabled: false + enabled: true image: repository: mcr.microsoft.com/aks/fleet/refresh-token/fleet/crd-installer tag: "${CRD_INSTALLER_IMAGE_VERSION}" From 384bb8a03c531aec1c2713e3d1b4aca9739cb8bb Mon Sep 17 00:00:00 2001 From: yoobinshin Date: Mon, 18 Aug 2025 11:24:29 -0400 Subject: [PATCH 4/4] address comments --- .github/workflows/build-publish-mcr.yml | 1 + charts/member-agent-arc/templates/deployment.yaml | 6 +++--- charts/member-agent-arc/values.yaml | 7 +++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-publish-mcr.yml b/.github/workflows/build-publish-mcr.yml index c4ebf9c0e..269e1e02e 100644 --- a/.github/workflows/build-publish-mcr.yml +++ b/.github/workflows/build-publish-mcr.yml @@ -100,6 +100,7 @@ jobs: ARC_MEMBER_AGENT_HELMCHART_VERSION: ${{ inputs.arcExtensionVersion }} MEMBER_AGENT_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.release_tag }} REFRESH_TOKEN_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.release_tag }} + CRD_INSTALLER_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.release_tag }} MCS_CONTROLLER_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.fleet_networking_version }} MEMBER_NET_CONTROLLER_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.fleet_networking_version }} REGISTRY: ${{ secrets.AZURE_REGISTRY }}/${{ env.ARC_REGISTRY_REPO}} diff --git a/charts/member-agent-arc/templates/deployment.yaml b/charts/member-agent-arc/templates/deployment.yaml index a11c5d446..dc977cc66 100644 --- a/charts/member-agent-arc/templates/deployment.yaml +++ b/charts/member-agent-arc/templates/deployment.yaml @@ -15,14 +15,14 @@ spec: app.kubernetes.io/name: fleet-member-agent spec: serviceAccountName: fleet-member-agent-sa - {{- if and .Values.crdInstaller.enabled .Values.enableV1Beta1APIs }} + {{- if and .Values.crdinstaller.enabled .Values.enableV1Beta1APIs }} initContainers: - name: crd-installer imagePullPolicy: IfNotPresent - image: "{{ .Values.crdInstaller.image.repository }}:{{ .Values.crdInstaller.image.tag }}" + image: "{{ .Values.crdinstaller.repository }}:{{ .Values.crdinstaller.tag }}" args: - --mode=member - - --v={{ .Values.crdInstaller.logVerbosity }} + - --v={{ .Values.crdinstaller.logVerbosity }} securityContext: capabilities: drop: diff --git a/charts/member-agent-arc/values.yaml b/charts/member-agent-arc/values.yaml index e88844ca9..07b95b5be 100644 --- a/charts/member-agent-arc/values.yaml +++ b/charts/member-agent-arc/values.yaml @@ -14,11 +14,10 @@ refreshtoken: repository: mcr.microsoft.com/aks/fleet/refresh-token tag: "${REFRESH_TOKEN_IMAGE_VERSION}" -crdInstaller: +crdinstaller: enabled: true - image: - repository: mcr.microsoft.com/aks/fleet/refresh-token/fleet/crd-installer - tag: "${CRD_INSTALLER_IMAGE_VERSION}" + repository: mcr.microsoft.com/aks/fleet/refresh-token/fleet/crd-installer + tag: "${CRD_INSTALLER_IMAGE_VERSION}" logVerbosity: 2 logVerbosity: 5