Название: K8s Applications mit MicroK8S auf Raspberry PI
Автор: Alfred Sabitzer
Издательство: Bookwire
Жанр: Математика
isbn: 9783742770134
isbn:
drwxr-xr-x 2 alfred alfred 4096 Oct 3 09:32 etc/
-rwxrwxr-x 1 alfred alfred 2097605 Sep 30 11:26 hello-world*
-rw-rw-r-- 1 alfred alfred 2105344 Oct 3 09:37 hello-world.tar
drwxr-xr-x 2 alfred alfred 4096 Oct 3 09:32 proc/
drwxr-xr-x 2 alfred alfred 4096 Oct 3 09:32 sys/
alfred@monitoring:~/go/test$
Wir können das Image auch lokal starten.
alfred@monitoring:~/dev/hello-world$ docker run docker.registry:5000/hello-world:20211003
hello world
alfred@monitoring:~/dev/hello-world$
Pushen in das remote-Repository. In dem Falle gibt es einen darunter liegenden den Layer schon.
alfred@monitoring:~/dev/hello-world$ docker push docker.registry:5000/hello-world:20211003
The push refers to repository [docker.registry:5000/hello-world]
6fa65fc3457a: Pushed
af86841dfdf3: Pushed
001055a1bdf7: Pushed
350991c52258: Pushed
93bd567aa306: Pushed
b48145e02449: Pushed
20211003: digest: sha256:cf16e57415939719367e5e17c09d2f17e36af2c1b84f24208f5750ea2c18b485 size: 1570
alfred@monitoring:~/dev/hello-world$
Anzeige aller vorhandenen Images im Remote Repository
alfred@monitoring:~/go$ curl docker.registry:5000/v2/_catalog
{"repositories":["hello-world"]}
alfred@monitoring:~/go$
alfred@monitoring:~/go$ curl docker.registry:5000/v2/hello-world/tags/list
{"name":"hello-world","tags":["20211003","20211001","20210830","20210930"]}
alfred@monitoring:~/go$
alfred@monitoring:~/go$ curl docker.registry:5000/v2/hello-world/manifests/20211003
{
"schemaVersion": 1,
"name": "hello-world",
"tag": "20211003",
"architecture": "arm64",
"fsLayers": [
{
"blobSum": "sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4"
},
{
"blobSum": "sha256:34b32ef7cc99133a34d56a284820986ce50c2ff9c1864da8557458489d7428a1"
}
],
"history": [
{
"v1Compatibility": "{\"architecture\":\"arm64\",\"config\":{\"Hostname\":\"\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"/hello-world\"],\"Image\":\"sha256:c7642e609037b051e03214a85ddc50434de042a6b08c23bcac16dcb92629ee46\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":null,\"Labels\":null},\"container\":\"6d8917fc20a0fcbece354d49781ee260e15cb02df65c35efa5978f583948f9c4\",\"container_config\":{\"Hostname\":\"6d8917fc20a0\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"/bin/sh\",\"-c\",\"#(nop) \",\"CMD [\\\"/hello-world\\\"]\"],\"Image\":\"sha256:c7642e609037b051e03214a85ddc50434de042a6b08c23bcac16dcb92629ee46\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":null,\"Labels\":{}},\"created\":\"2021-10-03T07:40:42.472956387Z\",\"docker_version\":\"20.10.7\",\"id\":\"031921ba69921f2705920021974bfdc500b6f42530f679aa56481bdbf1543d3e\",\"os\":\"linux\",\"parent\":\"91fdfdcec09b0c57e4f28bd9c1d199796b66e5162c2e0432f8a9dc689952e13c\",\"throwaway\":true,\"variant\":\"v8\"}"
},
{
"v1Compatibility": "{\"id\":\"91fdfdcec09b0c57e4f28bd9c1d199796b66e5162c2e0432f8a9dc689952e13c\",\"created\":\"2021-10-03T07:40:35.230309736Z\",\"container_config\":{\"Cmd\":[\"/bin/sh -c #(nop) COPY file:c46bbf237d2238c6f6241fa3c853f5d4861e4981bd19d09a99fa3f1ef76ed73a in / \"]}}"
}
],
"signatures": [
{
"header": {
"jwk": {
"crv": "P-256",
"kid": "AADV:MDEU:C5BD:UTIA:ME3T:42HB:WJUA:GTV4:DHU6:KPQM:OXBY:RRAS",
"kty": "EC",
"x": "PEw45Fk1zyjGc6iHHYh6_Ydk3mxLC8UE1mvlo_6XY24",
"y": "8e-Ad67SUvJMaYHjlyh05hqv7kcekIm6J-jR8It9unA"
},
"alg": "ES256"
},
"signature": "0iZv8OxENn9Oo_2eTyIQpfxFgBBsIW1z4p0AfkxP-bBxDE-1i5SN76FTwsLdTI9SRHnyY6R0_AoMSB1gWacdeA",
"protected": "eyJmb3JtYXRMZW5ndGgiOjIxMjUsImZvcm1hdFRhaWwiOiJDbjAiLCJ0aW1lIjoiMjAyMS0xMC0wM1QwODoxNjoxM1oifQ"
}
]
alfred@monitoring:~/go$
Somit ist das Image im Repository. Jetzt brauchen wir noch eine Service Definition.
alfred@pc1:/opt/cluster/go$ cat hello-world.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
#namespace: default
spec:
selector:
matchLabels: