docs/doc/source/usertasks/using-an-image-from-the-local-docker-registry-in-a-container-spec.rst
Stone f63f0912c6 User Tasks guide
Fixed typo in LetsEncrypt example

Removed duplicate Datanet entry from main index.rst

Reworked Use Kubernetes CPU Manager Static Policy prerequisite block.

Restored fault/index version of FM toctree in top-level index.

Added merged doc entries to top level index.rst.

Incorporated review comments. Also some generic formatting clean-up such as
converting abbreviations to rST-style :abbr: markup.

Moved url with embedded substitution out of code-block.

Addressed patch 2 review comments. Some addtional rST tidying. See comment replies
for open questions/issues.

This patch fixes an issue with 'stx' in filenames that may differ downstream using-an-image-from-the-local-docker-registry-in-a-container-spec
new substitution and changing code-blocks to parsed-literals as required.

Initial submission for review. Note that a couple of references to WR persist
in examples. These will be marked up with comments in the review.

Signed-off-by: Stone <ronald.stone@windriver.com>
Change-Id: I1efef569842caff5def9dc00395b594d91d7a5d0
Signed-off-by: Stone <ronald.stone@windriver.com>
2020-12-02 10:34:53 -05:00

2.1 KiB

Use an Image from the Local Docker Registry in a Container Spec

When creating a pod spec or a deployment spec that uses an image from the local docker registry, you must use the full image name, including the registry, and specify an imagePullSecret with your keystone credentials.

This example procedure assumes that testuser/busybox:latest container image has been pushed to the local docker registry.

  1. Create a secret with credentials for the local docker registry.

    % kubectl create secret docker-registry testuser-registry-secret --docker-server=registry.local:9001 --docker-username=testuser --docker-password=<testuserPassword> --docker-email=noreply@windriver.com
  2. Create a configuration for the busybox container.

    % cat <<EOF > busybox.yaml
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: busybox
      namespace: default
    spec:
      progressDeadlineSeconds: 600
      replicas: 1
      selector:
        matchLabels:
          run: busybox
      template:
        metadata:
          labels:
            run: busybox
        spec:
          containers:
          - args:
            - sh
            image: registry.local:9001/testuser/busybox:latest
            imagePullPolicy: Always
            name: busybox
            stdin: true
            tty: true
          restartPolicy: Always
          imagePullSecrets:
          - name: testuser-registry-secret
    EOF
  3. Apply the configuration created in the busybox.yaml file.

    % kubectl apply -f busybox.yaml

    This will launch the busybox deployment using the image in the local docker registry and specifying the testuser-registry-secret for authentication and authorization with the registry.