How to update custom container register CA certificate in Aks node

Haroon Rasheed 0 Reputation points
2025-04-23T10:18:15.0433333+00:00

Im trying to pull the image from self hosted gitlab container registry. But it shows below error.

Events:

Type Reason Age From Message


Normal Scheduled 72s default-scheduler Successfully assigned default/python-microservice-78778df5d8-dwtzm to aks-agentpool-14210116-vmss000001

Normal Pulling 29s (x3 over 72s) kubelet Pulling image "dns.url/ecom/services/python-micro-services-ecom-v2:latest"

Warning Failed 28s (x3 over 71s) kubelet Failed to pull image "dns.url/ecom/services/python-micro-services-ecom-v2:latest": failed to pull and unpack image "dns.url/ecom/services/python-micro-services-ecom-v2:latest": failed to resolve reference "dns.url/ecom/services/python-micro-services-ecom-v2:latest": failed to do request: Head "https://dns.url/v2/ecom/services/python-micro-services-ecom-v2/manifests/latest": tls: failed to verify certificate: x509: certificate signed by unknown authority

Warning Failed 28s (x3 over 71s) kubelet Error: ErrImagePull

Normal BackOff 2s (x4 over 70s) kubelet Back-off pulling image "dns.url/ecom/services/python-micro-services-ecom-v2:latest"

Warning Failed 2s (x4 over 70s) kubelet Error: ImagePullBackOff

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,409 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Haroon Rasheed 0 Reputation points
    2025-04-28T14:01:16.7266667+00:00

    Im trying to access from node.

    The issue was resolved using the following steps:

    Encoded the CA certificate into Base64 format.

    Exported the cluster configuration in JSON format.

    az rest --method get --url "/subscriptions/<subscription-id>/resourceGroups/<resource-grou-name>/providers/Microsoft.ContainerService/managedClusters/<cluster-name>?api-version=2025-01-01" > body.json

    Update Base64 values to the below porfile.

    "securityProfile": {

    "customCaTrustCertificates": ["values"]

    Upload the update body json to cluster and it will take sometime to update the certificate.

    az rest --method put --url "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.ContainerService/managedClusters/<cluster-name>?api-version=2025-01-01" --body @body.json

    @Dharani Reguri , Thanks for the support and document "Use the Custom certificate authority (CA)"

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.