Skip to content
logo
Percona Operator for MongoDB
How to use private registry
Initializing search
    percona/k8spsmdb-docs
    percona/k8spsmdb-docs
    • Welcome
      • System requirements
      • Design and architecture
      • Comparison with other solutions
      • Install with Helm
      • Install with kubectl
      • Install on Minikube
      • Install on Google Kubernetes Engine (GKE)
      • Install on Amazon Elastic Kubernetes Service (AWS EKS)
      • Install on Microsoft Azure Kubernetes Service (AKS)
      • Generic Kubernetes installation
      • Install on OpenShift
      • Application and system users
      • Changing MongoDB options
      • Anti-affinity and tolerations
      • Labels and annotations
      • Exposing the cluster
      • Local storage support
      • Arbiter and non-voting nodes
      • MongoDB sharding
      • Transport encryption (TLS/SSL)
      • Data at rest encryption
      • Telemetry
        • About backups
        • Configure storage for backups
        • Making scheduled backups
        • Making on-demand backup
        • Storing operations logs for point-in-time recovery
        • Restore from a previously saved backup
        • Delete the unneeded backup
      • Upgrade MongoDB and the Operator
      • Horizontal and vertical scaling
      • Multi-cluster and multi-region deployment
      • Monitor with Percona Monitoring and Management (PMM)
      • Add sidecar containers
      • Restart or pause the cluster
      • Debug and troubleshoot
      • OpenLDAP integration
      • How to use private registry
      • Creating a private S3-compatible cloud for backups
      • Restore backup to a new Kubernetes-based environment
      • How to use backups to move the external database to Kubernetes
      • Install Percona Server for MongoDB in multi-namespace (cluster-wide) mode
      • Upgrading Percona Server for MongoDB manually
      • Custom Resource options
      • Percona certified images
      • Operator API
      • Frequently asked questions
      • Old releases (documentation archive)
      • Release notes index
      • Percona Operator for MongoDB 1.14.0 (2023-03-13)
      • Percona Operator for MongoDB 1.13.0 (2022-09-15)
      • Percona Operator for MongoDB 1.12.0 (2022-05-05)
      • Percona Distribution for MongoDB Operator 1.11.0 (2021-12-21)
      • Percona Distribution for MongoDB Operator 1.10.0 (2021-09-30)
      • Percona Distribution for MongoDB Operator 1.9.0 (2021-07-29)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.8.0 (2021-05-06)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.7.0 (2021-03-08)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.6.0 (2020-12-22)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.5.0 (2020-09-07)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.4.0 (2020-03-31)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.3.0 (2019-12-11)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.2.0 (2019-09-20)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.1.0 (2019-07-15)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.0.0 (2019-05-29)

    Use Docker images from a custom registry¶

    Using images from a private Docker registry may required for privacy, security or other reasons. In these cases, Percona Operator for MongoDB allows the use of a custom registry This following example of the Operator deployed in the OpenShift environment demonstrates the process:

    1. Log into the OpenShift and create a project.

      $ oc login
      
      Expected output
      Authentication required for https://192.168.1.100:8443 (openshift)
      Username: admin
      Password:
      Login successful.
      
      $ oc new-project psmdb
      
      Expected output
      Now using project "psmdb" on server "https://192.168.1.100:8443".
      
    2. You need obtain the following objects to configure your custom registry access:

      • A user token
      • the registry IP address

      You can view the token with the following command:

      $ oc whoami -t
      
      Expected output
      ADO8CqCDappWR4hxjfDqwijEHei31yXAvWg61Jg210s
      

      The following command returns the registry IP address:

      $ kubectl get services/docker-registry -n default
      
      Expected output
      NAME              TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)    AGE
      docker-registry   ClusterIP   172.30.162.173   <none>        5000/TCP   1d
      
    3. Use the user token and the registry IP address to login to the registry:

      $ docker login -u admin -p ADO8CqCDappWR4hxjfDqwijEHei31yXAvWg61Jg210s 172.30.162.173:5000
      
      Expected output
      Login Succeeded
      
    4. Use the Docker commands to pull the needed image by its SHA digest:

      $ docker pull docker.io/perconalab/percona-server-mongodb@sha256:991d6049059e5eb1a74981290d829a5fb4ab0554993748fde1e67b2f46f26bf0
      
      Expected output
      Trying to pull repository docker.io/perconalab/percona-server-mongodb ...
      sha256:991d6049059e5eb1a74981290d829a5fb4ab0554993748fde1e67b2f46f26bf0: Pulling from docker.io/perconalab/percona-server-mongodb
      Digest: sha256:991d6049059e5eb1a74981290d829a5fb4ab0554993748fde1e67b2f46f26bf0
      Status: Image is up to date for docker.io/perconalab/percona-server-mongodb@sha256:991d6049059e5eb1a74981290d829a5fb4ab0554993748fde1e67b2f46f26bf0
      

      You can find correct names and SHA digests in the current list of the Operator-related images officially certified by Percona.

    5. The following method can push an image to the custom registry for the example OpenShift psmdb project:

      $ docker tag \
          docker.io/perconalab/percona-server-mongodb@sha256:991d6049059e5eb1a74981290d829a5fb4ab0554993748fde1e67b2f46f26bf0 \
          172.30.162.173:5000/psmdb/percona-server-mongodb:4.4.18-18
      $ docker push 172.30.162.173:5000/psmdb/percona-server-mongodb:4.4.18-18
      
    6. Verify the image is available in the OpenShift registry with the following command:

      $ oc get is
      
      Expected output
      NAME                              DOCKER REPO                                                             TAGS             UPDATED
      percona-server-mongodb            docker-registry.default.svc:5000/psmdb/percona-server-mongodb  4.4.18-18  2 hours ago
      
    7. When the custom registry image is available, edit the the image: option in deploy/operator.yaml configuration file with a Docker Repo + Tag string (it should look like docker-registry.default.svc:5000/psmdb/percona-server-mongodb:4.4.18-18)

      Note

      If the registry requires authentication, you can specify the imagePullSecrets option for all images.

    8. Repeat steps 3-5 for other images, and update corresponding options in the deploy/cr.yaml file.

      Note

      Don’t forget to set upgradeoptions.apply option to Disabled. Otherwise Smart Upgrade functionality will try using the image recommended by the Version Service instead of the custom one.

    9. Now follow the standard Percona Operator for MongoDB installation instruction.

    Contact Us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: 2023-03-30
    Percona LLC and/or its affiliates, © 2009 - 2023
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.