Share
Embed
werf — наш инструмент для CI-CD в Kubernetes
Доклад технического директора компании «Флант» (https://flant.ru/) Дмитрия Столярова на секции «Непрерывная поставка» конференции DevOpsConf 2019, проходившей в рамках фестиваля РИТ++ 2019 в Москве. О проблемах и вызовах, с которыми сталкиваются при деплое в Kubernetes, возможных путях их решения и реализации в Open Source-утилите для DevOps-инженеров https://github.com/flant/werf
* Текстовый обзор доклада: https://habr.com/ru/company/flant/blog/460351/
* Видео с выступления: https://youtu.be/cK3ackGUTLw
* Анонс доклада на сайте конференции: https://devopsconf.io/moscow-rit/2019/abstracts/5136
flant
May 27, 2019
Transcript
393 slides
-
лет Linux в production 11 лет с контейнерами в Linux
10 лет Docker в production 5 -
лет Linux в production 11 лет с контейнерами в Linux
10 лет Docker в production 5 года Kubernetes в production 3 -
лет Linux в production 11 лет с контейнерами в Linux
10 лет Docker в production 5 года Kubernetes в production 3 кластеров Kubernetes 100+ приложений 1000+ серверов 2000+ -
лет Linux в production 11 лет с контейнерами в Linux
10 лет Docker в production 5 года Kubernetes в production 3 кластеров Kubernetes 100+ приложений 1000+ серверов 2000+ -
лет Linux в production 11 лет с контейнерами в Linux
10 лет Docker в production 5 года Kubernetes в production 3 кластеров Kubernetes 100+ приложений 1000+ серверов 2000+ -
Kubernetes для enterprise Архитектура Внедрение On-premise Обучение использованию Поддержка 24/7
SLA Консалтинг и экспертиза подробности На стенде Фланта запрос услуги K8S@flant.ru -
Soft Production Практики Continuous Delivery с Docker youtu.be/mT5U862_ydU май 2016
Наш опыт с Kubernetes в небольших проектах youtu.be/CgCLPYJRxbU июнь 2017 -
IaC run Docker-image Docker Registry Kubernetes production build publish Код
IaC build git deploy -
IaC run Docker-image Docker Registry Kubernetes production build publish Код
IaC build git image pull deploy -
IaC run Docker-image Docker Registry Kubernetes production build publish Код
IaC build git image pull deploy Tests -
IaC run Docker-image Docker Registry Kubernetes production build publish Код
IaC build git image pull deploy Tests unit test -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests unit test -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests unit test test -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests build publish deploy deploy unit test test CI -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests build publish deploy deploy unit test test CI -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests CI build publish deploy deploy unit test test -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests unit test test -
Docker-image Docker Registry Kubernetes test Kubernetes production build publish git
image pull image pull deploy deploy unit test test Код IaC build IaC run Tests Важная деталь #2 -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests unit test test -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests unit test test Вырожденный случай #1 – “Чужой” софт -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull Tests unit test test Вырожденный случай #2 – “Java” deploy deploy -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull deploy deploy Tests Вырожденный случай #3 – Мне повезёт! image pull -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests unit test test -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests unit test test -
IaC run Docker Registry Kubernetes test Kubernetes production publish git
image pull image pull deploy deploy Tests unit test test Docker-image Код IaC build build -
FROM ubuntu:18.04 RUN apt update && apt install -y golang-go
git Нюансы сборки Вес образа 76MB +553MB -
FROM ubuntu:18.04 RUN apt update && apt install -y golang-go
git ADD . /app/ WORKDIR /app Нюансы сборки Вес образа 76MB +553MB +1MB -
FROM ubuntu:18.04 RUN apt update && apt install -y golang-go
git ADD . /app/ WORKDIR /app RUN go get -d Нюансы сборки Вес образа 76MB +553MB +1MB +3MB -
FROM ubuntu:18.04 RUN apt update && apt install -y golang-go
git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB -
FROM ubuntu:18.04 RUN apt update && apt install -y golang-go
git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB -
FROM ubuntu:18.04 RUN apt update && apt install -y golang-go
git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB = 644MB -
FROM ubuntu:18.04 RUN apt update && apt install -y golang-go
git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB = 644MB -
FROM ubuntu:18.04 RUN apt update && apt install -y golang-go
git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB = 644MB -
FROM ubuntu:18.04 RUN apt update && apt install -y golang-go
git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] FROM alpine:3.9 Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB = 644MB 6MB -
FROM ubuntu:18.04 as build RUN apt update && apt install
-y golang-go git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] FROM alpine:3.9 Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB = 644MB 6MB -
FROM ubuntu:18.04 as build RUN apt update && apt install
-y golang-go git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] FROM alpine:3.9 COPY --from=build /app/main . Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB = 644MB 6MB +9MB -
FROM ubuntu:18.04 as build RUN apt update && apt install
-y golang-go git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] FROM alpine:3.9 COPY --from=build /app/main . Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB = 644MB 6MB +9MB -
FROM ubuntu:18.04 as build RUN apt update && apt install
-y golang-go git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] FROM alpine:3.9 COPY --from=build /app/main . CMD ["/app/main"] Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB = 644MB 6MB +9MB -
FROM ubuntu:18.04 as build RUN apt update && apt install
-y golang-go git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] FROM alpine:3.9 COPY --from=build /app/main . CMD ["/app/main"] Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB = 644MB 6MB +9MB = 15MB -
FROM ubuntu:18.04 as build RUN apt update && apt install
-y golang-go git ADD . /app/ WORKDIR /app RUN go get -d RUN go build -o main . CMD ["/app/main"] FROM alpine:3.9 COPY --from=build /app/main . CMD ["/app/main"] Нюансы сборки Вес образа 76MB +553MB +1MB +3MB +9MB = 644MB 6MB +9MB = 15MB 42 раза! -
FROM ubuntu:xenial RUN addgroup --system nginx RUN adduser --system --ingroup
nginx nginx RUN apt-get update RUN apt-get install -y curl patch git build-essential libexpat-dev libgd-dev RUN curl -fSL http://nginx.org/download/nginx-$V.tar.gz -o nginx.tar.gz RUN tar -zx -f nginx.tar.gz RUN rm nginx.tar.gz RUN git clone https://github.com/haosdent/nginx-limit-upstream.git RUN patch -p1 < nginx-limit-upstream/nginx-1.12.1.patch RUN ./configure $C --with-debug RUN make -j$(getconf _NPROCESSORS_ONLN) RUN mv objs/nginx objs/nginx-debug RUN mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so RUN mv objs/ngx_http_image_filter_module.so bjs/ngx_http_image_filter_module-debug.so RUN mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so RUN mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so RUN ./configure $CONFIG RUN make -j$(getconf _NPROCESSORS_ONLN) RUN make install RUN rm -rf /etc/nginx/html/ RUN mkdir /etc/nginx/conf.d/ RUN mkdir -p /usr/share/nginx/html/ RUN install -m644 html/index.html /usr/share/nginx/html/ ... Нюансы сборки Вес образа Количество слоёв -
FROM ubuntu:xenial RUN addgroup --system nginx && \ adduser --system
--ingroup nginx nginx && \ apt-get update && \ apt-get install -y curl patch git build-essential libexpat-dev libgd-dev curl -fSL http://nginx.org/download/nginx-$V.tar.gz -o nginx.tar.gz tar -zx -f nginx.tar.gz && \ rm nginx.tar.gz RUN git clone https://github.com/haosdent/nginx-limit-upstream.git && \ patch -p1 < nginx-limit-upstream/nginx-1.12.1.patch && \ ./configure $C --with-debug && \ make -j$(getconf _NPROCESSORS_ONLN) && \ mv objs/nginx objs/nginx-debug && \ mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so mv objs/ngx_http_image_filter_module.so bjs/ngx_http_image_filter_module-debug.so mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so ./configure $C && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ rm -rf /etc/nginx/html/ && \ mkdir /etc/nginx/conf.d/ && \ mkdir -p /usr/share/nginx/html/ && \ install -m644 html/index.html /usr/share/nginx/html/ && \ ... Нюансы сборки Вес образа Количество слоёв -
FROM ubuntu:xenial RUN addgroup --system nginx && \ adduser --system
--ingroup nginx nginx && \ apt-get update && \ apt-get install -y curl patch git build-essential libexpat-dev libgd-dev curl -fSL http://nginx.org/download/nginx-$V.tar.gz -o nginx.tar.gz tar -zx -f nginx.tar.gz && \ rm nginx.tar.gz RUN git clone https://github.com/haosdent/nginx-limit-upstream.git && \ patch -p1 < nginx-limit-upstream/nginx-1.12.1.patch && \ ./configure $C --with-debug && \ make -j$(getconf _NPROCESSORS_ONLN) && \ mv objs/nginx objs/nginx-debug && \ mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so mv objs/ngx_http_image_filter_module.so bjs/ngx_http_image_filter_module-debug.so mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so ./configure $C && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ rm -rf /etc/nginx/html/ && \ mkdir /etc/nginx/conf.d/ && \ mkdir -p /usr/share/nginx/html/ && \ install -m644 html/index.html /usr/share/nginx/html/ && \ ... Нюансы сборки Вес образа Количество слоёв Дебаг -
FROM ubuntu:xenial RUN addgroup --system nginx && \ adduser --system
--ingroup nginx nginx && \ apt-get update && \ apt-get install -y curl patch git build-essential libexpat-dev libgd-dev curl -fSL http://nginx.org/download/nginx-$V.tar.gz -o nginx.tar.gz tar -zx -f nginx.tar.gz && \ rm nginx.tar.gz RUN git clone https://github.com/haosdent/nginx-limit-upstream.git && \ patch -p1 < nginx-limit-upstream/nginx-1.12.1.patch && \ ./configure $C --with-debug && \ make -j$(getconf _NPROCESSORS_ONLN) && \ mv objs/nginx objs/nginx-debug && \ mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so mv objs/ngx_http_image_filter_module.so bjs/ngx_http_image_filter_module-debug.so mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so ./configure $C && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ rm -rf /etc/nginx/html/ && \ mkdir /etc/nginx/conf.d/ && \ mkdir -p /usr/share/nginx/html/ && \ install -m644 html/index.html /usr/share/nginx/html/ && \ ... Нюансы сборки Вес образа Количество слоёв Дебаг -
FROM ubuntu:xenial RUN addgroup --system nginx && \ adduser --system
--ingroup nginx nginx && \ apt-get update && \ apt-get install -y curl patch git build-essential libexpat-dev libgd-dev curl -fSL http://nginx.org/download/nginx-$V.tar.gz -o nginx.tar.gz tar -zx -f nginx.tar.gz && \ rm nginx.tar.gz RUN git clone https://github.com/haosdent/nginx-limit-upstream.git && \ patch -p1 < nginx-limit-upstream/nginx-1.12.1.patch && \ ./configure $C --with-debug && \ make -j$(getconf _NPROCESSORS_ONLN) && \ mv objs/nginx objs/nginx-debug && \ mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so mv objs/ngx_http_image_filter_module.so bjs/ngx_http_image_filter_module-debug.so mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so ./configure $C && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ rm -rf /etc/nginx/html/ && \ mkdir /etc/nginx/conf.d/ && \ mkdir -p /usr/share/nginx/html/ && \ install -m644 html/index.html /usr/share/nginx/html/ && \ ... Нюансы сборки Вес образа Количество слоёв Дебаг -
FROM ubuntu:xenial RUN addgroup --system nginx && \ adduser --system
--ingroup nginx nginx && \ apt-get update && \ apt-get install -y curl patch git build-essential libexpat-dev libgd-dev curl -fSL http://nginx.org/download/nginx-$V.tar.gz -o nginx.tar.gz tar -zx -f nginx.tar.gz && \ rm nginx.tar.gz RUN git clone https://github.com/haosdent/nginx-limit-upstream.git && \ patch -p1 < nginx-limit-upstream/nginx-1.12.1.patch && \ ./configure $C --with-debug && \ make -j$(getconf _NPROCESSORS_ONLN) && \ mv objs/nginx objs/nginx-debug && \ mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so mv objs/ngx_http_image_filter_module.so bjs/ngx_http_image_filter_module-debug.so mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so ./configure $C && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ rm -rf /etc/nginx/html/ && \ mkdir /etc/nginx/conf.d/ && \ mkdir -p /usr/share/nginx/html/ && \ install -m644 html/index.html /usr/share/nginx/html/ && \ ... Нюансы сборки Вес образа Количество слоёв Дебаг -
FROM ubuntu:xenial RUN addgroup --system nginx && \ adduser --system
--ingroup nginx nginx && \ apt-get update && \ apt-get install -y curl patch git build-essential libexpat-dev libgd-dev curl -fSL http://nginx.org/download/nginx-$V.tar.gz -o nginx.tar.gz tar -zx -f nginx.tar.gz && \ rm nginx.tar.gz RUN git clone https://github.com/haosdent/nginx-limit-upstream.git && \ patch -p1 < nginx-limit-upstream/nginx-1.12.1.patch && \ ./configure $C --with-debug && \ make -j$(getconf _NPROCESSORS_ONLN) && \ mv objs/nginx objs/nginx-debug && \ mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so mv objs/ngx_http_image_filter_module.so bjs/ngx_http_image_filter_module-debug.so mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so ./configure $C && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ rm -rf /etc/nginx/html/ && \ mkdir /etc/nginx/conf.d/ && \ mkdir -p /usr/share/nginx/html/ && \ install -m644 html/index.html /usr/share/nginx/html/ && \ ... ? Нюансы сборки Вес образа Количество слоёв Дебаг -
Step 1/3 : FROM ubuntu:18.04 ---> 7698f282e524 Step 2/3 :
RUN addgroup --system nginx && adduser --system --ingrou ---> Running in 1ea00c8fa53d ... Removing intermediate container 1ea00c8fa53d ---> f39a30da45b1 Step 3/3 : RUN git clone https://github.com/haosdent/nginx-limit- ---> Running in 473357642c3f ... The command 'git clone ...' returned a non-zero code: 1 Нюансы сборки Вес образа Количество слоёв Дебаг -
Step 1/3 : FROM ubuntu:18.04 ---> 7698f282e524 Step 2/3 :
RUN addgroup --system nginx && adduser --system --ingrou ---> Running in 1ea00c8fa53d ... Removing intermediate container 1ea00c8fa53d ---> f39a30da45b1 Step 3/3 : RUN git clone https://github.com/haosdent/nginx-limit- ---> Running in 473357642c3f ... The command 'git clone ...' returned a non-zero code: 1 Нюансы сборки Вес образа Количество слоёв Дебаг -
Step 1/3 : FROM ubuntu:18.04 ---> 7698f282e524 Step 2/3 :
RUN addgroup --system nginx && adduser --system --ingrou ---> Running in 1ea00c8fa53d ... Removing intermediate container 1ea00c8fa53d ---> f39a30da45b1 Step 3/3 : RUN git clone https://github.com/haosdent/nginx-limit- ---> Running in 473357642c3f ... The command 'git clone ...' returned a non-zero code: 1 $ docker run -ti f39a30da45b1 /bin/bash ... Нюансы сборки Вес образа Количество слоёв Дебаг -
FROM python:3.4 ADD . /app WORKDIR /app RUN pip install
-r requirements.txt Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки -
FROM python:3.4 ADD . /app WORKDIR /app RUN pip install
-r requirements.txt Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки -
FROM python:3.4 ADD . /app WORKDIR /app RUN pip install
-r requirements.txt Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки -
FROM python:3.4 RUN mkdir /app WORKDIR /app Нюансы сборки Вес
образа Количество слоёв Дебаг Скорость сборки -
FROM python:3.4 RUN mkdir /app WORKDIR /app ADD requirements.txt /app/
RUN pip install -r requirements.txt Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки -
FROM python:3.4 RUN mkdir /app WORKDIR /app ADD requirements.txt /app/
RUN pip install -r requirements.txt ADD . /app Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки -
FROM python:3.4 RUN mkdir /app WORKDIR /app ADD requirements.txt /app/
RUN pip install -r requirements.txt ADD . /app Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки -
FROM python:3.4 RUN mkdir /app WORKDIR /app ADD requirements.txt /app/
RUN pip install -r requirements.txt ADD . /app Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки -
FROM python:3.4 RUN mkdir /app WORKDIR /app ADD requirements.txt /app/
RUN pip install -r requirements.txt ADD . /app Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки -
FROM python:3.4 RUN mkdir /app WORKDIR /app ADD requirements-basic.txt /app/
RUN pip install -r requirements-basic.txt ADD requirements.txt /app/ RUN pip install -r requirements.txt ADD . /app Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки -
FROM php:7.3-fpm ADD sys/php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf RUN mkdir -p /app/lib COPY
index.php /app COPY lib /app/lib WORKDIR /app FROM nginx:latest ADD sys/nginx.conf /etc/nginx/nginx.conf ADD static/ /usr/share/nginx/html/ FROM php:7.3 RUN mkdir -p /app/consumer COPY consumer /app/consumer WORKDIR /app Dockerfile-backend Dockerfile-frontend Dockerfile-consumer Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки Много образов -
FROM php:7.3-fpm ADD sys/php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf RUN mkdir -p /app/lib COPY
index.php /app COPY lib /app/lib WORKDIR /app Dockerfile-backend FROM nginx:latest ADD sys/nginx.conf /etc/nginx/nginx.conf ADD static/ /usr/share/nginx/html/ FROM php:7.3 RUN mkdir -p /app/consumer COPY consumer /app/consumer WORKDIR /app Dockerfile-frontend Dockerfile-consumer #!/bin/bash docker build -f Dockerfile.frontend . -t frontend:latest docker build -f Dockerfile.backend . -t backend:latest docker build -f Dockerfile.consumer . -t consumer:latest Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки Много образов -
FROM nginx:latest ADD sys/nginx.conf /etc/nginx/nginx.conf ADD static/ /usr/share/nginx/html/ FROM php:7.3
RUN mkdir -p /app/consumer COPY consumer /app/consumer WORKDIR /app Dockerfile-frontend Dockerfile-consumer FROM php:7.3-fpm ADD sys/php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf RUN mkdir -p /app/lib COPY index.php /app COPY lib /app/lib WORKDIR /app Dockerfile-backend Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки Много образов -
FROM nginx:latest ADD sys/nginx.conf /etc/nginx/nginx.conf ADD static/ /usr/share/nginx/html/ FROM php:7.3
RUN mkdir -p /app/consumer COPY consumer /app/consumer WORKDIR /app FROM php:7.3-fpm ADD sys/php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf RUN mkdir -p /app/lib COPY index.php /app COPY lib /app/lib WORKDIR /app Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки Много образов -
FROM nginx:latest ADD sys/nginx.conf /etc/nginx/nginx.conf ADD static/ /usr/share/nginx/html/ FROM php:7.3
RUN mkdir -p /app/consumer COPY consumer /app/consumer WORKDIR /app FROM php:7.3-fpm ADD sys/php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf RUN mkdir -p /app/lib COPY index.php /app COPY lib /app/lib WORKDIR /app Dockerfile Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки Много образов -
FROM nginx:latest as frontend ADD sys/nginx.conf /etc/nginx/nginx.conf ADD static/ /usr/share/nginx/html/
FROM php:7.3 as consumer RUN mkdir -p /app/consumer COPY consumer /app/consumer WORKDIR /app FROM php:7.3-fpm as backend ADD sys/php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf RUN mkdir -p /app/lib COPY index.php /app COPY lib /app/lib WORKDIR /app Dockerfile Нюансы сборки Вес образа Количество слоёв Дебаг Скорость сборки Много образов -
FROM nginx:latest as frontend ADD sys/nginx.conf /etc/nginx/nginx.conf ADD static/ /usr/share/nginx/html/
FROM php:7.3 as consumer RUN mkdir -p /app/consumer COPY consumer /app/consumer WORKDIR /app Нюансы сборки Вес образа Количество слоёв FROM php:7.3-fpm as backend ADD sys/php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf RUN mkdir -p /app/lib COPY index.php /app COPY lib /app/lib WORKDIR /app Dockerfile #!/bin/bash docker build --target frontend . -t frontend:latest docker build --target backend . -t backend:latest docker build --target consumer . -t consumer:latest Дебаг Скорость сборки Много образов -
FROM nginx:latest as frontend ADD sys/nginx.conf /etc/nginx/nginx.conf ADD static/ /usr/share/nginx/html/
FROM php:7.3 as consumer RUN mkdir -p /app/consumer COPY consumer /app/consumer WORKDIR /app Нюансы сборки Вес образа Количество слоёв FROM php:7.3-fpm as backend ADD sys/php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf RUN mkdir -p /app/lib COPY index.php /app COPY lib /app/lib WORKDIR /app Dockerfile #!/bin/bash docker build --target frontend . -t frontend:latest docker build --target backend . -t backend:latest docker build --target consumer . -t consumer:latest Дебаг Скорость сборки Много образов -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker Параллельная сборка -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker Параллельная сборка Распределенная сборка -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker Параллельная сборка Распределенная сборка Автомагия -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker Параллельная сборка Распределенная сборка moby/buildkit Автомагия -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker Параллельная сборка Распределенная сборка moby/buildkit Автомагия -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker Параллельная сборка Распределенная сборка moby/buildkit Автомагия -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker Параллельная сборка Распределенная сборка moby/buildkit genuinetools/img Автомагия -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker Параллельная сборка Распределенная сборка ? Автомагия -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker Параллельная сборка Распределенная сборка ? Параллельная сборка Автомагия -
Вес образа Количество слоёв Дебаг Скорость сборки Много образов Mount
Ansible Сборка без Docker Параллельная сборка Распределенная сборка ? Параллельная сборка Автомагия -
IaC run Docker Registry Kubernetes test Kubernetes production publish git
image pull image pull deploy deploy Tests unit test test Docker-image Код IaC build build -
IaC run Kubernetes test Kubernetes production build Код IaC build
git image pull image pull deploy deploy Tests unit test test Docker-image Docker Registry publish -
IaC run Kubernetes test Kubernetes production build Код IaC build
git image pull image pull deploy deploy Tests unit test test Docker-image Docker Registry publish №1: Как тегировать образ? -
myimage: v1.0 Stage Docker Registry myimage: v1.0 1.0 myimage: v1.0
Production Стратегии тегирования git tag -
myimage: v1.0 Stage myimage: v1.0 Docker Registry 1.0 myimage: v1.0
Production Стратегии тегирования git tag -
myimage: v1.0 Stage myimage: v1.0 Docker Registry master 1.0 myimage:
v1.0 Production Стратегии тегирования git tag -
myimage: v1.0 Stage master myimage: v1.0 Docker Registry 1.0 myimage:
v1.0 Production Стратегии тегирования git tag -
myimage: v1.0 Stage master myimage: v1.0 Docker Registry 1.0 myimage:
v1.0 Production Стратегии тегирования git tag -
myimage: v1.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
git tag myimage: v1.0 Production Стратегии тегирования git tag -
IaC run Code IaC build git myimage: v1.0 Production myimage:
v1.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0 git tag Стратегии тегирования git tag -
myimage: v1.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 build myimage: v1.0 Production Стратегии тегирования git tag -
myimage: v1.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 myimage: v2.0 2.0 publish myimage: v1.0 Production Стратегии тегирования git tag -
myimage: v1.0 Stage master myimage: v1.0 Docker Registry 1.0 myimage:
v2.0 publish myimage: v1.0 Production 2.0 myimage: v2.0 2.0 Стратегии тегирования git tag -
myimage: v2.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 2.0 myimage: v1.0 Production Стратегии тегирования git tag -
myimage: v2.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 2.0 deploy myimage: v2.0 myimage: v1.0 Production Стратегии тегирования git tag -
myimage: v2.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 2.0 myimage: v1.0 Production Стратегии тегирования git tag -
myimage: v2.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 2.0 deploy myimage: v2.0 Production myimage: v2.0 Стратегии тегирования git tag -
myimage: v2.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 2.0 myimage: v2.0 Production Стратегии тегирования git tag -
myimage: v2.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 2.0 myimage: v2.0 Production 1. Поставить тег Стратегии тегирования git tag -
myimage: v2.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 2.0 myimage: v2.0 Production 1. Поставить тег 2. Протестировать Стратегии тегирования git tag -
myimage: v2.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 2.0 myimage: v2.0 Production 1. Поставить тег 2. Протестировать 3. Выкатить на прод Стратегии тегирования git tag -
myimage: v2.0 Stage master myimage: v1.0 Docker Registry 1.0 2.0
myimage: v2.0 2.0 myimage: v2.0 Production Воспроизводимо, но жутко неудобно 1. Поставить тег 2. Протестировать 3. Выкатить на прод Стратегии тегирования git tag -
Docker Registry myimage 1.0 master 1.0 Стратегии тегирования git tag
git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Стратегии
тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage: #c1 myimage #c1 publish build Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop myimage: #c1 myimage publish build #c1 #c1 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop myimage #c1 #c1 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c1 deploy myimage: #c1 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c1 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c1 #c2 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c2 #c2 myimage #c2 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 myimage #c3 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 myimage #c3 release_1.1 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c3 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 release_1.1 myimage #c3 #c3 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Preview
develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c3 Staging myimage: #c3 deploy myimage: #c3 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Preview
develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c3 Staging myimage: #c3 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Preview
develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 Staging myimage: #c3 #c3 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Preview
develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 Staging myimage: #c3 #c3 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Preview
develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 Staging myimage: #c3 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Preview
develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c4 publish build Staging myimage: #c3 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c3 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 deploy myimage: #c4 myimage: #c4 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c4 Стратегии тегирования git tag git commit + tag -
... Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0
Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c4 Стратегии тегирования git tag git commit + tag -
... Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0
Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c4 Стратегии тегирования git tag git commit + tag -
... Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0
Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c4 Стратегии тегирования git tag git commit + tag -
... Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0
Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c4 Стратегии тегирования git tag git commit + tag -
... Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0
Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c4 Стратегии тегирования git tag git commit + tag -
... Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0
Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c4 #c25 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c24 #c25 myimage: #c25 publish build myimage #c25 ... Стратегии тегирования git tag git commit + tag -
myimage #c25 ... Docker Registry myimage 1.0 master 1.0 Production
myimage: v1.0 Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 deploy myimage: #c25 Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 myimage #c25 ... Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 #c25 myimage #c25 ... Стратегии тегирования git tag git commit + tag -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 myimage #c25 ... Стратегии тегирования git tag git commit + tag -
... Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0
Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 myimage #c25 #c25 Стратегии тегирования git tag git commit + tag -
... Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0
Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 myimage #c25 #c25 1.1 Стратегии тегирования git tag git commit + tag -
... Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0
Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 myimage #c25 #c25 1.1 1.1 Стратегии тегирования git tag git commit + tag -
myimage #c25 ... Docker Registry myimage 1.0 master 1.0 Production
myimage: v1.0 Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 1.1 1.1 Стратегии тегирования git tag git commit + tag -
myimage #c25 ... Docker Registry myimage 1.0 master 1.0 Production
myimage: v1.1 Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 1.1 deploy myimage: v1.1 1.1 Стратегии тегирования git tag git commit + tag -
myimage #c25 ... Docker Registry myimage 1.0 master 1.0 Preview
develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 #c25 1.1 1.1 Production myimage: v1.1 Staging myimage: #c25 Стратегии тегирования git tag git commit + tag -
myimage #c25 ... Docker Registry myimage 1.0 master 1.0 Preview
develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 #c25 1.1 1.1 Production myimage: v1.1 Staging myimage: #c25 Стратегии тегирования git tag git commit + tag -
myimage #c25 ... Docker Registry myimage 1.0 master 1.0 Preview
develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 #c25 1.1 1.1 Production myimage: v1.1 Staging myimage: #c25 Стратегии тегирования git tag git commit + tag -
... Docker Registry myimage 1.0 master 1.0 Preview develop #c1
myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 #c25 1.1 Production myimage: v1.1 Staging myimage: #c25 myimage #c25 1.1 Стратегии тегирования git tag git commit + tag -
myimage #c25 ... Docker Registry myimage 1.0 master 1.0 Production
myimage: v1.1 Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 1.1 1.1 Стратегии тегирования git tag git commit + tag -
myimage #c25 ... Docker Registry myimage 1.0 master 1.0 Production
myimage: v1.1 Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 1.1 1.1 Стратегии тегирования git tag git commit + tag -
myimage #c25 ... Docker Registry myimage 1.0 master 1.0 Production
myimage: v1.1 Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 1.1 1.1 И воспроизводимо, и удобно! Стратегии тегирования git tag git commit + tag -
myimage #c25 ... Docker Registry myimage 1.0 master 1.0 Production
myimage: v1.1 Staging Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 1.1 1.1 И воспроизводимо, и удобно! Но, только fast forward! Стратегии тегирования git tag git commit + tag -
FROM ruby:2.3 as assets RUN mkdir -p /app WORKDIR /app
COPY . ./ RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb FROM nginx:alpine COPY --from=assets /app/public /usr/share/nginx/www/public Стратегии тегирования Перезапись git tag git commit + tag Content addressable -
FROM ruby:2.3 as assets RUN mkdir -p /app WORKDIR /app
COPY . ./ RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb FROM nginx:alpine COPY --from=assets /app/public /usr/share/nginx/www/public 8c62b065252f2bc1c6a859acd18df1bb2aba260c47a593d6a7de9b34239727e5 Стратегии тегирования git tag git commit + tag Content addressable -
FROM ruby:2.3 as assets RUN mkdir -p /app WORKDIR /app
COPY . ./ RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb FROM nginx:alpine COPY --from=assets /app/public /usr/share/nginx/www/public 8c62b065252f2bc1c6a859acd18df1bb2aba260c47a593d6a7de9b34239727e5 ab738dd6e9a8fdf3808928b349ec93a2ed2eab03ebffb53cdcedc54f5419024a Стратегии тегирования git tag git commit + tag Content addressable -
FROM ruby:2.3 as assets RUN mkdir -p /app WORKDIR /app
COPY . ./ RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb FROM nginx:alpine COPY --from=assets /app/public /usr/share/nginx/www/public 8c62b065252f2bc1c6a859acd18df1bb2aba260c47a593d6a7de9b34239727e5 ab738dd6e9a8fdf3808928b349ec93a2ed2eab03ebffb53cdcedc54f5419024a RUN mkdir -p /app WORKDIR /app Стратегии тегирования git tag git commit + tag Content addressable -
FROM ruby:2.3 as assets RUN mkdir -p /app WORKDIR /app
COPY . ./ RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb FROM nginx:alpine COPY --from=assets /app/public /usr/share/nginx/www/public 8c62b065252f2bc1c6a859acd18df1bb2aba260c47a593d6a7de9b34239727e5 ab738dd6e9a8fdf3808928b349ec93a2ed2eab03ebffb53cdcedc54f5419024a RUN mkdir -p /app WORKDIR /app RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb Стратегии тегирования git tag git commit + tag Content addressable -
FROM ruby:2.3 as assets RUN mkdir -p /app WORKDIR /app
COPY . ./ RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb FROM nginx:alpine COPY --from=assets /app/public /usr/share/nginx/www/public 8c62b065252f2bc1c6a859acd18df1bb2aba260c47a593d6a7de9b34239727e5 ab738dd6e9a8fdf3808928b349ec93a2ed2eab03ebffb53cdcedc54f5419024a RUN mkdir -p /app WORKDIR /app RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb COPY --from=assets /app/public/usr/share/ nginx/www/public Стратегии тегирования git tag git commit + tag Content addressable -
FROM ruby:2.3 as assets RUN mkdir -p /app WORKDIR /app
COPY . ./ RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb FROM nginx:alpine COPY --from=assets /app/public /usr/share/nginx/www/public 8c62b065252f2bc1c6a859acd18df1bb2aba260c47a593d6a7de9b34239727e5 ab738dd6e9a8fdf3808928b349ec93a2ed2eab03ebffb53cdcedc54f5419024a RUN mkdir -p /app WORKDIR /app RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb COPY --from=assets /app/public/usr/share/ nginx/www/public 261d2204dfe93eb7e59ca7182c7e07d34f97336804679da 90a07e2c8a2ed6c24 SHA256 Стратегии тегирования git tag git commit + tag Content addressable -
FROM ruby:2.3 as assets RUN mkdir -p /app WORKDIR /app
COPY . ./ RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb FROM nginx:alpine COPY --from=assets /app/public /usr/share/nginx/www/public 8c62b065252f2bc1c6a859acd18df1bb2aba260c47a593d6a7de9b34239727e5 ab738dd6e9a8fdf3808928b349ec93a2ed2eab03ebffb53cdcedc54f5419024a RUN mkdir -p /app WORKDIR /app RUN gem install bundler && bundle install RUN bundle exec rake assets:precompile CMD bundle exec puma -C config/puma.rb COPY --from=assets /app/public/usr/share/ nginx/www/public 261d2204dfe93eb7e59ca7182c7e07d34f97336804679da 90a07e2c8a2ed6c24 f0dac297477bfe0c3d0bf1d2bfed61101e4a72910fba90b01ae0c3c29807f252 SHA256 Стратегии тегирования git tag git commit + tag Content addressable -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 myimage #c25 ... Стратегии тегирования git tag git commit + tag Content addressable -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage #c1 myimage: #c18 #c2 myimage #c2 #c3 myimage #c3 release_1.1 #c4 myimage #c4 myimage: #c25 #c25 myimage #c25 ... #sig1 #sig2 #sig3 #sig4 #sig25 Стратегии тегирования git tag git commit + tag Content addressable -
#c1 #c2 #c3 #c4 #c25 Docker Registry myimage 1.0 master
1.0 Production myimage: v1.0 Staging Preview develop myimage myimage: #sig18 myimage myimage release_1.1 myimage myimage: #sig25 myimage ... #sig1 #sig2 #sig3 #sig4 #sig25 #sig1 #sig2 #sig3 #sig4 #sig25 Стратегии тегирования git tag git commit + tag Content addressable -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage myimage: #sig18 #c2 myimage #c3 myimage release_1.1 #c4 myimage myimage: #sig25 myimage ... #sig1 #sig2 #sig3 #sig4 #sig25 #sig1 #sig2 #sig3 #sig4 #c25 #sig25 #c26 #sig25 Стратегии тегирования git tag git commit + tag Content addressable -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage myimage: #sig18 #c2 myimage #c3 myimage release_1.1 #c4 myimage myimage: #sig25 ... #sig1 #sig2 #sig3 #sig4 #sig1 #sig2 #sig3 #sig4 #c25 #sig25 #c26 #sig25 myimage #sig25 Стратегии тегирования git tag git commit + tag Content addressable -
Docker Registry myimage 1.0 master 1.0 Production myimage: v1.0 Staging
Preview develop #c1 myimage myimage: #sig18 #c2 myimage #c3 myimage release_1.1 #c4 myimage myimage: #sig25 ... #sig1 #sig2 #sig3 #sig4 #sig1 #sig2 #sig3 #sig4 #c25 #sig25 #c26 #sig25 myimage #sig25 deploy myimage: #sig25 Стратегии тегирования git tag git commit + tag Content addressable -
Docker Registry myimage 1.0 master 1.0 Production myimage: #sig25 Staging
Preview develop #c1 myimage myimage: #sig18 #c2 myimage #c3 myimage release_1.1 #c4 myimage myimage: #sig25 ... #sig1 #sig2 #sig3 #sig4 #sig1 #sig2 #sig3 #sig4 #c25 #sig25 #c26 #sig25 myimage #sig25 Стратегии тегирования git tag git commit + tag Content addressable -
Docker Registry myimage 1.0 master 1.0 Production myimage: #sig25 Staging
Preview develop #c1 myimage myimage: #sig18 #c2 myimage #c3 myimage release_1.1 #c4 myimage myimage: #sig25 ... #sig1 #sig2 #sig3 #sig4 #sig1 #sig2 #sig3 #sig4 #c25 #sig25 #c26 #sig25 myimage #sig25 Стратегии тегирования git tag git commit + tag Content addressable -
Docker Registry myimage 1.0 master 1.0 Production myimage: #sig25 Staging
Preview develop #c1 myimage myimage: #sig18 #c2 myimage #c3 myimage release_1.1 #c4 myimage myimage: #sig25 ... #sig1 #sig2 #sig3 #sig4 #sig1 #sig2 #sig3 #sig4 myimage #sig25 #c25 #sig25 #c26 #sig25 Стратегии тегирования git tag git commit + tag Content addressable -
Docker Registry myimage 1.0 master 1.0 Production myimage: #sig25 Staging
Preview develop #c1 myimage myimage: #sig18 #c2 myimage #c3 myimage release_1.1 #c4 myimage myimage: #sig25 ... #sig1 #sig2 #sig3 #sig4 #sig1 #sig2 #sig3 #sig4 myimage #sig25 #c25 #sig25 #c26 #sig25 SHA256 ??? Стратегии тегирования git tag git commit + tag Content addressable -
stage image Стратегии тегирования git tag git commit + tag
Content addressable -
master Code git IaC build Стратегии тегирования git tag git
commit + tag Content addressable -
master Code from git beforeInstall install beforeSetup setup IaC build
Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall Code from git beforeInstall install beforeSetup setup IaC
build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall Code git install beforeSetup setup IaC build #sig1
from beforeInstall Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall Code git install beforeSetup setup IaC build from
beforeInstall #sig1 id образа SHA256 Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 Code from git beforeInstall install beforeSetup setup
IaC build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive Code from git beforeInstall install
beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive Code from git beforeInstall install
beforeSetup setup IaC build #sig2 Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall git archive from git beforeInstall install beforeSetup setup
IaC build #sig1 Code #sig2 SHA256 Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 Code from git beforeInstall
install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 Code from
git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup #sig4
Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup setup
#sig5 #sig4 Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup setup
#sig5 #sig4 Code from git beforeInstall install beforeSetup setup IaC build image Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup setup
#sig5 #sig4 Code from git beforeInstall install beforeSetup setup IaC build image tag Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup setup
#sig5 #sig4 image tag Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup #sig4
setup #sig5 image tag Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup #sig4
setup #sig5 image tag Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup #sig4
setup #sig5 git patch #sig6 image tag Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup #sig4
setup #sig5 git patch #sig6 image tag Code from git beforeInstall install beforeSetup setup IaC build diff Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup #sig4
setup git patch image tag from git beforeInstall install beforeSetup setup IaC build SHA256 (diff) #sig5 #sig6 Code Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup #sig4
setup #sig5 git patch #sig6 image tag Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup #sig4
setup #sig5 git patch #sig6 image tag image tag Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
master beforeInstall #sig1 git archive #sig2 install #sig3 beforeSetup #sig4
setup #sig5 git patch #sig6 image tag image tag Стратегии тегирования git tag git commit + tag Content addressable -
beforeSetup #sig4 master setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 image tag image tag Стратегии тегирования git tag git commit + tag Content addressable -
beforeSetup #sig4 master setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 image tag image tag Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
beforeSetup #sig4 master setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 image tag image tag Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
beforeSetup #sig4 master setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 image tag image tag git patch #sig7 Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
beforeSetup #sig4 master setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 image tag image tag git patch #sig7 Code from git beforeInstall install beforeSetup setup IaC build diff Стратегии тегирования git tag git commit + tag Content addressable -
beforeSetup #sig4 master setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 image tag image tag git patch #sig7 beforeSetup #sig8 Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
beforeSetup #sig4 master setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 image tag image tag git patch #sig7 beforeSetup #sig8 setup #sig9 Code from git beforeInstall install beforeSetup setup IaC build Стратегии тегирования git tag git commit + tag Content addressable -
beforeSetup #sig4 master setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 image tag image tag git patch #sig7 beforeSetup #sig8 setup #sig9 Code from git beforeInstall install beforeSetup setup IaC build image tag Стратегии тегирования git tag git commit + tag Content addressable -
beforeSetup #sig4 master setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 image tag image tag git patch #sig7 beforeSetup #sig8 setup #sig9 image tag Стратегии тегирования git tag git commit + tag Content addressable -
beforeSetup #sig4 master setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 image tag image tag git patch #sig7 beforeSetup #sig8 setup #sig9 image tag Docker Registry Stages Storage Стратегии тегирования git tag git commit + tag Content addressable -
master image tag image tag image tag Docker Registry beforeSetup
#sig4 setup #sig5 git patch #sig6 beforeInstall #sig1 git archive #sig2 install #sig3 git patch #sig7 beforeSetup #sig8 setup #sig9 Stages Storage Стратегии тегирования git tag git commit + tag Content addressable -
master image tag image tag image tag Docker Registry beforeSetup
#sig4 setup #sig5 git patch #sig6 beforeInstall #sig1 git archive #sig2 install #sig3 git patch #sig7 beforeSetup #sig8 setup #sig9 Stages Storage Стратегии тегирования git tag git commit + tag Content addressable -
master beforeSetup #sig4 setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 git patch #sig7 beforeSetup #sig8 setup #sig9 Stages Storage image tag image tag image tag Docker Registry Стратегии тегирования git tag git commit + tag Content addressable -
master beforeSetup #sig4 setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 git patch #sig7 beforeSetup #sig8 setup #sig9 Stages Storage image tag image tag image tag Docker Registry Стратегии тегирования git tag git commit + tag Content addressable -
master beforeSetup #sig4 setup #sig5 git patch #sig6 beforeInstall #sig1
git archive #sig2 install #sig3 git patch #sig7 beforeSetup #sig8 setup #sig9 Stages Storage image tag image tag image tag Docker Registry Стратегии тегирования git tag git commit + tag Content addressable -
IaC run Kubernetes test Kubernetes production build Код IaC build
git image pull image pull deploy deploy Tests unit test test Docker-image Docker Registry publish -
IaC run Kubernetes test Kubernetes production build Код IaC build
git image pull image pull deploy deploy Tests unit test test Docker-image Docker Registry publish -
test build Код IaC build git image pull image pull
Tests unit test IaC run Docker-image Docker Registry Kubernetes test Kubernetes production deploy deploy rgstr.exm.pl/some/image/name:<tag> + annotations! publish -
IaC run Kubernetes test Kubernetes production build Код IaC build
git image pull image pull deploy deploy Tests unit test test Docker-image Docker Registry publish -
IaC run Kubernetes test Kubernetes production build Код IaC build
git image pull image pull deploy deploy Tests unit test test Docker-image Docker Registry publish №2: Очистка -
Docker Registry Repo v1.0 v1.1 v1.2 v2.0 v2.1 v3.1 layer
layer layer layer layer layer layer layer layer layer layer layer layer layer layer layer -
Docker Registry Repo v1.0 v1.1 v1.2 v2.0 v2.1 v3.1 layer
layer layer layer layer layer layer layer layer layer layer layer layer layer layer layer -
Docker Registry Repo v1.0 v1.1 v1.2 v2.0 v2.1 v3.1 layer
layer layer layer layer layer layer layer layer layer layer layer layer layer layer layer Удаление старых тегов -
#1 Git head теги: 0.1, 0.2, 1.0 бранчи: master develop
release-1.0 hotfix-xxx feature-yyy -
#1 Git head теги: 0.1, 0.2, 1.0 бранчи: master develop
release-1.0 hotfix-xxx feature-yyy -
#1 Git head теги: 0.1, 0.2, 1.0 бранчи: master develop
release-1.0 hotfix-xxx feature-yyy Production myimage: v1.0 Staging Preview myimage: #c18 myimage: #c25 -
Production myimage: v1.0 Staging Preview myimage: #c18 myimage: #c25 #1
Git head теги: 0.1, 0.2, 1.0 бранчи: master develop release-1.0 hotfix-xxx feature-yyy #2 Выкачено сейчас pod -
Production myimage: v1.0 Staging Preview myimage: #c18 myimage: #c25 #1
Git head теги: 0.1, 0.2, 1.0 бранчи: master develop release-1.0 hotfix-xxx feature-yyy #2 Выкачено сейчас #3 “Было” выкачено старые ReplicaSet’ы (deploy) helm-релизы pod -
#1 Git head теги: 0.1, 0.2, 1.0 бранчи: master develop
release-1.0 hotfix-xxx feature-yyy #2 Выкачено сейчас #3 “Было” выкачено старые ReplicaSet’ы (deploy) helm-релизы pod whitelist -
beforeSetup #sig4 setup #sig5 git patch #sig6 beforeInstall #sig1 git
archive #sig2 install #sig3 image tag image tag git patch #sig7 beforeSetup #sig8 setup #sig9 image tag Docker Registry Stages Storage -
beforeSetup #sig4 setup #sig5 git patch #sig6 beforeInstall #sig1 git
archive #sig2 install #sig3 git patch #sig7 beforeSetup #sig8 setup #sig9 Stages Storage image tag image tag image tag Docker Registry -
beforeSetup #sig4 setup #sig5 git patch #sig6 beforeInstall #sig1 git
archive #sig2 install #sig3 git patch #sig7 beforeSetup #sig8 setup #sig9 Stages Storage image tag image tag image tag Docker Registry whitelist -
beforeSetup #sig4 setup #sig5 git patch #sig6 beforeInstall #sig1 git
archive #sig2 install #sig3 git patch #sig7 beforeSetup #sig8 setup #sig9 Stages Storage image tag image tag image tag Docker Registry whitelist -
beforeSetup #sig4 setup #sig5 git patch #sig6 beforeInstall #sig1 git
archive #sig2 install #sig3 git patch #sig7 beforeSetup #sig8 setup #sig9 Stages Storage image tag Docker Registry -
beforeSetup #sig4 setup #sig5 git patch #sig6 beforeInstall #sig1 git
archive #sig2 install #sig3 git patch #sig7 beforeSetup #sig8 setup #sig9 Stages Storage image tag Docker Registry -
beforeInstall #sig1 git archive #sig2 install #sig3 git patch #sig7
beforeSetup #sig8 setup #sig9 Stages Storage image tag Docker Registry beforeSetup #sig4 setup #sig5 git patch #sig6 сироты -
beforeInstall #sig1 git archive #sig2 install #sig3 git patch #sig7
beforeSetup #sig8 setup #sig9 Stages Storage image tag Docker Registry beforeSetup #sig4 setup #sig5 git patch #sig6 сироты -
beforeInstall #sig1 git archive #sig2 install #sig3 git patch #sig7
beforeSetup #sig8 setup #sig9 Stages Storage image tag Docker Registry -
IaC run Kubernetes test Kubernetes production build Код IaC build
git image pull image pull deploy deploy Tests unit test test Docker-image Docker Registry publish -
test IaC run Docker-image Docker Registry build publish Код IaC
build git image pull image pull Tests unit test deploy deploy Kubernetes production Kubernetes test -
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels:
app: nginx minReadySeconds: 5 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 -
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels:
app: nginx minReadySeconds: 5 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: 2019-05-25T14:54:22Z generation: 1 name: nginx-deployment namespace: default resourceVersion: "248221274" selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/nginx-deployment uid: fb75f366-7efc-11e9-ac27-52540035a73b spec: minReadySeconds: 5 progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: app: nginx strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate template: metadata: creationTimestamp: null labels: app: nginx spec: containers: - image: nginx:1.7.9 imagePullPolicy: IfNotPresent name: nginx ports: - containerPort: 80 protocol: TCP resources: {} terminationMessagePath: /dev/termination-log dnsPolicy: ClusterFirst restartPolicy: Always securityContext: {} terminationGracePeriodSeconds: 30 status: conditions: [ ... ] observedGeneration: 1 readyReplicas: 1 replicas: 1 unavailableReplicas: 1 updatedReplicas: 1 -
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels:
app: nginx minReadySeconds: 5 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: 2019-05-25T14:54:22Z generation: 1 name: nginx-deployment namespace: default resourceVersion: "248221274" selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/nginx-deployment uid: fb75f366-7efc-11e9-ac27-52540035a73b spec: minReadySeconds: 5 progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: app: nginx strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate template: metadata: creationTimestamp: null labels: app: nginx spec: containers: - image: nginx:1.7.9 imagePullPolicy: IfNotPresent name: nginx ports: - containerPort: 80 protocol: TCP resources: {} terminationMessagePath: /dev/termination-log dnsPolicy: ClusterFirst restartPolicy: Always securityContext: {} terminationGracePeriodSeconds: 30 status: conditions: [ ... ] observedGeneration: 1 readyReplicas: 1 replicas: 1 unavailableReplicas: 1 updatedReplicas: 1 Идентификаторы 1. -
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels:
app: nginx minReadySeconds: 5 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: 2019-05-25T14:54:22Z generation: 1 name: nginx-deployment namespace: default resourceVersion: "248221274" selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/nginx-deployment uid: fb75f366-7efc-11e9-ac27-52540035a73b spec: minReadySeconds: 5 progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: app: nginx strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate template: metadata: creationTimestamp: null labels: app: nginx spec: containers: - image: nginx:1.7.9 imagePullPolicy: IfNotPresent name: nginx ports: - containerPort: 80 protocol: TCP resources: {} terminationMessagePath: /dev/termination-log dnsPolicy: ClusterFirst restartPolicy: Always securityContext: {} terminationGracePeriodSeconds: 30 status: conditions: [ ... ] observedGeneration: 1 readyReplicas: 1 replicas: 1 unavailableReplicas: 1 updatedReplicas: 1 Идентификаторы 1. Служебная информация 2. -
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels:
app: nginx minReadySeconds: 5 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: 2019-05-25T14:54:22Z generation: 1 name: nginx-deployment namespace: default resourceVersion: "248221274" selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/nginx-deployment uid: fb75f366-7efc-11e9-ac27-52540035a73b spec: minReadySeconds: 5 progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: app: nginx strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate template: metadata: creationTimestamp: null labels: app: nginx spec: containers: - image: nginx:1.7.9 imagePullPolicy: IfNotPresent name: nginx ports: - containerPort: 80 protocol: TCP resources: {} terminationMessagePath: /dev/termination-log dnsPolicy: ClusterFirst restartPolicy: Always securityContext: {} terminationGracePeriodSeconds: 30 status: conditions: [ ... ] observedGeneration: 1 readyReplicas: 1 replicas: 1 unavailableReplicas: 1 updatedReplicas: 1 Идентификаторы 1. Служебная информация 2. Значения по-умолчанию 3. -
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels:
app: nginx minReadySeconds: 5 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: 2019-05-25T14:54:22Z generation: 1 name: nginx-deployment namespace: default resourceVersion: "248221274" selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/nginx-deployment uid: fb75f366-7efc-11e9-ac27-52540035a73b spec: minReadySeconds: 5 progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: app: nginx strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate template: metadata: creationTimestamp: null labels: app: nginx spec: containers: - image: nginx:1.7.9 imagePullPolicy: IfNotPresent name: nginx ports: - containerPort: 80 protocol: TCP resources: {} terminationMessagePath: /dev/termination-log dnsPolicy: ClusterFirst restartPolicy: Always securityContext: {} terminationGracePeriodSeconds: 30 status: conditions: [ ... ] observedGeneration: 1 readyReplicas: 1 replicas: 1 unavailableReplicas: 1 updatedReplicas: 1 Идентификаторы 1. Служебная информация 2. Значения по-умолчанию 3. Статус 4. -
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels:
app: nginx minReadySeconds: 5 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: 2019-05-25T14:54:22Z generation: 1 name: nginx-deployment namespace: default resourceVersion: "248221274" selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/nginx-deployment uid: fb75f366-7efc-11e9-ac27-52540035a73b spec: minReadySeconds: 5 progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: app: nginx strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate template: metadata: creationTimestamp: null labels: app: nginx spec: containers: - image: nginx:1.7.9 imagePullPolicy: IfNotPresent name: nginx ports: - containerPort: 80 protocol: TCP resources: {} terminationMessagePath: /dev/termination-log dnsPolicy: ClusterFirst restartPolicy: Always securityContext: {} terminationGracePeriodSeconds: 30 status: conditions: [ ... ] observedGeneration: 1 readyReplicas: 1 replicas: 1 unavailableReplicas: 1 updatedReplicas: 1 Идентификаторы 1. Служебная информация 2. Значения по-умолчанию 3. Статус 4. Admission webhook 5. -
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels:
app: nginx minReadySeconds: 5 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: 2019-05-25T14:54:22Z generation: 1 name: nginx-deployment namespace: default resourceVersion: "248221274" selfLink: /apis/extensions/v1beta1/namespaces/default/deployments/nginx-deployment uid: fb75f366-7efc-11e9-ac27-52540035a73b spec: minReadySeconds: 5 progressDeadlineSeconds: 600 replicas: 1 revisionHistoryLimit: 10 selector: matchLabels: app: nginx strategy: rollingUpdate: maxSurge: 25% maxUnavailable: 25% type: RollingUpdate template: metadata: creationTimestamp: null labels: app: nginx spec: containers: - image: nginx:1.7.9 imagePullPolicy: IfNotPresent name: nginx ports: - containerPort: 80 protocol: TCP resources: {} terminationMessagePath: /dev/termination-log dnsPolicy: ClusterFirst restartPolicy: Always securityContext: {} terminationGracePeriodSeconds: 30 status: conditions: [ ... ] observedGeneration: 1 readyReplicas: 1 replicas: 1 unavailableReplicas: 1 updatedReplicas: 1 Идентификаторы 1. Служебная информация 2. Значения по-умолчанию 3. Статус 4. Admission webhook 5. Контроллеры всех видов и планировщик 6. -
last-applied new live last-applied new live 1. Diff 2. Patch
2-way merge 3-way merge -
last-applied new live 1. Что удалено? last-applied new live 1.
Diff 2. Patch 2-way merge 3-way merge -
last-applied new live 2. Что добавлено или изменено? 1. Что
удалено? last-applied new live 1. Diff 2. Patch 2-way merge 3-way merge -
last-applied new live 2. Что добавлено или изменено? 1. Что
удалено? 3. Patch last-applied new live 1. Diff 2. Patch 2-way merge 3-way merge -
last-applied new live 2. Что добавлено или изменено? 1. Что
удалено? 3. Patch last-applied new live 1. Diff 2. Patch 2-way merge 3-way merge -
2-way merge 3-way merge Декларативный подход не так прост! Но
без него всё сильно хуже. -
CI event YAML or JSON templates start job deploy Template
Engine Jsonnet ... > sed > envsubst Helm -
CI event YAML or JSON templates start job deploy Template
Engine images info -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration apply Kubernetes API -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration apply > kubectl apply > helm Kubernetes API ... -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration apply Kubernetes API N-way merge magic -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration apply Kubernetes API okay N-way merge magic -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration apply Kubernetes API okay okay N-way merge magic -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration apply Kubernetes API okay okay okay N-way merge magic -
CI event YAML or JSON templates start job deploy Template
Engine images info Rendered Configuration apply Kubernetes API okay okay okay N-way merge magic Применено != Выкачено -
Rendered Configuration apply Frontend Backend MongoDB N-way merge magic :v0.8.14
-> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply Frontend Backend MongoDB N-way merge magic :v0.8.14
-> 0.8.15 :v0.8.14 -> 0.8.15 okay -
Rendered Configuration apply okay okay Frontend Backend MongoDB N-way merge
magic :v0.8.14 -> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :v0.8.14 -> 0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :0.8.15 -
Rendered Configuration apply okay okay okay Frontend Backend MongoDB N-way
merge magic :v0.8.14 -> 0.8.15 :0.8.15 Пуля вылетела, проблемы на вашей стороне! -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration Kubernetes API -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration Tracker Kubernetes API events logs -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration Tracker Kubernetes API events logs -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration Tracker Kubernetes API events logs apply N-way merge magic -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration Tracker Kubernetes API events logs fail apply N-way merge magic fail fail -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration Tracker Kubernetes API events logs apply N-way merge magic okay -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration Tracker Kubernetes API events logs apply N-way merge magic okay okay -
CI event YAML or JSON templates start job deploy Template
Engine Rendered Configuration Tracker Kubernetes API events logs apply okay -
okay apply CI event YAML or JSON templates start job
deploy Template Engine Rendered Configuration Tracker Kubernetes API events logs okay okay -
okay apply CI event YAML or JSON templates start job
deploy Template Engine Rendered Configuration Tracker Kubernetes API events logs okay okay 108 github.com/flant/kubedog kubedog Go library for “state tracking” simple CLI + -
events logs Frontend Backend MongoDB metadata: ... annotations: werf.io/fail-mode: IgnoreAndContinueDeployProcess
FailWholeDeployProcessImmediately HopeUntilEndOfDeployProcess Deployment/StatefullSet YAML -
events logs metadata: ... annotations: werf.io/fail-mode: IgnoreAndContinueDeployProcess FailWholeDeployProcessImmediately HopeUntilEndOfDeployProcess werf.io/failures-allowed-per-relplica:
3 Frontend Backend MongoDB Deployment/StatefullSet YAML -
events logs metadata: ... annotations: werf.io/fail-mode: IgnoreAndContinueDeployProcess FailWholeDeployProcessImmediately HopeUntilEndOfDeployProcess werf.io/failures-allowed-per-relplica:
3 werf.io/show-logs-until: PodIsReady ControllerIsReady EndOfDeploy Frontend Backend MongoDB Deployment/StatefullSet YAML -
Надежная декларативность 1. А что мы вообще хотим? Реальный статус
2. Логи (только полезные) 3. -
Надежная декларативность 1. А что мы вообще хотим? Реальный статус
2. Логи (только полезные) 3. Прогресс 4. -
Надежная декларативность 1. А что мы вообще хотим? Реальный статус
2. Логи (только полезные) 3. Прогресс 4. Автоматический откат 5. -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests unit test test -
IaC run Docker Registry Kubernetes test Kubernetes production publish git
image pull image pull deploy deploy Tests unit test test Docker-image Код IaC build build -
IaC run Kubernetes test Kubernetes production build Код IaC build
git image pull image pull deploy deploy Tests unit test test Docker-image Docker Registry publish -
test IaC run Docker-image Docker Registry build publish Код IaC
build git image pull image pull Tests unit test deploy deploy Kubernetes production Kubernetes test -
IaC run Docker-image Docker Registry Kubernetes test Kubernetes production build
publish Код IaC build git image pull image pull deploy deploy Tests unit test test -
Попробуйте werf.io Automagic Helm Tiller kubedog client-go single binary go-containerregistry
сделано с во Фланте Оцените v1.0.1-beta.8 784 Дайте фидбек Присоединяйтесь -
Всё сложнее, чем кажется с первого взгляда. Дьявол кроется в
деталях! Любой софт – сырое и глючное говно... пока им не начнут пользоваться. -
Всё сложнее, чем кажется с первого взгляда. Дьявол кроется в
деталях! Любой софт – сырое и глючное говно... пока им не начнут пользоваться. Давайте вместе добьем эту тему! И пойдем дальше, решать другие вопросы! -
Спасибо! Дмитрий Столяров dmitry.stolyarov@flant.com Тимофей Кириллов timofey.kirillov@flant.com Алексей Игрычев alexey.igrychev@flant.com
Иван Михейкин ivan.mikheykin@flant.com Наш блог на Хабре habr.com/company/flant Наш YouTube-канал youtube.com/c/Флант github.com/flant/werf 784 werf.io