Alfred Sabitzer - K8s Applications mit MicroK8S auf Raspberry PI

Здесь есть возможность читать онлайн «Alfred Sabitzer - K8s Applications mit MicroK8S auf Raspberry PI» — ознакомительный отрывок электронной книги совершенно бесплатно, а после прочтения отрывка купить полную версию. В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Жанр: unrecognised, на немецком языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

K8s Applications mit MicroK8S auf Raspberry PI: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «K8s Applications mit MicroK8S auf Raspberry PI»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

Beispiele für das Entwickeln und Betreiben von Anwendungen auf einem MicroK8s Kubernetes Cluster auf Raspberry PI Basis. Es werden die folgenden Elemente beschrieben
Infrastrukturservices
◦ Repository
◦ NTP
◦ LDAP
◦ Secretmanagement
Monitoringservices
◦ Prometheus
◦ Grafana
◦ Alert-Agent
Storage und Backup
◦ Longhorn
◦ Externe Storage
Webservice – Stateful
◦ Joomla
◦ PostgresDB
Gitlab
◦ Build-Pipelines
◦ GitRunner
Buildautomatisierung
◦ Eigene einfache Buildpipeline
◦ kpt
◦ kustomize
Servicemesh Linkerd
Alle Services werden als yaml-File beschrieben.

K8s Applications mit MicroK8S auf Raspberry PI — читать онлайн ознакомительный отрывок

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «K8s Applications mit MicroK8S auf Raspberry PI», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

#!/bin/bash

############################################################################################

# $Date: 2021-12-18 11:38:15 +0100 (Sa, 18. Dez 2021) $

# $Revision: 1618 $

# $Author: alfred $

# $HeadURL: https://monitoring.slainte.at/svn/slainte/trunk/k8s/dev/make.sh $

# $Id: make.sh 1618 2021-12-18 10:38:15Z alfred $

#

# Bauen und deployen

#

############################################################################################

#shopt -o -s errexit #—Terminates the shell script if a command returns an error code.

shopt -o -s xtrace #—Displays each command before it’s executed.

shopt -s expand_aliases # Benutzen von aliasen im Skript

shopt -o -s nounset #-No Variables without definition

namespace="default"

docker_registry="docker.registry:5000"

#equivalent zu source

. ./env.sh

datum=(`date '+%Y%m%d'`)

revision=(`date '+%H%M%S'`)

#revision=$(svn info | grep "Revision" | awk '{print $2}')

tag="${datum}-${revision}"

echo ${tag} > ${image}.tag # Sicherstellen eines stabilen Image-tags

# Aktualisieren der Sourcen

. ${HOME}/.bash_aliases

doDocker=${BASH_ALIASES[mkd]}

doYaml=${BASH_ALIASES[mky]}

${doDocker}

${doYaml}

#

Diese Datei ruft das Shell-Skript zum Bauen des Dockerfiles und zum Erzeugen der Yamls auf. Es erzeugt auch die "Tag-Datei". Dieser Wert wird von den beiden anderen Skripts verwendet (und garantiert einen stabilen Tag, wenn man nur die Yamls neu bauen möchte).

#!/bin/bash

############################################################################################

# $Date: 2021-12-18 11:38:15 +0100 (Sa, 18. Dez 2021) $

# $Revision: 1618 $

# $Author: alfred $

# $HeadURL: https://monitoring.slainte.at/svn/slainte/trunk/k8s/dev/make_docker.sh $

# $Id: make_docker.sh 1618 2021-12-18 10:38:15Z alfred $

#

# Bauen und deployen

#

############################################################################################

#shopt -o -s errexit #—Terminates the shell script if a command returns an error code.

shopt -o -s xtrace #—Displays each command before it’s executed.

shopt -o -s nounset #-No Variables without definition

namespace="default"

docker_registry="docker.registry:5000"

#equivalent zu source

. ./env.sh

datum=(`date '+%Y%m%d'`)

revision=(`date '+%H%M%S'`)

#revision=$(svn info | grep "Revision" | awk '{print $2}')

tag=$(cat ${image}.tag)

# Aktualisieren der Sourcen

svn update

# Docker bauen und in das remote Repo pushen

docker build --no-cache --force-rm . -t ${docker_registry}/${image}:${tag}

