Installing Config Connector v1alpha1 CRDs


This topic explains how to install v1alpha1 Google Cloud resource Custom Resource Definitions (CRDs) in Config Connector.

Before you begin

  1. Ensure Config Connector is installed manually or through the GKE add-on.

  2. Check your Config Connector version and ensure it is 1.103.0 and above. You can check the Config Connector version by connecting to the cluster where Config Connector is installed and running the following command:

    kubectl get ns cnrm-system -o jsonpath='{.metadata.annotations.cnrm\.cloud\.google\.com/version}'
    

Installing the v1alpha1 CRDs

  1. Clone the GitHub repository:

    git clone https://github.com/GoogleCloudPlatform/k8s-config-connector
    
  2. git checkout to your Config Connector version:

    cd k8s-config-connector
    echo 'v'$(kubectl get ns cnrm-system -o jsonpath='{.metadata.annotations.cnrm\.cloud\.google\.com/version}') | xargs git checkout
    
  3. Install the v1alpha1 CRDs:

    cd crds
    
    1. If you want to install a specific v1alpha1 CRD, run the following command:

      kubectl apply -f CRD_FILENAME
      

      Replace CRD_FILENAME with the filename of the v1alpha1 CRD you want to install.

    2. If you want to install all the v1alpha1 CRDs, run the following command:

      kubectl apply $(ls *v1alpha1*.yaml | awk ' { print " -f " $1 } ')
      

The v1alpha1 CRDs are successfully installed when the kubectl apply command successfully completes.

Upgrading the v1alpha1 CRDs

  1. Ensure Config Connector version is upgraded before you upgrade the v1alpha1 CRDs.

  2. git checkout to your Config Connector version at your local Config Connector repository:

    echo 'v'$(kubectl get ns cnrm-system -o jsonpath='{.metadata.annotations.cnrm\.cloud\.google\.com/version}') | xargs git checkout
    
  3. Upgrade the v1alpha1 CRDs:

    cd crds
    
    1. If you want to upgrade a specific v1alpha1 CRD, run the following command:

      kubectl apply -f CRD_FILENAME
      

      Replace CRD_FILENAME with the filename of the v1alpha1 CRD you want to install.

    2. If you want to upgrade all the v1alpha1 CRDs, run the following command:

      kubectl apply $(ls *v1alpha1*.yaml | awk ' { print " -f " $1 } ')
      

The v1alpha1 CRDs are successfully upgraded when the kubectl apply command successfully completes.

Uninstalling the v1alpha1 CRDs

  1. Delete the CRs for v1alpha1 CRDs if you no longer need the underlying Google Cloud resources. Otherwise, skip this step.

  2. Check out to your Config Connector version at your local Config Connector repository:

    echo 'v'$(kubectl get ns cnrm-system -o jsonpath='{.metadata.annotations.cnrm\.cloud\.google\.com/version}') | xargs git checkout
    
  3. Uninstall the v1alpha1 CRDs:

    cd crds
    kubectl delete $(ls *v1alpha1*.yaml | awk ' { print " -f " $1 } ')
    

The v1alpha1 CRDs are successfully uninstalled if the kubectl delete command successfully completes.