All Products
Search
Document Center

Container Service for Kubernetes:Use ACK One GitOps to deploy Container Registry Enterprise Edition OCI Helm charts

Last Updated:Feb 06, 2024

You can use Container Registry Enterprise Edition to host Oracle Cloud Infrastructure (OCI) artifacts, including images, Helm charts, and custom artifacts. This allows you to push and pull Helm charts that are packaged into OCI artifacts. You can also use ACK One GitOps to deploy Container Registry Enterprise Edition OCI Helm charts in different environments.

Prerequisites

Step 1: Push the Helm chart to a Container Registry Enterprise Edition instance

In this topic, an echo server is used. The version of the Helm chart is changed to 0.1.1 and then pushed to the Container Registry Enterprise Edition instance. In this example, the tar command is used to create the package. We recommend that you use the helm package **** command. For more information, see Push and pull Helm charts.

Step 2: Add an OCI repository

Run the following command to add an OCI repository to ACK One GitOps:

argocd repo add <myregistry.com> --type helm --name <Custom repository name> --enable-oci --username <username> --password <password>

Sample code:

argocd repo add demo***-registry.cn-hangzhou.cr.aliyuncs.com --type helm --name acr-oci --enable-oci --username ack***@test.aliyunid.com --password <password>

Step 3: Deploy the application

  1. Create a file named app-helm-dev-oci.yaml and add the following YAML content to the file:

    apiVersion: argoproj.io/v1alpha1
    kind: Application
    metadata:
      name: app-helm-dev-oci
    spec:
      destination:
        namespace: app-helm-dev-oci
        # https://XX.XX.XX.XX:6443. 
        server: <apiserver-url>
      source:
        # Example: demo***-registry.cn-hangzhou.cr.aliyuncs.com/test. 
        repoURL: <registry-domain>/<namespace>
        # Example: 0.1.1. 
        targetRevision: <my-chart-version>
        # Example: echo-server. 
        chart: <my-chart-name> 
        helm:
          passCredentials: true
          # The default is values.yaml. You can change the file name accordingly. 
          valueFiles:
            - values-dev.yaml
      project: default
      syncPolicy:
        # The automatic synchronization policy. 
        automated: {}
        syncOptions:
          - CreateNamespace=true
  2. Run the following command to use the ArgoCD CLI to deploy the application:

    argocd app create -f app-helm-dev-oci.yaml