Difference between revisions of "Microk8s registry"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
Simple build/import script | Simple build/import script | ||
+ | https://microk8s.io/docs/registry-built-in | ||
``` | ``` | ||
sudo microk8s ctr images ls | sudo microk8s ctr images ls |
Revision as of 18:52, 19 July 2021
Simple build/import script
https://microk8s.io/docs/registry-built-in
sudo microk8s ctr images ls curl http://localhost:32000/v2/_catalog
Dockerfile
FROM alpine ADD https://github.com/coredns/coredns/releases/download/v1.8.1/coredns_1.8.1_linux_amd64.tgz coredns_1.8.1_linux_amd64.tgz RUN tar xf coredns_1.8.1_linux_amd64.tgz ADD https://raw.githubusercontent.com/jeremybusk/share/master/Corefile conf/Corefile COPY . / CMD ./coredns -conf Corefile
build
#!/usr/bin/env bash set -e # DO NOT USE ":latest" tag as registry cache will ignore that tag name=rdns-coredns:jtest1 sudo docker build . -t $name sudo docker save $name > $name.tar sudo microk8s ctr image import $name.tar sudo microk8s ctr images ls | grep $name # sudo microk8s ctr images rm $name # if clean-up ever needed
rdns-coredns.yml
apiVersion: v1 kind: Service metadata: name: rdns-coredns labels: run: rdns-coredns spec: type: NodePort ports: - port: 53 targetPort: 53 protocol: TCP name: dns-tcp - port: 53 protocol: UDP name: dns-udp selector: run: rdns-coredns --- apiVersion: apps/v1 kind: Deployment metadata: name: rdns-coredns spec: selector: matchLabels: run: rdns-coredns replicas: 1 template: metadata: labels: run: rdns-coredns spec: volumes: - name: secret-volume secret: secretName: rdns-coredns-secret - name: configmap-volume configMap: name: rdns-coredns-configmap containers: - name: rdns-coredns # image: rdns-coredns:latest # image: localhost:32000/rdns-coredns:latest # image: docker.io/library/rdns-coredns:jtest1 image: rdns-coredns:jtest1 ports: - containerPort: 53 protocol: UDP - containerPort: 53 protocol: TCP
Let's run a query
kubectl get pods -o=wide | grep coredns host google.com <ip address from above> or kubectl get svc | grep coredns nslookup -port=<port from above> google.com 127.0.0.1
https://microk8s.io/docs/registry-images
https://microk8s.io/docs/registry-built-in
https://microk8s.io/docs/registry-private
sudo vim /var/snap/docker/current/config/daemon.json
"insecure-registries" : ["x.x.x.y:32000"],
sudo microk8s ctr images ls name~='localhost:32000'
sudo microk8s ctr images rm localhost:32000/coredns:latest