Config image registry
The config-image-registry component type creates the required secrets to pull images from a private registry.
The following snippet shows how to create such secret with the config-image-registry component.
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: my-app
spec:
components:
- name: component1
type: config-image-registry # Set to config-image-registry
properties:
registry: "fqdn" # (Required) image registry url
auth: # (Optional)
username: "username" # (Required) username
password: "password" # (Required) password
email: "email" # (Optional) email
Full example
Once the component is processed and the secret is created, the other components can pull private images. Notice that component2 depends on component1 to make sure that the secrets are created before deployed the components that required those. Alternatively, it is possible to manage the dependencies with the apply-component and apply-remaining workflow steps.
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: my-app
spec:
components:
- name: component1
type: config-image-registry # Set to config-image-registry
properties:
registry: "fqdn" # (Required) image registry url
auth: # (Optional)
username: "username" # (Required) username
password: "password" # (Required) password
email: "email" # (Optional) email
- name: component2
type: worker
properties:
image: busybox
imagePullSecrets: ["component1"]
cmd: ["sleep", "86400"]
cpu: "0.25"
memory: "200Mi"
dependsOn:
- component1