Forbhreathnú gairid agus thus Coimeádáin Kata....

Forbhreathnú gairid agus thus Coimeádáin Kata....
Pléifidh an t-alt seo conas a oibríonn sé Coimeádáin Kata, agus beidh cuid phraiticiúil ann freisin lena gceangal le Docker.

Maidir le fadhbanna coitianta le Docker agus a réitigh cheana féin bhí scríofa, inniu déanfaidh mé cur síos gairid ar an gcur chun feidhme ó Kata Containers. Is am rite coimeádán slán é Kata Containers atá bunaithe ar mheaisíní fíorúla éadroma. Tá oibriú leo mar an gcéanna le coimeádáin eile, ach ina theannta sin tá leithlisiú níos iontaofa ag baint úsáide as teicneolaíocht fíorúlaithe crua-earraí. Thosaigh an tionscadal i 2017, nuair a chríochnaigh an pobal den ainm céanna cumasc na smaointe is fearr ó Intel Clear Containers agus Hyper.sh RunV, agus ina dhiaidh sin leanadh den obair ar thacaíocht d'ailtireachtaí éagsúla, lena n-áirítear AMD64, ARM, IBM p- agus z. -sraith. Ina theannta sin, tacaítear le hobair laistigh den hypervisors QEMU, Firecracker, agus tá comhtháthú le coimeádán freisin. Tá an cód ar fáil ag GitHub faoi ​​cheadúnas MIT.

Príomhghnéithe

  • Ag obair le croí ar leith, rud a chuireann leithlisiú líonra, cuimhne agus I/O ar fáil, is féidir iallach a chur ar úsáid aonrú crua-earraí bunaithe ar shíntí fíorúlaithe
  • Tacaíocht do chaighdeáin tionscail lena n-áirítear OCI (formáid coimeádán), Kubernetes CRI
  • Feidhmíocht chomhsheasmhach coimeádán rialta Linux, leithlisiú méadaithe gan forchostas feidhmíochta na VManna rialta
  • Deireadh a chur leis an ngá atá le coimeádáin a reáchtáil laistigh de mheaisíní fíorúla lán-chuimsitheacha, déanann comhéadain chineálacha comhtháthú agus seoladh a shimpliú

Suiteáil

sraith de roghanna suiteála, breithneoidh mé suiteáil ó na stórtha, bunaithe ar chóras oibriúcháin Centos 7.
Tá sé tábhachtach: Ní thacaítear le hobair Kata Containers ach ar chrua-earraí, ní oibríonn cur ar aghaidh fíorúlaithe i gcónaí, freisin tacaíocht sse4.1 de dhíth ón bpróiseálaí.

Tá sé simplí go leor coimeádáin Kata a shuiteáil:

Suiteáil fóntais chun oibriú le stórtha:

# yum -y install yum-utils

Díchumasaigh Selinux (tá sé níos ceart é a chumrú, ach ar mhaithe le simplíocht díchumasaím é):

# setenforce 0
# sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config

Ceanglaíonn muid an stór agus déanaimid an tsuiteáil

# source /etc/os-release
# ARCH=$(arch)
# BRANCH="${BRANCH:-stable-1.10}"
# yum-config-manager --add-repo "http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/${BRANCH}/CentOS_${VERSION_ID}/home:katacontainers:releases:${ARCH}:${BRANCH}.repo"
# yum -y install kata-runtime kata-proxy kata-shim

coigeartú

Beidh mé ag obair le docker, tá a shuiteáil tipiciúil, ní dhéanfaidh mé cur síos níos mine air:

# rpm -qa | grep docker
docker-ce-cli-19.03.6-3.el7.x86_64
docker-ce-19.03.6-3.el7.x86_64
# docker -v
Docker version 19.03.6, build 369ce74a3c

Déanaimid athruithe ar daemon.json:

# cat <<EOF > /etc/docker/daemon.json
{
  "default-runtime": "kata-runtime",
  "runtimes": {
    "kata-runtime": {
      "path": "/usr/bin/kata-runtime"
    }
  }
}
EOF

Atosaigh docker:

# service docker restart

Seiceáil feidhmiúil

Má thosaíonn tú ar an gcoimeádán sula n-atosóidh an docker, feicfidh tú go dtabharfaidh uname an leagan den eithne atá ag rith ar an bpríomhchóras:

# docker run busybox uname -a
Linux 19efd7188d06 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64 GNU/Linux

Tar éis atosú, tá an chuma ar an leagan eithne mar seo:

# docker run busybox uname -a
Linux 9dd1f30fe9d4 4.19.86-5.container #1 SMP Sat Feb 22 01:53:14 UTC 2020 x86_64 GNU/Linux

Tuilleadh foirne!