docker push ${docker_registry}/${image}:${tag}

docker build --force-rm . -t ${docker_registry}/${image}:latest

docker push ${docker_registry}/${image}:latest

curl ${docker_registry}/v2/${image}/tags/list

#

Diese Datei baut das Docker-Image (einmal mit dem Tag und einmal mit "latest") und pusht das in das Repository.

#!/bin/bash

############################################################################################

# $Date: 2021-12-18 11:38:15 +0100 (Sa, 18. Dez 2021) $

# $Revision: 1618 $

# $Author: alfred $

# $HeadURL: https://monitoring.slainte.at/svn/slainte/trunk/k8s/dev/make_yaml.sh $

# $Id: make_yaml.sh 1618 2021-12-18 10:38:15Z alfred $

#

# Bauen und deployen

#

############################################################################################

#shopt -o -s errexit #—Terminates the shell script if a command returns an error code.

shopt -o -s xtrace #—Displays each command before it’s executed.

shopt -o -s nounset #-No Variables without definition

namespace="default"

docker_registry="docker.registry:5000"

#equivalent zu source

. ./env.sh

datum=(`date '+%Y%m%d'`)

revision=(`date '+%H%M%S'`)

#revision=$(svn info | grep "Revision" | awk '{print $2}')

tag=$(cat ${image}.tag)

# Aktualisieren der Sourcen

svn update

# yaml updaten

for val in ${namespace}; do

echo "Namespace: ${val} "

#Namespacespezifisch

. ../namespace/${val}_env.sh

cat ${image}*.yaml > /tmp/${image}.tmp_1

sed 's/\${image}/'"${image}"'/g' /tmp/${image}.tmp_1 > /tmp/${image}.tmp_2

sed 's/\${tag}/'"${tag}"'/g' /tmp/${image}.tmp_2 > /tmp/${image}.tmp_3

sed 's/\${secretName}/'"${secretName}"'/g' /tmp/${image}.tmp_3 > /tmp/${image}.tmp_4

sed 's/\${host}/'"${host}"'/g' /tmp/${image}.tmp_4 > /tmp/${image}.tmp_5

sed 's/\${namespace}/'"${val}"'/g' /tmp/${image}.tmp_5 > /tmp/${image}.tmp_6

sed 's/\${namespace_comment}/'"${namespace_comment}"'/g' /tmp/${image}.tmp_6 > /tmp/${image}.tmp_7

sed 's/\${cluster_issuer}/'"${cluster_issuer}"'/g' /tmp/${image}.tmp_7 > /tmp/${image}.tmp_8

sed 's/\${docker_registry}/'"${docker_registry}"'/g' /tmp/${image}.tmp_8 > /tmp/${image}.yaml

#

# Nun kann das yaml verwendet werden

#

ansible pc1 -m copy -a "src="/tmp/${image}.yaml" dest=./yaml/"${image}_${val}.yaml

# Installieren

ansible pc1 -m shell -a "microk8s kubectl apply -f ./yaml/"${image}_${val}.yaml" --namespace="${val}

done

rm -f /tmp/${image}*.*

#

Dieses Skript baut die yamls (und ersetzt alle Variablen) und deployed das in den Kubernetes-Cluster.

Das make_configmap_dir.sh (kommt dann aus dem svn) hilft beim Erstellen einer configmap basierend auf einem vorhandenen Verzeichnis. Das hilft um Tippfehler, Einrückungsfehler udglm. zu vermeiden.

#!/bin/bash

############################################################################################

# $Date: 2021-12-01 22:31:06 +0100 (Mi, 01. Dez 2021) $

# $Revision: 1457 $

# $Author: alfred $

# $HeadURL: https://monitoring.slainte.at/svn/slainte/trunk/k8s/dev/make_configmap_dir.sh $

# $Id: make_configmap_dir.sh 1457 2021-12-01 21:31:06Z alfred $

#

# Erzeugen einer configmap aus einem Verzeichnis

#

############################################################################################

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «K8s Applications mit MicroK8S auf Raspberry PI»

Представляем Вашему вниманию похожие книги на «K8s Applications mit MicroK8S auf Raspberry PI» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «K8s Applications mit MicroK8S auf Raspberry PI»

Обсуждение, отзывы о книге «K8s Applications mit MicroK8S auf Raspberry PI» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x