$ microk8s enable registry
# or if you want to specify the amount of storage to be added. E.g., to use 40Gi:
$ microk8s enable registry:size=40Gi
# install some dependencies
apt-get update -y
apt-get install curl wget gnupg2 -y
# source your Ubuntu release and add the Podman repository
source /etc/os-release
sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
# download and add the GPG key
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O- | apt-key add -
# update the repository and install Podman
apt-get update -qq -y
apt-get -qq --yes install podman
# some quick test to verify the install
podman --version
podman info
# Create a file, /etc/containers/registries.conf.d/myregistry.conf
cat > /etc/containers/registries.conf.d/myregistry.conf <<EOF
[[registry]]
location = "localhost:32000"
insecure = true
EOF
# Build image
podman build . -t localhost:32000/example:latest
# Push image to your insecure local registry
podman push localhost:32000/example:latest
At this point we are ready for kubectl apply -f
to deploy with our image:
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-deployment
labels:
app: example
spec:
selector:
matchLabels:
app: example
template:
metadata:
labels:
app: example
spec:
containers:
- name: example
image: localhost:32000/example:latest
ports:
- containerPort: 80
can you please also mentioned, how to add multiple insecure registries? I can find correct format.