# time docker run busybox mount
kataShared on / type 9p (rw,dirsync,nodev,relatime,mmap,access=client,trans=virtio)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,size=65536k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
sysfs on /sys type sysfs (ro,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (ro,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (ro,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (ro,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (ro,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (ro,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/perf_event type cgroup (ro,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (ro,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/freezer type cgroup (ro,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/pids type cgroup (ro,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpuset type cgroup (ro,nosuid,nodev,noexec,relatime,cpuset)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
kataShared on /etc/resolv.conf type 9p (rw,dirsync,nodev,relatime,mmap,access=client,trans=virtio)
kataShared on /etc/hostname type 9p (rw,dirsync,nodev,relatime,mmap,access=client,trans=virtio)
kataShared on /etc/hosts type 9p (rw,dirsync,nodev,relatime,mmap,access=client,trans=virtio)
proc on /proc/bus type proc (ro,relatime)
proc on /proc/fs type proc (ro,relatime)
proc on /proc/irq type proc (ro,relatime)
proc on /proc/sys type proc (ro,relatime)
tmpfs on /proc/acpi type tmpfs (ro,relatime)
tmpfs on /proc/timer_list type tmpfs (rw,nosuid,size=65536k,mode=755)
tmpfs on /sys/firmware type tmpfs (ro,relatime)

real    0m2.381s
user    0m0.066s
sys 0m0.039s

# time docker run busybox free -m
              total        used        free      shared  buff/cache   available
Mem:           1993          30        1962           0           1        1946
Swap:             0           0           0

real    0m3.297s
user    0m0.086s
sys 0m0.050s

Tástáil ualach tapa

Chun measúnú a dhéanamh ar na caillteanais ó fhíorúil - ritheann mé sysbench, mar na príomhshamplaí an rogha seo a ghlacadh.

Sysbench á rith ag baint úsáide as coimeádán Docker+

Tástáil phróiseálaí

sysbench 1.0:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time

Prime numbers limit: 20000

Initializing worker threads...

Threads started!

General statistics:
    total time:                          36.7335s
    total number of events:              10000
    total time taken by event execution: 36.7173s
    response time:
         min:                                  3.43ms
         avg:                                  3.67ms
         max:                                  8.34ms
         approx.  95 percentile:               3.79ms

Threads fairness:
    events (avg/stddev):           10000.0000/0.00
    execution time (avg/stddev):   36.7173/0.00

Tástáil RAM

sysbench 1.0:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time

Initializing worker threads...

Threads started!

Operations performed: 104857600 (2172673.64 ops/sec)

102400.00 MiB transferred (2121.75 MiB/sec)

General statistics:
    total time:                          48.2620s
    total number of events:              104857600
    total time taken by event execution: 17.4161s
    response time:
         min:                                  0.00ms
         avg:                                  0.00ms
         max:                                  0.17ms
         approx.  95 percentile:               0.00ms

Threads fairness:
    events (avg/stddev):           104857600.0000/0.00
    execution time (avg/stddev):   17.4161/0.00

Ag rith sysbench ag baint úsáide as Gabhdáin Docker+Kata

Tástáil phróiseálaí

sysbench 1.0:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time

Prime numbers limit: 20000

Initializing worker threads...

Threads started!

General statistics:
    total time:                          36.5747s
    total number of events:              10000
    total time taken by event execution: 36.5594s
    response time:
         min:                                  3.43ms
         avg:                                  3.66ms
         max:                                  4.93ms
         approx.  95 percentile:               3.77ms

Threads fairness:
    events (avg/stddev):           10000.0000/0.00
    execution time (avg/stddev):   36.5594/0.00

Tástáil RAM

sysbench 1.0:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time

Initializing worker threads...

Threads started!

Operations performed: 104857600 (2450366.94 ops/sec)

102400.00 MiB transferred (2392.94 MiB/sec)

General statistics:
    total time:                          42.7926s
    total number of events:              104857600
    total time taken by event execution: 16.1512s
    response time:
         min:                                  0.00ms
         avg:                                  0.00ms
         max:                                  0.43ms
         approx.  95 percentile:               0.00ms

Threads fairness:
    events (avg/stddev):           104857600.0000/0.00
    execution time (avg/stddev):   16.1512/0.00

I bprionsabal, tá an scéal soiléir cheana féin, ach tá sé níos fearr na tástálacha a reáchtáil arís agus arís eile, ag baint le asluitigh agus ag meánú na dtorthaí, mar sin ní dhéanaim níos mó tástálacha fós.

Torthaí

In ainneoin go dtógann coimeádáin den sórt sin timpeall cúig nó deich n-uaire níos faide le tosú (tá an t-am rite tipiciúil le haghaidh orduithe comhchosúla níos lú ná an tríú cuid de shoicind nuair a úsáidtear coimeádán), oibríonn siad go tapa go leor má thógaimid an t-am tosaithe iomlán (tá Is samplaí thuas, orduithe a dhéantar i dtrí soicind ar an meán). Bhuel, léiríonn torthaí tástála tapa ar LAP agus RAM na torthaí beagnach mar an gcéanna, rud nach féidir ach a bheith lúcháireach, go háirithe i bhfianaise go gcuirtear aonrú ar fáil ag baint úsáide as meicníocht dea-reáchtála mar kvm.

Fógra

Is léirmheas é an t-alt, ach tugann sé deis duit an t-am rite eile a mhothú. Níl go leor réimsí iarratais clúdaithe, mar shampla, cuireann an suíomh síos ar an gcumas Kubernetes a reáchtáil ar bharr Kata Containers. Ina theannta sin, is féidir leat sraith tástálacha a reáchtáil dírithe ar fhadhbanna slándála a aimsiú, srianta a shocrú, agus rudaí suimiúla eile.

Iarraim orthu siúd go léir a léigh agus a athdhéanann anseo páirt a ghlacadh sa suirbhé, ar a mbeidh foilseacháin amach anseo ar an ábhar seo ag brath.

Ní féidir ach le húsáideoirí cláraithe páirt a ghlacadh sa suirbhé. Sínigh isteach, le do thoil.

Ar cheart dom leanúint ar aghaidh ag foilsiú altanna faoi Kata Containers?

  • 80,0%Sea, scríobh tuilleadh! 28

  • 20,0%Ní hea, ná…7

Vótáil 35 úsáideoir. Staon 7 úsáideoir.

Foinse: will.com

Add a comment