Manage Secret using kubectl

Prev Next

Available in VPC

You can learn how to manage Secrets for using and managing access permissions to container images, Data Manager, or Model Registry. ML expert Platform manages Secrets through kubectl.

Create Private Container Registry authentication Secret

To use Private Container Registry images, you must register a Secret for authentication and specify it as the imagePullSecrets field value of the Pod you want to create.
You can create a Secret to access Private Container Registry as follows:

kubectl -n <namespace> create secret docker-registry ro_foobar \
--docker-server='foobar.kr.ncr.ntruss.com' \ # Container Registry base address
--docker-username='ro_foobar' \  # User name
--docker-password='pw_foobar' # Password
apiVersion: batch/v1
kind: Job
metadata:
  name: foobar
  namespace: p-{projectName}
spec:
  template:
    spec:
      imagePullSecrets:
        - name: ro_foobar # Specify a Secret to be used in imagePullSecret
      containers:
        - name: main
          image: foobar.kr.ncr.ntruss.com/foobar:latest
          imagePullPolicy: Always