Create a Registry Credential

Create this credential before you select a registry other than the registry of the global cluster. The non-Alauda OS console lists it in Registry. On Alauda OS, name it in cluster.registrySecretRef.

The credential is a Secret in cpaas-system on the global cluster. Its data contains the registry address and, when the registry requires authentication, the username and password. If the registry uses IPv6, use a domain name.

Create the Secret

Write the Secret manifest with an editor, not at a shell prompt: a shell keeps the password in its history. Quote values that contain YAML special characters. For an anonymous registry, leave out username and password.

registry-credential.yaml
apiVersion: v1
kind: Secret
metadata:
  name: <registry-credential-name>
  namespace: cpaas-system
  labels:
    capi.cpaas.io/provider: registry-credential
    cpaas.io/registry-credential-format: direct
type: CloudCredential
stringData:
  registry: <registry-host>:<port>
  username: <username>
  password: <password>

Keep the file private (chmod 600 registry-credential.yaml); it holds the password. Create the Secret on the global cluster, and then remove the file:

chmod 600 registry-credential.yaml
ac config use-cluster global
ac create -f registry-credential.yaml
rm -f registry-credential.yaml
WARNING

Do not create or update a credential Secret with ac apply: client-side apply stores every value of the manifest, including the password, in an annotation on the Secret. Base64 is an encoding, not protection.

KeyRequiredNotes
NamespaceYesMust be cpaas-system.
NameYesAt most 63 characters.
TypeYesCloudCredential.
capi.cpaas.io/provider labelYesMust be registry-credential. ac rejects a Secret without this label.
cpaas.io/registry-credential-format labelYesMust be direct. Without it, the platform expects the legacy encrypted format instead of the keys below.
registryYes<host-or-IPv4>[:<port>] only. No scheme, no path, no trailing /. If the registry uses IPv6, use a domain name.
username, passwordTogetherSet both or neither. Omit both for an anonymous registry.

After the Secret exists, select its name in Registry when you create a cluster on a non-Alauda OS, or set cluster.registrySecretRef when you bind an Alauda OS workload cluster to its own registry.