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/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: {} diff --git a/charts/member-agent-arc/templates/deployment.yaml b/charts/member-agent-arc/templates/deployment.yaml index 545789f5c..dc977cc66 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.repository }}:{{ .Values.crdinstaller.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..07b95b5be 100644 --- a/charts/member-agent-arc/values.yaml +++ b/charts/member-agent-arc/values.yaml @@ -14,6 +14,12 @@ refreshtoken: repository: mcr.microsoft.com/aks/fleet/refresh-token tag: "${REFRESH_TOKEN_IMAGE_VERSION}" +crdinstaller: + enabled: true + repository: mcr.microsoft.com/aks/fleet/refresh-token/fleet/crd-installer + tag: "${CRD_INSTALLER_IMAGE_VERSION}" + logVerbosity: 2 + logVerbosity: 5 namespace: fleet-system