Expose Docker Registry ​
This tutorial shows how you can expose the registry to the outside of the cluster with Istio.
Prerequsities ​
Steps ​
Expose the registry service by changing the spec.externalAccess.enabled flag to
true:bashkubectl apply -n kyma-system -f - <<EOF apiVersion: operator.kyma-project.io/v1alpha1 kind: DockerRegistry metadata: name: default namespace: kyma-system spec: externalAccess: enabled: true EOFOnce the DockerRegistry CR becomes
Ready, you will see a Secret name that you must use asImagePullSecretwhen scheduling workloads in the cluster.yaml... status: externalAccess: enabled: "True" internalAccess: enabled: "True" ... secretName: dockerregistry-configGenerate
config.jsonfile for docker-cli:bashkyma registry config-external --output config.jsonRename the image to contain the registry address:
bashexport REGISTRY_ADDRESS=$(kyma registry config-external --push-reg-addr) export IMAGE_NAME=<IMAGE_NAME> # put your image name here docker tag "${IMAGE_NAME}" "${REGISTRY_ADDRESS}/${IMAGE_NAME}"Push the image to the registry:
bashdocker --config . push "${REGISTRY_ADDRESS}/${IMAGE_NAME}"Create a Pod using the image from Docker Registry:
bashexport REGISTRY_INTERNAL_PULL_ADDRESS=$(kyma registry config-internal --pull-reg-addr) kubectl run my-pod --image="${REGISTRY_INTERNAL_PULL_ADDRESS}/${IMAGE_NAME}" --overrides='{ "spec": { "imagePullSecrets": [ { "name": "dockerregistry-config" } ] } }'