diff --git a/04_k8s/cm/#slides.org# b/04_k8s/cm/#slides.org# new file mode 100644 index 0000000..d7310ab --- /dev/null +++ b/04_k8s/cm/#slides.org# @@ -0,0 +1,247 @@ +#+TITLE: Cours de virtualisation avancée: /Kubernetes/, suite +#+OPTIONS: toc:nil date:nil author:nil reveal_single_file:t timestamp:nil +#+LATEX_CLASS: article +#+LATEX_CLASS_OPTIONS: [12pt,a4paper] +#+LATEX_HEADER: \usepackage[a4paper,margin=0.5in]{geometry} +#+LATEX_HEADER: \usepackage[utf8]{inputenc} +#+LATEX_HEADER: \usepackage[inkscapelatex=false]{svg} +#+LATEX_HEADER: \usepackage[sfdefault]{AlegreyaSans} +#+LATEX_HEADER: \usepackage{multicol} +#+LATEX_HEADER: \usepackage{minted} +#+LATEX_HEADER: \usepackage{float} +#+LATEX_HEADER: \usepackage{tikz} +#+LATEX_HEADER: \usetikzlibrary{positioning} +#+LATEX_HEADER: \renewcommand\listingscaption{Exemple de code} + +#+REVEAL_THEME: white +#+REVEAL_INIT_OPTIONS: slideNumber:true +#+REVEAL_EXTRA_CSS: ../../common/reveal_custom.css + +* Déploiement +** /Rolling Updates/ +Permet des mises à jour d'images sans temps de coupure +#+BEGIN_SRC yaml +--- +... +spec: + ... + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 0 + ... +#+END_SRC + +#+REVEAL: split + +- =maxUnavailable=: défini le nombre maximal de /replicas/ indisponibles +- =maxSurge=: défini le nombre maximal de /replicas/ à mettre à jour en même temps + +#+REVEAL: split + +Ensuite, mettre à jour l'image avec: +#+BEGIN_SRC bash +kubectl set image deployment/ = +#+END_SRC + +*But*: +- Mettre à jour l'application sans /downtime/ + +** Déploiement /blue / green/ +[[file:./images/blue_green.svg]] + +#+REVEAL: split + +- On déploie la nouvelle version en parallèle de l'ancienne +- Une fois que tout est déployé on redirige le trafic vers le nouveau déploiement + +*But*: +- Tester le déploiement de la nouvelle version avant de la basculer en prod + +** Déploiement /canary/ +[[file:./images/canary.svg]] + +#+REVEAL: split + +- On déploie la nouvelle version en parallèle de l'ancienne *avec moins de /replicas/* +- Automatiquement une petite partie des clients tomberont sur la nouvelle version + +*But*: +- Faire tester à quelques utilisat(eur|rice)s aléatoires la nouvelle version + +* Mise à l'échelle (/scaling/) + +- Nécessaire quand la charge augmente +- Par exemple pour suivre l'augmentation du trafic de notre application + +** Verticale (/vertical scaling/) +*** Fonctionnement +- On augmente la puissance des nœuds +- Augmente les capacité de l'application existante +- L'application *n'a pas besoin d’être capable de gérer la réplication* + +*** Inconvénients +- Augmentation des coûts +- Coûts pas toujours proportionnels à la puissance des nœuds +- Si nœud déjà au max: comment faire ? + +** Horizontale (/horizontal scaling/) +*** Fonctionnement +- On ajoute des nœuds (et donc des nouvelles instances) à l'infra +- La charge de travail est donc répartie entre les instances +- L'application *a besoin d’être capable de gérer la réplication* + +*** Inconvénients +- Augmentation des coûts +- On peut se retrouver avec beaucoup de nœuds + +** /Horizontal scaling/ dans /K8S/ +[[https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/][doc]] +[[https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/][doc]] + +#+BEGIN_SRC bash +kubectl autoscale deployment \ + --cpu-percent=50 --min=1 --max=10 +#+END_SRC + +#+REVEAL: split + +Demande au /cluster/ de créer entre =min= et =max= /replicas/ selon la charge du /CPU/ du nœud + +** /Vertical scaling/ dans /K8S/ +Compliqué à mettre en place sur sa propre infra étant donné qu'il faut changer les ressources des machines. + +* Réseau +** /Service Mesh/ + +** /Ingress/ +[[https://kubernetes.io/fr/docs/concepts/services-networking/ingress/][doc]] +[[https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/][doc]] + +- Permet d'exposer nos services en dehors du /cluster/ +- Assez similaire à un /reverse proxy/ comme vous aviez déjà vu avec /Nginx/ + +- Nécessite des ressources configurées par les administrateur.rice.s du /cluster/ + +#+REVEAL: split + +#+BEGIN_SRC yaml +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: test-ingress +spec: + defaultBackend: + service: + name: testsvc + port: + number: 80 +#+END_SRC + +#+REVEAL: nginx + +#+BEGIN_SRC bash +❯ kubectl get ingress test-ingress +NAME HOSTS ADDRESS PORTS AGE +test-ingress * 107.178.254.228 80 59s +#+END_SRC + +#+REVEAL: split + +- Peut aussi servir de *routeur /HTTP/* en dirigeant le trafic des routes vers différents services + +#+REVEAL: split + +#+BEGIN_SRC yaml +... + - host: foo.bar.com + http: + paths: + - path: /foo + pathType: Prefix + backend: + service: + name: service1 + port: + number: 4200 + - path: /bar + pathType: Prefix + backend: + service: + name: service2 + port: + number: 8080 +#+END_SRC + +* Sécurité et gestion d'utilisat(eur|rice)s +** Contrôle d'accès basé sur les rôles (/RBAC/) +[[https://kubernetes.io/fr/docs/reference/access-authn-authz/rbac/][doc]] + +- Permet de réguler l'accès aux ressources en fonction de *rôles* attribués aux *utilisat(eur|rice)s* + +*** /Role/ et /ClusterRole/ + +Pour créer les rôles (au sens large) + +#+BEGIN_SRC yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + namespace: default + name: pod-reader +rules: +- apiGroups: [""] # "" indicates the core API group + resources: ["pods"] + verbs: ["get", "watch", "list"] +#+END_SRC + +#+REVEAL: split + +- Ce rôle permet de définir un accès en *lecture seule* aux */pods/* de l'espace de noms */default/* +- Le type /Role/ concerne *toujours* l'espace de noms dans lequel il est créé + +#+REVEAL: split + +#+BEGIN_SRC yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + # pas de "namespace" + name: pod-reader +rules: +- apiGroups: [""] + resources: ["pods"] + verbs: ["get", "watch", "list"] +#+END_SRC + +#+REVEAL: split + +- Ce rôle permet de définir un accès en *lecture seule* aux */pods/* dans *n'importe quel* espace de noms + +*** /RoleBinding/ et /ClusterRoleBinding/ + +Pour accorder les rôles (au sens large) à un.e ou des utilisateur.rice.s, ou un groupe + +#+BEGIN_SRC yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: read-pods + namespace: default +subjects: +- kind: User + name: jane # sensible à la casse + apiGroup: rbac.authorization.k8s.io +roleRef: + kind: Role + name: pod-reader + apiGroup: rbac.authorization.k8s.io +#+END_SRC + + + + +* Aller plus loin +- https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/ +- https://kubernetes.io/fr/docs/concepts/services-networking/ingress/ +- https://kubernetes.io/fr/docs/reference/access-authn-authz/rbac/ diff --git a/04_k8s/cm/_minted-slides/10F2284F6B5E62401E38A35552CD4436259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/10F2284F6B5E62401E38A35552CD4436259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..202a8f8 --- /dev/null +++ b/04_k8s/cm/_minted-slides/10F2284F6B5E62401E38A35552CD4436259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,4 @@ +\begin{Verbatim}[commandchars=\\\{\}] +❯\PYG{+w}{ }kubectl\PYG{+w}{ }delete\PYG{+w}{ }pods\PYG{+w}{ }profiles\PYGZhy{}app +pod\PYG{+w}{ }\PYG{l+s+s2}{\PYGZdq{}profiles\PYGZhy{}app\PYGZdq{}}\PYG{+w}{ }deleted +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/200B3059DF039552E62102C409DC2E1C042358596A3E558A58FD34C899B12E5C.pygtex b/04_k8s/cm/_minted-slides/200B3059DF039552E62102C409DC2E1C042358596A3E558A58FD34C899B12E5C.pygtex new file mode 100644 index 0000000..3bee5ab --- /dev/null +++ b/04_k8s/cm/_minted-slides/200B3059DF039552E62102C409DC2E1C042358596A3E558A58FD34C899B12E5C.pygtex @@ -0,0 +1,8 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{k}{FROM}\PYG{+w}{ }\PYG{l+s}{debian}\PYG{+w}{ }\PYG{k}{as}\PYG{+w}{ }\PYG{l+s}{builder} +\PYG{k}{RUN}\PYG{+w}{ }apt\PYG{+w}{ }install\PYG{+w}{ }\PYGZhy{}y\PYG{+w}{ }nodejs\PYG{+w}{ }npm +\PYG{k}{RUN}\PYG{+w}{ }npm\PYG{+w}{ }install\PYG{+w}{ }\PYG{o}{\PYGZam{}\PYGZam{}}\PYG{+w}{ }npm\PYG{+w}{ }run\PYG{+w}{ }build + +\PYG{k}{FROM}\PYG{+w}{ }\PYG{l+s}{nginx} +\PYG{k}{COPY}\PYG{+w}{ }\PYGZhy{}\PYGZhy{}from\PYG{o}{=}builder\PYG{+w}{ }/app/dist/html\PYG{+w}{ }/var/www/html +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/22CF4B6A6FC51B005C4D9ED9EE10024B3E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/22CF4B6A6FC51B005C4D9ED9EE10024B3E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..0e0f1fd --- /dev/null +++ b/04_k8s/cm/_minted-slides/22CF4B6A6FC51B005C4D9ED9EE10024B3E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,16 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nt}{apiVersion}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{v1} +\PYG{n+nt}{kind}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{Pod} +\PYG{n+nt}{metadata}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{my\PYGZhy{}app} +\PYG{n+nt}{spec}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{containers}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{test\PYGZhy{}container} +\PYG{+w}{ }\PYG{n+nt}{image}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{my\PYGZhy{}image} +\PYG{+w}{ }\PYG{n+nt}{env}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{DATABASE\PYGZus{}URI} +\PYG{+w}{ }\PYG{n+nt}{valueFrom}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{configMapKeyRef}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{my\PYGZhy{}app\PYGZhy{}config} +\PYG{+w}{ }\PYG{n+nt}{key}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{database\PYGZus{}uri} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/2B42E576A8E33833F924885DA50A0A273E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/2B42E576A8E33833F924885DA50A0A273E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..793154e --- /dev/null +++ b/04_k8s/cm/_minted-slides/2B42E576A8E33833F924885DA50A0A273E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,15 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nn}{\PYGZhy{}\PYGZhy{}\PYGZhy{}} +\PYG{n+nt}{apiVersion}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{v1} +\PYG{n+nt}{kind}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{Pod}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} ici le type est \PYGZdq{}pod\PYGZdq{}} +\PYG{n+nt}{metadata}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{namespace}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{profiles\PYGZhy{}app\PYGZhy{}ns}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} on choisi le namespace} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{profiles\PYGZhy{}app}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} le nom du pod} +\PYG{n+nt}{spec}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} puis ses spécifications} +\PYG{+w}{ }\PYG{n+nt}{containers}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} il contient des conteneurs} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{database}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} nom du conteneur} +\PYG{+w}{ }\PYG{n+nt}{image}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{image:latest}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} l\PYGZsq{}image à utiliser} +\PYG{+w}{ }\PYG{n+nt}{env}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} variables d\PYGZsq{}environnement} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{COULEUR}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} avec un nom} +\PYG{+w}{ }\PYG{n+nt}{value}\PYG{p}{:}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}rouge\PYGZdq{}}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} et une valeur} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/2C68B78EBFC191619562710D9C621553259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/2C68B78EBFC191619562710D9C621553259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..73f8573 --- /dev/null +++ b/04_k8s/cm/_minted-slides/2C68B78EBFC191619562710D9C621553259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,5 @@ +\begin{Verbatim}[commandchars=\\\{\}] +❯\PYG{+w}{ }kubectl\PYG{+w}{ }get\PYG{+w}{ }pv\PYG{+w}{ }pv\PYGZhy{}volume +NAME\PYG{+w}{ }CAPACITY\PYG{+w}{ }ACCESSMODES\PYG{+w}{ }...\PYG{+w}{ }STATUS\PYG{+w}{ }STORAGECLASS +pv\PYGZhy{}volume\PYG{+w}{ }10Gi\PYG{+w}{ }RWO\PYG{+w}{ }...\PYG{+w}{ }Available\PYG{+w}{ }manual +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/4A9616C88E3CAEB3FADE78AC53A6EE1B259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/4A9616C88E3CAEB3FADE78AC53A6EE1B259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..36cca36 --- /dev/null +++ b/04_k8s/cm/_minted-slides/4A9616C88E3CAEB3FADE78AC53A6EE1B259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +kubectl\PYG{+w}{ }apply\PYG{+w}{ }\PYGZhy{}f\PYG{+w}{ }\PYGZlt{}fichier.yaml\PYGZgt{} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/4AC1A759FA80CAA2F3AED6AA93BCA714259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/4AC1A759FA80CAA2F3AED6AA93BCA714259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..1fdc475 --- /dev/null +++ b/04_k8s/cm/_minted-slides/4AC1A759FA80CAA2F3AED6AA93BCA714259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,6 @@ +\begin{Verbatim}[commandchars=\\\{\}] +❯\PYG{+w}{ }kubectl\PYG{+w}{ }get\PYG{+w}{ }pvc\PYG{+w}{ }app\PYGZhy{}pv\PYGZhy{}claim +NAME\PYG{+w}{ }STATUS\PYG{+w}{ }VOLUME\PYG{+w}{ }CAPACITY\PYG{+w}{ }ACCESSMODES\PYG{+w}{ }STORAGECLASS\PYG{+w}{ }AGE +app\PYGZhy{}pv\PYGZhy{}claim\PYG{+w}{ }Bound\PYG{+w}{ }pv\PYGZhy{}volume\PYG{+w}{ }10Gi\PYG{+w}{ }RWO\PYG{+w}{ }manual\PYG{+w}{ }30s + +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/4E8AA78541DE801D893BFABE6392D54A042358596A3E558A58FD34C899B12E5C.pygtex b/04_k8s/cm/_minted-slides/4E8AA78541DE801D893BFABE6392D54A042358596A3E558A58FD34C899B12E5C.pygtex new file mode 100644 index 0000000..481ed4c --- /dev/null +++ b/04_k8s/cm/_minted-slides/4E8AA78541DE801D893BFABE6392D54A042358596A3E558A58FD34C899B12E5C.pygtex @@ -0,0 +1,10 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{k}{FROM}\PYG{+w}{ }\PYG{l+s}{debian} + +\PYG{c}{\PYGZsh{} ...} + +\PYG{k}{RUN}\PYG{+w}{ }useradd\PYG{+w}{ }test +\PYG{k}{USER}\PYG{+w}{ }\PYG{l+s}{test} + +\PYG{c}{\PYGZsh{} CMD / ENTRYPOINT} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/62387C62FF3CC3A4DA1DFF467DC1A476259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/62387C62FF3CC3A4DA1DFF467DC1A476259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..58a78dc --- /dev/null +++ b/04_k8s/cm/_minted-slides/62387C62FF3CC3A4DA1DFF467DC1A476259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +kubectl\PYG{+w}{ }logs\PYG{+w}{ }\PYGZlt{}nom\PYG{+w}{ }pod\PYGZgt{} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/65B2ADF40A929DECFC2C60325D1E3AD6259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/65B2ADF40A929DECFC2C60325D1E3AD6259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..91764a3 --- /dev/null +++ b/04_k8s/cm/_minted-slides/65B2ADF40A929DECFC2C60325D1E3AD6259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +trivy\PYG{+w}{ }k8s\PYG{+w}{ }\PYGZhy{}\PYGZhy{}severity\PYG{o}{=}CRITICAL\PYG{+w}{ }\PYGZhy{}\PYGZhy{}report\PYG{o}{=}all +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/6F335E0D9C32DAA5DD5469506868A8003E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/6F335E0D9C32DAA5DD5469506868A8003E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..fd33fa1 --- /dev/null +++ b/04_k8s/cm/_minted-slides/6F335E0D9C32DAA5DD5469506868A8003E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,14 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nn}{\PYGZhy{}\PYGZhy{}\PYGZhy{}} +\PYG{n+nt}{apiVersion}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{v1} +\PYG{n+nt}{kind}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{PersistentVolumeClaim} +\PYG{n+nt}{metadata}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{nfs\PYGZhy{}claim} +\PYG{n+nt}{spec}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{accessModes}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{ReadWriteMany} +\PYG{+w}{ }\PYG{n+nt}{storageClassName}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{nfs} +\PYG{+w}{ }\PYG{n+nt}{resources}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{requests}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{storage}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{10Gi} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/803BC4C5D625270BD64A26A184A25431259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/803BC4C5D625270BD64A26A184A25431259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..ac3cda6 --- /dev/null +++ b/04_k8s/cm/_minted-slides/803BC4C5D625270BD64A26A184A25431259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +kubectl\PYG{+w}{ }\PYG{n+nb}{set}\PYG{+w}{ }image\PYG{+w}{ }deployment/\PYGZlt{}nom\PYG{+w}{ }déploiement\PYGZgt{}\PYG{+w}{ }\PYGZlt{}nom\PYG{+w}{ }conteneur\PYGZgt{}\PYG{o}{=}\PYGZlt{}nouvelle\PYG{+w}{ }image:tag\PYGZgt{} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/8B55F418D237080362022570158FE512259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/8B55F418D237080362022570158FE512259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..b05e1d8 --- /dev/null +++ b/04_k8s/cm/_minted-slides/8B55F418D237080362022570158FE512259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,4 @@ +\begin{Verbatim}[commandchars=\\\{\}] +❯\PYG{+w}{ }kubectl\PYG{+w}{ }logs\PYG{+w}{ }profiles\PYGZhy{}app +... +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/8EA2460F13D6371AADB98E7C92DBD8E5259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/8EA2460F13D6371AADB98E7C92DBD8E5259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..670eeb6 --- /dev/null +++ b/04_k8s/cm/_minted-slides/8EA2460F13D6371AADB98E7C92DBD8E5259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,14 @@ +\begin{Verbatim}[commandchars=\\\{\}] +❯\PYG{+w}{ }kubectl\PYG{+w}{ }\PYGZhy{}n\PYG{+w}{ }profiles\PYGZhy{}app\PYG{+w}{ }describe\PYG{+w}{ }pod\PYG{+w}{ }profiles\PYGZhy{}app +Name:\PYG{+w}{ }profiles\PYGZhy{}app +Namespace:\PYG{+w}{ }profiles\PYGZhy{}app +Priority:\PYG{+w}{ }\PYG{l+m}{0} +Service\PYG{+w}{ }Account:\PYG{+w}{ }default +Node:\PYG{+w}{ }minikube/192.168.49.2 +Start\PYG{+w}{ }Time:\PYG{+w}{ }Thu,\PYG{+w}{ }\PYG{l+m}{09}\PYG{+w}{ }May\PYG{+w}{ }\PYG{l+m}{2024}\PYG{+w}{ }\PYG{l+m}{17}:35:54\PYG{+w}{ }+0200 +Labels:\PYG{+w}{ }\PYG{n+nv}{run}\PYG{o}{=}profiles\PYGZhy{}app +Annotations:\PYG{+w}{ }\PYGZlt{}none\PYGZgt{} +Status:\PYG{+w}{ }Running +IP:\PYG{+w}{ }\PYG{l+m}{10}.244.0.7 +... +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/9A5BA157CECC8CAC0A5C3290CD0067BB3E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/9A5BA157CECC8CAC0A5C3290CD0067BB3E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..0b7d003 --- /dev/null +++ b/04_k8s/cm/_minted-slides/9A5BA157CECC8CAC0A5C3290CD0067BB3E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,11 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nn}{\PYGZhy{}\PYGZhy{}\PYGZhy{}} +\PYG{n+nn}{...} +\PYG{n+nt}{spec}\PYG{p}{:} +\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{...} +\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{strategy}\PYG{p+pIndicator}{:} +\PYG{+w}{ }\PYG{n+nt}{type}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{RollingUpdate} +\PYG{+w}{ }\PYG{n+nt}{rollingUpdate}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{maxUnavailable}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{0} +\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{...} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/9FBF2C572E983D4B9C472E51F6C17E23259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/9FBF2C572E983D4B9C472E51F6C17E23259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..6ba42af --- /dev/null +++ b/04_k8s/cm/_minted-slides/9FBF2C572E983D4B9C472E51F6C17E23259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,5 @@ +\begin{Verbatim}[commandchars=\\\{\}] +❯\PYG{+w}{ }kubectl\PYG{+w}{ }get\PYG{+w}{ }pods +NAME\PYG{+w}{ }READY\PYG{+w}{ }STATUS\PYG{+w}{ }RESTARTS\PYG{+w}{ }AGE +profiles\PYGZhy{}app\PYG{+w}{ }\PYG{l+m}{3}/3\PYG{+w}{ }Running\PYG{+w}{ }\PYG{l+m}{0}\PYG{+w}{ }22s +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/A34A4D0ECFC397FDE2ECA618C97F9F043E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/A34A4D0ECFC397FDE2ECA618C97F9F043E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..b46e6fc --- /dev/null +++ b/04_k8s/cm/_minted-slides/A34A4D0ECFC397FDE2ECA618C97F9F043E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,11 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nn}{\PYGZhy{}\PYGZhy{}\PYGZhy{}} +\PYG{n+nt}{clef}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{valeur} +\PYG{n+nt}{liste\PYGZus{}de\PYGZus{}nombres}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{1} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{2} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{3} +\PYG{n+nt}{liste\PYGZus{}de\PYGZus{}clefs\PYGZus{}valeurs}\PYG{p}{:} +\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{titre}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{blade\PYGZus{}runner} +\PYG{+w}{ }\PYG{n+nt}{note}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{10} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/AA81AC9BCF9B42988DB3755DC127BD043E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/AA81AC9BCF9B42988DB3755DC127BD043E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..8eabf09 --- /dev/null +++ b/04_k8s/cm/_minted-slides/AA81AC9BCF9B42988DB3755DC127BD043E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,19 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nt}{apiVersion}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{v1} +\PYG{n+nt}{kind}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{Pod} +\PYG{n+nt}{metadata}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{my\PYGZhy{}app} +\PYG{n+nt}{spec}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{volumes}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{my\PYGZhy{}app\PYGZhy{}storage}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} un nom pour le volume} +\PYG{+w}{ }\PYG{n+nt}{persistentVolumeClaim}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{claimName}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{app\PYGZhy{}pv\PYGZhy{}claim}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} le nom du \PYGZdq{}claim\PYGZdq{} à utiliser} +\PYG{+w}{ }\PYG{n+nt}{containers}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{my\PYGZhy{}app} +\PYG{+w}{ }\PYG{n+nt}{image}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{nginx} +\PYG{+w}{ }\PYG{n+nt}{ports}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{containerPort}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{80} +\PYG{+w}{ }\PYG{n+nt}{volumeMounts}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{mountPath}\PYG{p}{:}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}/usr/share/nginx/html\PYGZdq{}}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} point de montage dans le /pod/} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{my\PYGZhy{}app\PYGZhy{}storage}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} nom du stockage} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/AE156E8C026296B9BA6E6849109F85FB3E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/AE156E8C026296B9BA6E6849109F85FB3E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..0a5917c --- /dev/null +++ b/04_k8s/cm/_minted-slides/AE156E8C026296B9BA6E6849109F85FB3E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,8 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nt}{apiVersion}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{v1} +\PYG{n+nt}{kind}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{ConfigMap}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} un nouveau type} +\PYG{+w}{ }\PYG{n+nt}{metadata}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{my\PYGZhy{}app\PYGZhy{}config}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} on lui met un nom} +\PYG{+w}{ }\PYG{n+nt}{data}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} puis une liste de clefs\PYGZhy{}valeurs} +\PYG{+w}{ }\PYG{n+nt}{database\PYGZus{}uri}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{mongodb://localhost:27017} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/B85BD5E1EE25214E649E7D893638E39E3E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/B85BD5E1EE25214E649E7D893638E39E3E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..0af7e36 --- /dev/null +++ b/04_k8s/cm/_minted-slides/B85BD5E1EE25214E649E7D893638E39E3E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,16 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nt}{apiVersion}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{v1} +\PYG{n+nt}{kind}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{PersistentVolume}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} un nouveau type} +\PYG{n+nt}{metadata}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{pv\PYGZhy{}volume} +\PYG{+w}{ }\PYG{n+nt}{labels}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{type}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{local} +\PYG{n+nt}{spec}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{storageClassName}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{manual}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} la classe du stockage} +\PYG{+w}{ }\PYG{n+nt}{capacity}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{storage}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{10Gi}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} la taille du volume} +\PYG{+w}{ }\PYG{n+nt}{accessModes}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{ReadWriteOnce} +\PYG{+w}{ }\PYG{n+nt}{hostPath}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} on veut stocker sur le nœud physique} +\PYG{+w}{ }\PYG{n+nt}{path}\PYG{p}{:}\PYG{+w}{ }\PYG{l+s}{\PYGZdq{}/mnt/data\PYGZdq{}}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} son emplacement sur le nœud} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/CB2FC80F6093152BF956AB3AFCBCF1E83E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/CB2FC80F6093152BF956AB3AFCBCF1E83E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..be02a81 --- /dev/null +++ b/04_k8s/cm/_minted-slides/CB2FC80F6093152BF956AB3AFCBCF1E83E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,15 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nn}{\PYGZhy{}\PYGZhy{}\PYGZhy{}} +\PYG{n+nt}{apiVersion}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{v1} +\PYG{n+nt}{kind}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{Service}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} ici le type est \PYGZdq{}service\PYGZdq{}} +\PYG{n+nt}{metadata}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{namespace}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{profiles\PYGZhy{}app\PYGZhy{}ns}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} on choisi le namespace} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{my\PYGZhy{}service}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} on choisi un nom pour le service} +\PYG{n+nt}{spec}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{selector}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} règles pour sélectionner le pod} +\PYG{+w}{ }\PYG{n+nt}{app.kubernetes.io/name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{profiles\PYGZhy{}app}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} selection par nom} +\PYG{+w}{ }\PYG{n+nt}{ports}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} on choisi les ports à exposer} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{protocol}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{TCP}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} le protocole} +\PYG{+w}{ }\PYG{n+nt}{port}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{80}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} le port *CIBLE*} +\PYG{+w}{ }\PYG{n+nt}{targetPort}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{9376}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} le port *DU POD*} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/D96A1887D263AFC3A2BC48AD9F68247A3E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/D96A1887D263AFC3A2BC48AD9F68247A3E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..77571d3 --- /dev/null +++ b/04_k8s/cm/_minted-slides/D96A1887D263AFC3A2BC48AD9F68247A3E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,23 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nt}{apiVersion}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{apps/v1} +\PYG{n+nt}{kind}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{Deployment}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} un nouveau type, \PYGZdq{}Deployment\PYGZdq{}} +\PYG{n+nt}{metadata}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{nginx\PYGZhy{}deployment}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} on lui met un nom} +\PYG{+w}{ }\PYG{n+nt}{labels}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} et des labels} +\PYG{+w}{ }\PYG{n+nt}{app}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{nginx} +\PYG{n+nt}{spec}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{replicas}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{3}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} le nombre de réplications voulues} +\PYG{+w}{ }\PYG{n+nt}{selector}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{matchLabels}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{app}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{nginx} +\PYG{+w}{ }\PYG{n+nt}{template}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} champs qui seront appliqués aux pods} +\PYG{+w}{ }\PYG{n+nt}{metadata}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{labels}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{app}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{nginx} +\PYG{+w}{ }\PYG{n+nt}{spec}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{containers}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} on spécifie les conteneurs} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{nginx} +\PYG{+w}{ }\PYG{n+nt}{image}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{nginx:1.7.9} +\PYG{+w}{ }\PYG{n+nt}{ports}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{n+nt}{containerPort}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{80} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/DBD968EECE8D1E34550C3F53D97DA1FD259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/DBD968EECE8D1E34550C3F53D97DA1FD259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..55416bc --- /dev/null +++ b/04_k8s/cm/_minted-slides/DBD968EECE8D1E34550C3F53D97DA1FD259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +kubectl\PYG{+w}{ }\PYG{n+nb}{exec}\PYG{+w}{ }\PYGZhy{}it\PYG{+w}{ }\PYGZlt{}nom\PYG{+w}{ }pod\PYGZgt{}\PYG{+w}{ }\PYGZhy{}\PYGZhy{}\PYG{+w}{ }/bin/bash +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/E2CB398F55E3CC9B9491CE422394EF273E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/E2CB398F55E3CC9B9491CE422394EF273E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..498ebc7 --- /dev/null +++ b/04_k8s/cm/_minted-slides/E2CB398F55E3CC9B9491CE422394EF273E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,13 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nt}{apiVersion}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{v1} +\PYG{n+nt}{kind}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{PersistentVolumeClaim}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} un nouveau type} +\PYG{n+nt}{metadata}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{app\PYGZhy{}pv\PYGZhy{}claim}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} un nom} +\PYG{n+nt}{spec}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{storageClassName}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{manual}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} la classe du stockage} +\PYG{+w}{ }\PYG{n+nt}{accessModes}\PYG{p}{:} +\PYG{+w}{ }\PYG{p+pIndicator}{\PYGZhy{}}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{ReadWriteOnce} +\PYG{+w}{ }\PYG{n+nt}{resources}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{requests}\PYG{p}{:} +\PYG{+w}{ }\PYG{n+nt}{storage}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{3Gi}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} la taille demandée} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/E576DFDC922847C5F600940DD2E51682259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/E576DFDC922847C5F600940DD2E51682259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..4435470 --- /dev/null +++ b/04_k8s/cm/_minted-slides/E576DFDC922847C5F600940DD2E51682259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +trivy\PYG{+w}{ }k8s\PYG{+w}{ }\PYGZhy{}\PYGZhy{}report\PYG{o}{=}summary +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/E8F4ABA632D075195078994B8F21BC8C259461CDF92F77463A04B4FDF7149430.pygtex b/04_k8s/cm/_minted-slides/E8F4ABA632D075195078994B8F21BC8C259461CDF92F77463A04B4FDF7149430.pygtex new file mode 100644 index 0000000..16697f9 --- /dev/null +++ b/04_k8s/cm/_minted-slides/E8F4ABA632D075195078994B8F21BC8C259461CDF92F77463A04B4FDF7149430.pygtex @@ -0,0 +1,5 @@ +\begin{Verbatim}[commandchars=\\\{\}] +❯\PYG{+w}{ }kubectl\PYG{+w}{ }get\PYG{+w}{ }services +NAME\PYG{+w}{ }TYPE\PYG{+w}{ }CLUSTER\PYGZhy{}IP\PYG{+w}{ }EXTERNAL\PYGZhy{}IP\PYG{+w}{ }PORT\PYG{o}{(}S\PYG{o}{)}\PYG{+w}{ }AGE +profiles\PYGZhy{}app\PYGZhy{}svc\PYG{+w}{ }LoadBalancer\PYG{+w}{ }\PYG{l+m}{10}.97.188.25\PYG{+w}{ }\PYGZlt{}pending\PYGZgt{}\PYG{+w}{ }\PYG{l+m}{8000}:30487/TCP,8001:32451/TCP\PYG{+w}{ }5s +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/EBA903B1AD8E7CBDDBF8892E701766AC3E5A9F8B5715721E59D57EE499C4B0FD.pygtex b/04_k8s/cm/_minted-slides/EBA903B1AD8E7CBDDBF8892E701766AC3E5A9F8B5715721E59D57EE499C4B0FD.pygtex new file mode 100644 index 0000000..6e1fc94 --- /dev/null +++ b/04_k8s/cm/_minted-slides/EBA903B1AD8E7CBDDBF8892E701766AC3E5A9F8B5715721E59D57EE499C4B0FD.pygtex @@ -0,0 +1,7 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nn}{\PYGZhy{}\PYGZhy{}\PYGZhy{}} +\PYG{n+nt}{apiVersion}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{v1}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} nécessaire pour que K8S comprenne} +\PYG{n+nt}{kind}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{Namespace}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} le type de ressource} +\PYG{n+nt}{metadata}\PYG{p}{:}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} les informations de la ressource} +\PYG{+w}{ }\PYG{n+nt}{name}\PYG{p}{:}\PYG{+w}{ }\PYG{l+lScalar+lScalarPlain}{profiles\PYGZhy{}app}\PYG{+w}{ }\PYG{c+c1}{\PYGZsh{} ici, son nom} +\end{Verbatim} diff --git a/04_k8s/cm/_minted-slides/default.pygstyle b/04_k8s/cm/_minted-slides/default.pygstyle new file mode 100644 index 0000000..962372e --- /dev/null +++ b/04_k8s/cm/_minted-slides/default.pygstyle @@ -0,0 +1,102 @@ + +\makeatletter +\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax% + \let\PYG@ul=\relax \let\PYG@tc=\relax% + \let\PYG@bc=\relax \let\PYG@ff=\relax} +\def\PYG@tok#1{\csname PYG@tok@#1\endcsname} +\def\PYG@toks#1+{\ifx\relax#1\empty\else% + \PYG@tok{#1}\expandafter\PYG@toks\fi} +\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{% + \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}} +\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}} + +\@namedef{PYG@tok@w}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}} +\@namedef{PYG@tok@c}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} +\@namedef{PYG@tok@cp}{\def\PYG@tc##1{\textcolor[rgb]{0.61,0.40,0.00}{##1}}} +\@namedef{PYG@tok@k}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@kp}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@kt}{\def\PYG@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}} +\@namedef{PYG@tok@o}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@ow}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}} +\@namedef{PYG@tok@nb}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@nf}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} +\@namedef{PYG@tok@nc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} +\@namedef{PYG@tok@nn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} +\@namedef{PYG@tok@ne}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.80,0.25,0.22}{##1}}} +\@namedef{PYG@tok@nv}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@no}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}} +\@namedef{PYG@tok@nl}{\def\PYG@tc##1{\textcolor[rgb]{0.46,0.46,0.00}{##1}}} +\@namedef{PYG@tok@ni}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}} +\@namedef{PYG@tok@na}{\def\PYG@tc##1{\textcolor[rgb]{0.41,0.47,0.13}{##1}}} +\@namedef{PYG@tok@nt}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@nd}{\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}} +\@namedef{PYG@tok@s}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@sd}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@si}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}} +\@namedef{PYG@tok@se}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.36,0.12}{##1}}} +\@namedef{PYG@tok@sr}{\def\PYG@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}} +\@namedef{PYG@tok@ss}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@sx}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@m}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@gh}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} +\@namedef{PYG@tok@gu}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}} +\@namedef{PYG@tok@gd}{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}} +\@namedef{PYG@tok@gi}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.52,0.00}{##1}}} +\@namedef{PYG@tok@gr}{\def\PYG@tc##1{\textcolor[rgb]{0.89,0.00,0.00}{##1}}} +\@namedef{PYG@tok@ge}{\let\PYG@it=\textit} +\@namedef{PYG@tok@gs}{\let\PYG@bf=\textbf} +\@namedef{PYG@tok@ges}{\let\PYG@bf=\textbf\let\PYG@it=\textit} +\@namedef{PYG@tok@gp}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} +\@namedef{PYG@tok@go}{\def\PYG@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}} +\@namedef{PYG@tok@gt}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}} +\@namedef{PYG@tok@err}{\def\PYG@bc##1{{\setlength{\fboxsep}{\string -\fboxrule}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}} +\@namedef{PYG@tok@kc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@kd}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@kn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@kr}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@bp}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@fm}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} +\@namedef{PYG@tok@vc}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@vg}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@vi}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@vm}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@sa}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@sb}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@sc}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@dl}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@s2}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@sh}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@s1}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@mb}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@mf}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@mh}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@mi}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@il}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@mo}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@ch}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} +\@namedef{PYG@tok@cm}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} +\@namedef{PYG@tok@cpf}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} +\@namedef{PYG@tok@c1}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} +\@namedef{PYG@tok@cs}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} + +\def\PYGZbs{\char`\\} +\def\PYGZus{\char`\_} +\def\PYGZob{\char`\{} +\def\PYGZcb{\char`\}} +\def\PYGZca{\char`\^} +\def\PYGZam{\char`\&} +\def\PYGZlt{\char`\<} +\def\PYGZgt{\char`\>} +\def\PYGZsh{\char`\#} +\def\PYGZpc{\char`\%} +\def\PYGZdl{\char`\$} +\def\PYGZhy{\char`\-} +\def\PYGZsq{\char`\'} +\def\PYGZdq{\char`\"} +\def\PYGZti{\char`\~} +% for compatibility with earlier versions +\def\PYGZat{@} +\def\PYGZlb{[} +\def\PYGZrb{]} +\makeatother + diff --git a/04_k8s/cm/images/.$blue_green.drawio.bkp b/04_k8s/cm/images/.$blue_green.drawio.bkp new file mode 100644 index 0000000..d17c169 --- /dev/null +++ b/04_k8s/cm/images/.$blue_green.drawio.bkp @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/04_k8s/cm/images/.$networking.drawio.bkp b/04_k8s/cm/images/.$networking.drawio.bkp new file mode 100644 index 0000000..12d9197 --- /dev/null +++ b/04_k8s/cm/images/.$networking.drawio.bkp @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/04_k8s/cm/images/blue_green.drawio b/04_k8s/cm/images/blue_green.drawio new file mode 100644 index 0000000..a0f7c38 --- /dev/null +++ b/04_k8s/cm/images/blue_green.drawio @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/04_k8s/cm/images/blue_green.png b/04_k8s/cm/images/blue_green.png new file mode 100644 index 0000000..28c199c Binary files /dev/null and b/04_k8s/cm/images/blue_green.png differ diff --git a/04_k8s/cm/images/blue_green.svg b/04_k8s/cm/images/blue_green.svg new file mode 100644 index 0000000..bb7da0e --- /dev/null +++ b/04_k8s/cm/images/blue_green.svg @@ -0,0 +1,4 @@ + + + +
Client
Service
Déploiement
green
Déploiement
blue
Client
Service
Déploiement
green
Déploiement
blue
\ No newline at end of file diff --git a/04_k8s/cm/images/canary.drawio b/04_k8s/cm/images/canary.drawio new file mode 100644 index 0000000..5ca52d1 --- /dev/null +++ b/04_k8s/cm/images/canary.drawio @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/04_k8s/cm/images/canary.svg b/04_k8s/cm/images/canary.svg new file mode 100644 index 0000000..c931084 --- /dev/null +++ b/04_k8s/cm/images/canary.svg @@ -0,0 +1,4 @@ + + + +
Client
Service
Version 1
Version 2
\ No newline at end of file diff --git a/04_k8s/cm/images/networking.drawio b/04_k8s/cm/images/networking.drawio new file mode 100644 index 0000000..08c3980 --- /dev/null +++ b/04_k8s/cm/images/networking.drawio @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/04_k8s/cm/images/networking.svg b/04_k8s/cm/images/networking.svg new file mode 100644 index 0000000..ee8b6b2 --- /dev/null +++ b/04_k8s/cm/images/networking.svg @@ -0,0 +1,4 @@ + + + +podpodpod
Coté cluster
podpod
Service
Service
Ingress
Ingress
\ No newline at end of file diff --git a/04_k8s/cm/images/trivy_summary.png b/04_k8s/cm/images/trivy_summary.png new file mode 100644 index 0000000..e8ad95b Binary files /dev/null and b/04_k8s/cm/images/trivy_summary.png differ diff --git a/04_k8s/cm/images/trivy_vulns.png b/04_k8s/cm/images/trivy_vulns.png new file mode 100644 index 0000000..d994baa Binary files /dev/null and b/04_k8s/cm/images/trivy_vulns.png differ diff --git a/04_k8s/cm/slides.html b/04_k8s/cm/slides.html new file mode 100644 index 0000000..70b6025 --- /dev/null +++ b/04_k8s/cm/slides.html @@ -0,0 +1,947 @@ + + + + +Cours de virtualisation avancée: <i>Kubernetes</i>, suite + + + + + + + + + + + +
+
+

Cours de virtualisation avancée: Kubernetes, suite

+ +
+ +
+
+

1. Déploiement

+
+
+
+
+

1.1. Rolling Updates

+

+Permet des mises à jour d'images sans temps de coupure +

+
+ +
---
+...
+spec:
+  ...
+  strategy: 
+    type: RollingUpdate
+    rollingUpdate:
+      maxUnavailable: 0
+  ...
+
+
+ +
+
+ +
    +
  • maxUnavailable: défini le nombre maximal de replicas indisponibles
  • +
  • maxSurge: défini le nombre maximal de replicas à mettre à jour en même temps
  • + +
+ +
+
+ +

+Ensuite, mettre à jour l'image avec: +

+
+ +
kubectl set image deployment/<nom déploiement> <nom conteneur>=<nouvelle image:tag>
+
+
+ +

+But: +

+
    +
  • Mettre à jour l'application sans downtime
  • + +
+ +
+
+

1.2. Déploiement blue / green

+ +
+

Client
Service
Déploiement
green
Déploiement
blue
Client
Service
Déploiement
green
Déploiement
blue
+

+
+ +
+
+ +
    +
  • On déploie la nouvelle version en parallèle de l'ancienne
  • +
  • Une fois que tout est déployé on redirige le trafic vers le nouveau déploiement
  • + +
+ +

+But: +

+
    +
  • Tester le déploiement de la nouvelle version avant de la basculer en prod
  • + +
+ +
+
+

1.3. Déploiement canary

+ +
+

Client
Service
Version 1
Version 2
+

+
+ +
+
+ +
    +
  • On déploie la nouvelle version en parallèle de l'ancienne avec moins de replicas
  • +
  • Automatiquement une petite partie des clients tomberont sur la nouvelle version
  • + +
+ +

+But: +

+
    +
  • Faire tester à quelques utilisat(eur|rice)s aléatoires la nouvelle version
  • + +
+ +
+
+
+
+

2. Mise à l'échelle (scaling)

+
    +
  • Nécessaire quand la charge augmente
  • +
  • Par exemple pour suivre l'augmentation du trafic de notre application
  • + +
+ +
+
+

2.1. Verticale (vertical scaling)

+
+
+
+
+

2.1.1. Fonctionnement

+
    +
  • On augmente la puissance des nœuds
  • +
  • Augmente les capacité de l'application existante
  • +
  • L'application n'a pas besoin d’être capable de gérer la réplication
  • + +
+ +
+
+

2.1.2. Inconvénients

+
    +
  • Augmentation des coûts
  • +
  • Coûts pas toujours proportionnels à la puissance des nœuds
  • +
  • Si nœud déjà au max: comment faire ?
  • + +
+ +
+
+

2.2. Horizontale (horizontal scaling)

+
+
+
+
+

2.2.1. Fonctionnement

+
    +
  • On ajoute des nœuds (et donc des nouvelles instances) à l'infra
  • +
  • La charge de travail est donc répartie entre les instances
  • +
  • L'application a besoin d’être capable de gérer la réplication
  • + +
+ +
+
+

2.2.2. Inconvénients

+
    +
  • Augmentation des coûts
  • +
  • On peut se retrouver avec beaucoup de nœuds
  • + +
+ +
+
+

2.3. Horizontal scaling dans K8S

+

+doc +doc +

+ +
+ +
kubectl autoscale deployment <nom déploiement> \
+        --cpu-percent=50 --min=1 --max=10
+
+
+ +
+
+ +

+Demande au cluster de créer entre min et max replicas selon la charge du CPU du nœud +

+ +
+
+

2.4. Vertical scaling dans K8S

+

+Compliqué à mettre en place sur sa propre infra étant donné qu'il faut changer les ressources des machines. +

+ +
+
+
+
+

3. Réseau

+
+
+
+
+

3.1. Rappels

+ +
+

podpodpod
Coté cluster
podpod
Service
Service
Ingress
Ingress
+

+
+ +
+
+

3.2. Ingress

+

+doc +doc +

+ +
    +
  • Permet d'exposer nos services en dehors du cluster
  • +
  • Assez similaire à un reverse proxy comme vous aviez déjà vu avec Nginx
  • + +
  • Nécessite des ressources configurées par les administrat(eur|rice)s du cluster
  • + +
+ +
+
+ +
+ +
apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: test-ingress
+spec:
+  defaultBackend:
+    service:
+      name: testsvc
+      port:
+        number: 80
+
+
+ + +
+ +
❯ kubectl get ingress test-ingress
+NAME           HOSTS     ADDRESS           PORTS     AGE
+test-ingress   *         107.178.254.228   80        59s
+
+
+ +
+
+ +
    +
  • Peut aussi servir de routeur HTTP en dirigeant le trafic des routes vers différents services
  • + +
+ +
+
+ +
+ +
...
+  - host: foo.bar.com
+    http:
+      paths:
+      - path: /foo
+        pathType: Prefix
+        backend:
+          service:
+            name: service1
+            port:
+              number: 4200
+      - path: /bar
+        pathType: Prefix
+        backend:
+          service:
+            name: service2
+            port:
+              number: 8080  
+
+
+ +
+
+
+
+

4. Sécurité et gestion d'utilisat(eur|rice)s

+
+
+
+
+

4.1. Contrôle d'accès basé sur les rôles (RBAC)

+

+doc +

+ +
    +
  • Permet de réguler l'accès aux ressources en fonction de rôles attribués aux utilisat(eur|rice)s
  • + +
+ +
+
+

4.1.1. Role et ClusterRole

+

+Pour créer les rôles (au sens large) +

+ +
+ +
apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+  namespace: default
+  name: pod-reader
+rules:
+- apiGroups: [""] # "" indicates the core API group
+  resources: ["pods"]
+  verbs: ["get", "watch", "list"]
+
+
+ +
+
+ +
    +
  • Ce rôle permet de définir un accès en lecture seule aux pods de l'espace de noms default
  • +
  • Le type Role concerne toujours l'espace de noms dans lequel il est créé
  • + +
+ +
+
+ +
+ +
apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  # pas de "namespace"
+  name: pod-reader
+rules:
+- apiGroups: [""]
+  resources: ["pods"]
+  verbs: ["get", "watch", "list"]  
+
+
+ +
+
+ +
    +
  • Ce rôle permet de définir un accès en lecture seule aux pods dans n'importe quel espace de noms
  • + +
+ +
+
+

4.1.2. RoleBinding et ClusterRoleBinding

+

+Pour accorder les rôles (au sens large) à un.e ou des utilisat(eur|rice)s, ou un groupe +

+ +
+ +
apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+  name: read-pods
+  namespace: default
+subjects:
+- kind: User
+  name: jane # sensible à la casse
+  apiGroup: rbac.authorization.k8s.io
+roleRef:
+  kind: Role
+  name: pod-reader
+  apiGroup: rbac.authorization.k8s.io
+
+
+ +
+
+
+
+

5. Helm

+

+doc +

+ +
    +
  • Une sorte de "gestionnaire de paquets" pour Kube
  • +
  • Permet de "packager" des applications
  • +
  • Permet d'installer des outils "grand public" sans se prendre la tête
  • + +
+ +
+
+

5.1. Exemple d'utilisation

+ + + +
+
+
+
+

6. Aller plus loin

+ +
+
+
+
+ + + + + + + + + diff --git a/04_k8s/cm/slides.org b/04_k8s/cm/slides.org new file mode 100644 index 0000000..9a3d0fe --- /dev/null +++ b/04_k8s/cm/slides.org @@ -0,0 +1,245 @@ +#+TITLE: Cours de virtualisation avancée: /Kubernetes/, suite +#+OPTIONS: toc:nil date:nil author:nil reveal_single_file:t timestamp:nil +#+LATEX_CLASS: article +#+LATEX_CLASS_OPTIONS: [12pt,a4paper] +#+LATEX_HEADER: \usepackage[a4paper,margin=0.5in]{geometry} +#+LATEX_HEADER: \usepackage[utf8]{inputenc} +#+LATEX_HEADER: \usepackage[inkscapelatex=false]{svg} +#+LATEX_HEADER: \usepackage[sfdefault]{AlegreyaSans} +#+LATEX_HEADER: \usepackage{multicol} +#+LATEX_HEADER: \usepackage{minted} +#+LATEX_HEADER: \usepackage{float} +#+LATEX_HEADER: \usepackage{tikz} +#+LATEX_HEADER: \usetikzlibrary{positioning} +#+LATEX_HEADER: \renewcommand\listingscaption{Exemple de code} + +#+REVEAL_THEME: white +#+REVEAL_INIT_OPTIONS: slideNumber:true +#+REVEAL_EXTRA_CSS: ../../common/reveal_custom.css + +* Déploiement +** /Rolling Updates/ +Permet des mises à jour d'images sans temps de coupure +#+BEGIN_SRC yaml +--- +... +spec: + ... + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 0 + ... +#+END_SRC + +#+REVEAL: split + +- =maxUnavailable=: défini le nombre maximal de /replicas/ indisponibles +- =maxSurge=: défini le nombre maximal de /replicas/ à mettre à jour en même temps + +#+REVEAL: split + +Ensuite, mettre à jour l'image avec: +#+BEGIN_SRC bash +kubectl set image deployment/ = +#+END_SRC + +*But*: +- Mettre à jour l'application sans /downtime/ + +** Déploiement /blue / green/ +[[file:./images/blue_green.svg]] + +#+REVEAL: split + +- On déploie la nouvelle version en parallèle de l'ancienne +- Une fois que tout est déployé on redirige le trafic vers le nouveau déploiement + +*But*: +- Tester le déploiement de la nouvelle version avant de la basculer en prod + +** Déploiement /canary/ +[[file:./images/canary.svg]] + +#+REVEAL: split + +- On déploie la nouvelle version en parallèle de l'ancienne *avec moins de /replicas/* +- Automatiquement une petite partie des clients tomberont sur la nouvelle version + +*But*: +- Faire tester à quelques utilisat(eur|rice)s aléatoires la nouvelle version + +* Mise à l'échelle (/scaling/) + +- Nécessaire quand la charge augmente +- Par exemple pour suivre l'augmentation du trafic de notre application + +** Verticale (/vertical scaling/) +*** Fonctionnement +- On augmente la puissance des nœuds +- Augmente les capacité de l'application existante +- L'application *n'a pas besoin d’être capable de gérer la réplication* + +*** Inconvénients +- Augmentation des coûts +- Coûts pas toujours proportionnels à la puissance des nœuds +- Si nœud déjà au max: comment faire ? + +** Horizontale (/horizontal scaling/) +*** Fonctionnement +- On ajoute des nœuds (et donc des nouvelles instances) à l'infra +- La charge de travail est donc répartie entre les instances +- L'application *a besoin d’être capable de gérer la réplication* + +*** Inconvénients +- Augmentation des coûts +- On peut se retrouver avec beaucoup de nœuds + +** /Horizontal scaling/ dans /K8S/ +[[https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/][doc]] +[[https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/][doc]] + +#+BEGIN_SRC bash +kubectl autoscale deployment \ + --cpu-percent=50 --min=1 --max=10 +#+END_SRC + +#+REVEAL: split + +Demande au /cluster/ de créer entre =min= et =max= /replicas/ selon la charge du /CPU/ du nœud + +** /Vertical scaling/ dans /K8S/ +Compliqué à mettre en place sur sa propre infra étant donné qu'il faut changer les ressources des machines. + +* Réseau +** Rappels +[[file:./images/networking.svg]] + +** /Ingress/ +[[https://kubernetes.io/fr/docs/concepts/services-networking/ingress/][doc]] +[[https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/][doc]] + +- Permet d'exposer nos services en dehors du /cluster/ +- Assez similaire à un /reverse proxy/ comme vous aviez déjà vu avec /Nginx/ + +- Nécessite des ressources configurées par les administrat(eur|rice)s du /cluster/ + +#+REVEAL: split + +#+BEGIN_SRC yaml +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: test-ingress +spec: + defaultBackend: + service: + name: testsvc + port: + number: 80 +#+END_SRC + +#+REVEAL: nginx + +#+BEGIN_SRC bash +❯ kubectl get ingress test-ingress +NAME HOSTS ADDRESS PORTS AGE +test-ingress * 107.178.254.228 80 59s +#+END_SRC + +#+REVEAL: split + +- Peut aussi servir de *routeur /HTTP/* en dirigeant le trafic des routes vers différents services + +#+REVEAL: split + +#+BEGIN_SRC yaml +... + - host: foo.bar.com + http: + paths: + - path: /foo + pathType: Prefix + backend: + service: + name: service1 + port: + number: 4200 + - path: /bar + pathType: Prefix + backend: + service: + name: service2 + port: + number: 8080 +#+END_SRC + +* Sécurité et gestion d'utilisat(eur|rice)s +** Contrôle d'accès basé sur les rôles (/RBAC/) +[[https://kubernetes.io/fr/docs/reference/access-authn-authz/rbac/][doc]] + +- Permet de réguler l'accès aux ressources en fonction de *rôles* attribués aux *utilisat(eur|rice)s* + +*** /Role/ et /ClusterRole/ + +Pour créer les rôles (au sens large) + +#+BEGIN_SRC yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + namespace: default + name: pod-reader +rules: +- apiGroups: [""] # "" indicates the core API group + resources: ["pods"] + verbs: ["get", "watch", "list"] +#+END_SRC + +#+REVEAL: split + +- Ce rôle permet de définir un accès en *lecture seule* aux */pods/* de l'espace de noms */default/* +- Le type /Role/ concerne *toujours* l'espace de noms dans lequel il est créé + +#+REVEAL: split + +#+BEGIN_SRC yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + # pas de "namespace" + name: pod-reader +rules: +- apiGroups: [""] + resources: ["pods"] + verbs: ["get", "watch", "list"] +#+END_SRC + +#+REVEAL: split + +- Ce rôle permet de définir un accès en *lecture seule* aux */pods/* dans *n'importe quel* espace de noms + +*** /RoleBinding/ et /ClusterRoleBinding/ + +Pour accorder les rôles (au sens large) à un.e ou des utilisat(eur|rice)s, ou un groupe + +#+BEGIN_SRC yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: read-pods + namespace: default +subjects: +- kind: User + name: jane # sensible à la casse + apiGroup: rbac.authorization.k8s.io +roleRef: + kind: Role + name: pod-reader + apiGroup: rbac.authorization.k8s.io +#+END_SRC + +* Aller plus loin +- https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/ +- https://kubernetes.io/fr/docs/concepts/services-networking/ingress/ +- https://kubernetes.io/fr/docs/reference/access-authn-authz/rbac/ diff --git a/04_k8s/cm/slides.pdf b/04_k8s/cm/slides.pdf new file mode 100644 index 0000000..43d68ce Binary files /dev/null and b/04_k8s/cm/slides.pdf differ diff --git a/04_k8s/cm/slides.tex b/04_k8s/cm/slides.tex new file mode 100644 index 0000000..7d05942 --- /dev/null +++ b/04_k8s/cm/slides.tex @@ -0,0 +1,127 @@ +% Intended LaTeX compiler: pdflatex +\documentclass[12pt,a4paper]{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{graphicx} +\usepackage{longtable} +\usepackage{wrapfig} +\usepackage{rotating} +\usepackage[normalem]{ulem} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{capt-of} +\usepackage{hyperref} +\usepackage{minted} +\usepackage[a4paper,margin=0.5in]{geometry} +\usepackage[utf8]{inputenc} +\usepackage[inkscapelatex=false]{svg} +\usepackage[sfdefault]{AlegreyaSans} +\usepackage{multicol} +\usepackage{minted} +\usepackage{float} +\usepackage{tikz} +\usetikzlibrary{positioning} +\renewcommand\listingscaption{Exemple de code} +\date{} +\title{Cours de virtualisation avancée: \emph{Kubernetes}, suite} +\hypersetup{ + pdfauthor={Evrard Van Espen}, + pdftitle={Cours de virtualisation avancée: \emph{Kubernetes}, suite}, + pdfkeywords={}, + pdfsubject={}, + pdfcreator={Emacs 30.0.50 (Org mode 9.6.15)}, + pdflang={English}} +\begin{document} + +\maketitle + +\section{\emph{Rolling Updates}} +\label{sec:org16f1979} +Permet des mises à jour d'images sans temps de coupure +\begin{minted}[]{yaml} +--- +... +spec: + ... + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 0 + ... +\end{minted} + +\begin{itemize} +\item \texttt{maxUnavailable}: défini le nombre maximal de \emph{replicas} indisponibles +\item \texttt{maxSurge}: défini le nombre maximal de \emph{replicas} à mettre à jour en même temps +\end{itemize} + +Ensuite, mettre à jour l'image avec: +\begin{minted}[]{bash} +kubectl set image deployment/ = +\end{minted} + +\textbf{But}: +\begin{itemize} +\item Mettre à jour l'application sans \emph{downtime} +\end{itemize} + +\section{Déploiement \emph{blue / green}} +\label{sec:org12d4e94} +\begin{center} +\includesvg[width=.9\linewidth]{./images/blue_green} +\end{center} + +\begin{itemize} +\item On déploie la nouvelle version en parallèle de l'ancienne +\item Une fois que tout est déployé on redirige le trafic vers le nouveau déploiement +\end{itemize} + +\textbf{But}: +\begin{itemize} +\item Tester le déploiement de la nouvelle version avant de la basculer en prod +\end{itemize} + +\section{Déploiement \emph{canary}} +\label{sec:orga83dd0b} +\begin{center} +\includesvg[width=.9\linewidth]{./images/canary} +\end{center} + +\begin{itemize} +\item On déploie la nouvelle version en parallèle de l'ancienne \textbf{avec moins de \emph{replicas}} +\item Automatiquement une petite partie des clients tomberont sur la nouvelle version +\end{itemize} + +\textbf{But}: +\begin{itemize} +\item Faire tester à quelques utilisateurs aléatoires la nouvelle version +\end{itemize} + +\section{Mise à l'échelle (\emph{scaling})} +\label{sec:orge0f2cfb} + +\begin{itemize} +\item Nécessaire quand la charge augmente +\item Par exemple pour suivre l'augmentation du trafic de notre application +\end{itemize} + +\subsection{Verticale (\emph{vertical scaling})} +\label{sec:org42b7a6d} +\subsubsection{Fonctionnement} +\label{sec:orgc206495} +\begin{itemize} +\item On augmente la puissance des nœuds +\item Augmente les capacité de l'application existante +\item L'application n'a pas besoin d’être capable de gérer la réplication +\end{itemize} + +\subsubsection{Inconvénients} +\label{sec:org3049ea8} +\begin{itemize} +\item Coûts pas toujours proportionnels à la puissance des nœuds +\item Si nœud déjà au max: comment faire ? +\end{itemize} + +\section{Aller plus loin} +\label{sec:org39d2766} +\end{document} diff --git a/04_k8s/cm/svg-inkscape/blue_green_svg-raw.pdf b/04_k8s/cm/svg-inkscape/blue_green_svg-raw.pdf new file mode 100644 index 0000000..7fbda7e Binary files /dev/null and b/04_k8s/cm/svg-inkscape/blue_green_svg-raw.pdf differ diff --git a/04_k8s/cm/svg-inkscape/canary_svg-raw.pdf b/04_k8s/cm/svg-inkscape/canary_svg-raw.pdf new file mode 100644 index 0000000..3662ebc Binary files /dev/null and b/04_k8s/cm/svg-inkscape/canary_svg-raw.pdf differ diff --git a/04_k8s/tp/_minted-main/108797AEA8D6DD1B2E355D5DB2F375CBD3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/108797AEA8D6DD1B2E355D5DB2F375CBD3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..0419330 --- /dev/null +++ b/04_k8s/tp/_minted-main/108797AEA8D6DD1B2E355D5DB2F375CBD3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,5 @@ +\begin{Verbatim}[commandchars=\\\{\}] +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Blade Runner\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Ridley Scott\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{1982} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2021} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune 2\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2024} +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/13E5F20DF8C55CC4617EBD20E7F69FD6D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/13E5F20DF8C55CC4617EBD20E7F69FD6D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..6d55bea --- /dev/null +++ b/04_k8s/tp/_minted-main/13E5F20DF8C55CC4617EBD20E7F69FD6D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +curl\PYG{+w}{ }http://192.168.49.2:30000 +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/156EE04AB1490076EF47392E413629D0D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/156EE04AB1490076EF47392E413629D0D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..9323637 --- /dev/null +++ b/04_k8s/tp/_minted-main/156EE04AB1490076EF47392E413629D0D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +git\PYG{+w}{ }clone\PYG{+w}{ }https://codefirst.iut.uca.fr/git/evrard.van\PYGZus{}espen/cours\PYGZus{}virtualisation\PYGZus{}avancee\PYGZus{}ETUD.git +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/1E93752259194B4DA16BE61F07213328D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/1E93752259194B4DA16BE61F07213328D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..d3bd43b --- /dev/null +++ b/04_k8s/tp/_minted-main/1E93752259194B4DA16BE61F07213328D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +curl\PYG{+w}{ }http://10.109.243.202:30000 +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/1FD1AB54714D4B253B378FB9E86CE2E7D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/1FD1AB54714D4B253B378FB9E86CE2E7D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..7ea4337 --- /dev/null +++ b/04_k8s/tp/_minted-main/1FD1AB54714D4B253B378FB9E86CE2E7D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,6 @@ +\begin{Verbatim}[commandchars=\\\{\}] +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}external\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Blade Runner\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Ridley Scott\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{1982} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}external\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Blade Runner 2049\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2017} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}external\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2021} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}external\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune 2\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2024} +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/24F5D92CDCF6858F2D85CFAE7D6B2EC2D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/24F5D92CDCF6858F2D85CFAE7D6B2EC2D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..e7e10d3 --- /dev/null +++ b/04_k8s/tp/_minted-main/24F5D92CDCF6858F2D85CFAE7D6B2EC2D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +./kubectl\PYG{+w}{ }get\PYG{+w}{ }namespaces +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/3A26608F10A16ECAE722D790B6F51AEED3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/3A26608F10A16ECAE722D790B6F51AEED3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..a5f41a1 --- /dev/null +++ b/04_k8s/tp/_minted-main/3A26608F10A16ECAE722D790B6F51AEED3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,6 @@ +\begin{Verbatim}[commandchars=\\\{\}] +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Blade Runner\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Ridley Scott\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{1982} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Blade Runner 2049\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2017} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2021} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune 2\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2024} +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/461F014AB79066E433D9D5EBAA13A5D8D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/461F014AB79066E433D9D5EBAA13A5D8D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..194eff7 --- /dev/null +++ b/04_k8s/tp/_minted-main/461F014AB79066E433D9D5EBAA13A5D8D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +vdn\PYGZhy{}ssh\PYG{+w}{ }test@debian\PYGZhy{}1 +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/557CC964264BD645763E2594EDFCCFF0D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/557CC964264BD645763E2594EDFCCFF0D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..3f8561f --- /dev/null +++ b/04_k8s/tp/_minted-main/557CC964264BD645763E2594EDFCCFF0D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,6 @@ +\begin{Verbatim}[commandchars=\\\{\}] +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Blade Runner\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Ridley Scott\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{1982} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Blade Runner 2049\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2017} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2021} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune 2\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2024} +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/658B3C918BF2C94DE2144EEE5F6DE349D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/658B3C918BF2C94DE2144EEE5F6DE349D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..6ca8d69 --- /dev/null +++ b/04_k8s/tp/_minted-main/658B3C918BF2C94DE2144EEE5F6DE349D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +./minikube\PYG{+w}{ }tunnel +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/74064A9F0E1D9C4B4988209D02E48DACD3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/74064A9F0E1D9C4B4988209D02E48DACD3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..54d0856 --- /dev/null +++ b/04_k8s/tp/_minted-main/74064A9F0E1D9C4B4988209D02E48DACD3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,8 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{c+c1}{\PYGZsh{} Installation de minikube} +curl\PYG{+w}{ }\PYGZhy{}Lo\PYG{+w}{ }minikube\PYG{+w}{ }https://storage.googleapis.com/minikube/releases/latest/minikube\PYGZhy{}linux\PYGZhy{}amd64 +chmod\PYG{+w}{ }+x\PYG{+w}{ }minikube + +\PYG{c+c1}{\PYGZsh{} Initialisation de minikube} +./minikube\PYG{+w}{ }start\PYG{+w}{ }\PYGZhy{}\PYGZhy{}driver\PYG{o}{=}docker +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/767455E59705960AC38A0064A7D13172D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/767455E59705960AC38A0064A7D13172D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..b9cd868 --- /dev/null +++ b/04_k8s/tp/_minted-main/767455E59705960AC38A0064A7D13172D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,4 @@ +\begin{Verbatim}[commandchars=\\\{\}] +git\PYG{+w}{ }clone\PYG{+w}{ }\PYG{l+s+se}{\PYGZbs{}} +\PYG{+w}{ }https://codefirst.iut.uca.fr/git/evrard.van\PYGZus{}espen/cours\PYGZus{}virtualisation\PYGZus{}avancee\PYGZus{}ETUD.git +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/853FDD9D00089DDEDB10E57FF69D06C0D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/853FDD9D00089DDEDB10E57FF69D06C0D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..908aab3 --- /dev/null +++ b/04_k8s/tp/_minted-main/853FDD9D00089DDEDB10E57FF69D06C0D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,5 @@ +\begin{Verbatim}[commandchars=\\\{\}] +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Blade Runner\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Ridley Scott\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{1982} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2021} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}ext\PYG{+w}{ }ip\PYGZgt{}:4000/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune 2\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2024} +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/88C346F74FE3AD10937FE74FA98D7669D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/88C346F74FE3AD10937FE74FA98D7669D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..a0f95f5 --- /dev/null +++ b/04_k8s/tp/_minted-main/88C346F74FE3AD10937FE74FA98D7669D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +vdn\PYGZhy{}start\PYG{+w}{ }\PYGZhy{}t\PYG{+w}{ }\PYGZhy{}n\PYG{+w}{ }docker\PYG{+w}{ }debian\PYGZhy{}1 +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/9C84F8B8D7F9EDB2F20424ADF9455636D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/9C84F8B8D7F9EDB2F20424ADF9455636D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..09d57ab --- /dev/null +++ b/04_k8s/tp/_minted-main/9C84F8B8D7F9EDB2F20424ADF9455636D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +curl\PYG{+w}{ }http://\PYGZlt{}external\PYG{+w}{ }ip\PYGZgt{} +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/9D7B41A790551872970781E61FACC09FD3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/9D7B41A790551872970781E61FACC09FD3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..2eb1521 --- /dev/null +++ b/04_k8s/tp/_minted-main/9D7B41A790551872970781E61FACC09FD3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +./minikube\PYG{+w}{ }status +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/A11BBF73A8018AA35D9D1A54A1DF65D5D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/A11BBF73A8018AA35D9D1A54A1DF65D5D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..abe39de --- /dev/null +++ b/04_k8s/tp/_minted-main/A11BBF73A8018AA35D9D1A54A1DF65D5D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +\PYG{n+nb}{export}\PYG{+w}{ }\PYG{n+nv}{no\PYGZus{}proxy}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}127.0.0.1,.vdn,localhost,192.168.49.1/24\PYGZdq{}} +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/A578BEE1A5EF01AFFE14A0F27D9356C9D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/A578BEE1A5EF01AFFE14A0F27D9356C9D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..07e57a6 --- /dev/null +++ b/04_k8s/tp/_minted-main/A578BEE1A5EF01AFFE14A0F27D9356C9D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,6 @@ +\begin{Verbatim}[commandchars=\\\{\}] +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}external\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Blade Runner\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Ridley Scott\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{1982} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}external\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Blade Runner 2049\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2017} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}external\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2021} +http\PYG{+w}{ }POST\PYG{+w}{ }\PYGZlt{}external\PYG{+w}{ }ip\PYGZgt{}:\PYGZlt{}port\PYGZgt{}/\PYG{+w}{ }\PYG{n+nv}{title}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Dune 2\PYGZdq{}}\PYG{+w}{ }\PYG{n+nv}{director}\PYG{o}{=}\PYG{l+s+s2}{\PYGZdq{}Denis Villeneuve\PYGZdq{}}\PYG{+w}{ }release\PYGZus{}year:\PYG{o}{=}\PYG{l+m}{2024} +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/C17CD8A94C589059CA10D7A63473CCA8D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/C17CD8A94C589059CA10D7A63473CCA8D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..a019824 --- /dev/null +++ b/04_k8s/tp/_minted-main/C17CD8A94C589059CA10D7A63473CCA8D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +passwd\PYG{+w}{ }\PYG{n+nb}{test} +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/C7A2CC8D5DE91B621B008AC3BF27D951D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/C7A2CC8D5DE91B621B008AC3BF27D951D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..52f59ee --- /dev/null +++ b/04_k8s/tp/_minted-main/C7A2CC8D5DE91B621B008AC3BF27D951D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,4 @@ +\begin{Verbatim}[commandchars=\\\{\}] +git\PYG{+w}{ }clone\PYG{+w}{ }\PYG{l+s+se}{\PYGZbs{}} +https://codefirst.iut.uca.fr/git/evrard.van\PYGZus{}espen/cours\PYGZus{}virtualisation\PYGZus{}avancee\PYGZus{}ETUD.git +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/C98A6337CA8E14BB6CF444A92D162512D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/C98A6337CA8E14BB6CF444A92D162512D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..9de8a4c --- /dev/null +++ b/04_k8s/tp/_minted-main/C98A6337CA8E14BB6CF444A92D162512D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +vdn\PYGZhy{}ssh\PYG{+w}{ }root@debian\PYGZhy{}1 +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/D99BBF78D3B1F430875F1FB77CB50E6FD3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/D99BBF78D3B1F430875F1FB77CB50E6FD3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..36e6e77 --- /dev/null +++ b/04_k8s/tp/_minted-main/D99BBF78D3B1F430875F1FB77CB50E6FD3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,3 @@ +\begin{Verbatim}[commandchars=\\\{\}] +minikube\PYG{+w}{ }status +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/EC4AECF9AB0FFA8FB7F75F4FAA9F5905D3773C8B440B993359565A23D713B17A.pygtex b/04_k8s/tp/_minted-main/EC4AECF9AB0FFA8FB7F75F4FAA9F5905D3773C8B440B993359565A23D713B17A.pygtex new file mode 100644 index 0000000..8016a88 --- /dev/null +++ b/04_k8s/tp/_minted-main/EC4AECF9AB0FFA8FB7F75F4FAA9F5905D3773C8B440B993359565A23D713B17A.pygtex @@ -0,0 +1,4 @@ +\begin{Verbatim}[commandchars=\\\{\}] +http\PYG{+w}{ }\PYG{l+m}{192}.168.49.2.nip.io/ +http\PYG{+w}{ }\PYG{l+m}{192}.168.49.2.nip.io/api +\end{Verbatim} diff --git a/04_k8s/tp/_minted-main/default.pygstyle b/04_k8s/tp/_minted-main/default.pygstyle new file mode 100644 index 0000000..962372e --- /dev/null +++ b/04_k8s/tp/_minted-main/default.pygstyle @@ -0,0 +1,102 @@ + +\makeatletter +\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax% + \let\PYG@ul=\relax \let\PYG@tc=\relax% + \let\PYG@bc=\relax \let\PYG@ff=\relax} +\def\PYG@tok#1{\csname PYG@tok@#1\endcsname} +\def\PYG@toks#1+{\ifx\relax#1\empty\else% + \PYG@tok{#1}\expandafter\PYG@toks\fi} +\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{% + \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}} +\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}} + +\@namedef{PYG@tok@w}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}} +\@namedef{PYG@tok@c}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} +\@namedef{PYG@tok@cp}{\def\PYG@tc##1{\textcolor[rgb]{0.61,0.40,0.00}{##1}}} +\@namedef{PYG@tok@k}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@kp}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@kt}{\def\PYG@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}} +\@namedef{PYG@tok@o}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@ow}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}} +\@namedef{PYG@tok@nb}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@nf}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} +\@namedef{PYG@tok@nc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} +\@namedef{PYG@tok@nn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} +\@namedef{PYG@tok@ne}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.80,0.25,0.22}{##1}}} +\@namedef{PYG@tok@nv}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@no}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}} +\@namedef{PYG@tok@nl}{\def\PYG@tc##1{\textcolor[rgb]{0.46,0.46,0.00}{##1}}} +\@namedef{PYG@tok@ni}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}} +\@namedef{PYG@tok@na}{\def\PYG@tc##1{\textcolor[rgb]{0.41,0.47,0.13}{##1}}} +\@namedef{PYG@tok@nt}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@nd}{\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}} +\@namedef{PYG@tok@s}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@sd}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@si}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}} +\@namedef{PYG@tok@se}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.36,0.12}{##1}}} +\@namedef{PYG@tok@sr}{\def\PYG@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}} +\@namedef{PYG@tok@ss}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@sx}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@m}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@gh}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} +\@namedef{PYG@tok@gu}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}} +\@namedef{PYG@tok@gd}{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}} +\@namedef{PYG@tok@gi}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.52,0.00}{##1}}} +\@namedef{PYG@tok@gr}{\def\PYG@tc##1{\textcolor[rgb]{0.89,0.00,0.00}{##1}}} +\@namedef{PYG@tok@ge}{\let\PYG@it=\textit} +\@namedef{PYG@tok@gs}{\let\PYG@bf=\textbf} +\@namedef{PYG@tok@ges}{\let\PYG@bf=\textbf\let\PYG@it=\textit} +\@namedef{PYG@tok@gp}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} +\@namedef{PYG@tok@go}{\def\PYG@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}} +\@namedef{PYG@tok@gt}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}} +\@namedef{PYG@tok@err}{\def\PYG@bc##1{{\setlength{\fboxsep}{\string -\fboxrule}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}} +\@namedef{PYG@tok@kc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@kd}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@kn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@kr}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@bp}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} +\@namedef{PYG@tok@fm}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} +\@namedef{PYG@tok@vc}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@vg}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@vi}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@vm}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} +\@namedef{PYG@tok@sa}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@sb}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@sc}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@dl}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@s2}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@sh}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@s1}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} +\@namedef{PYG@tok@mb}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@mf}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@mh}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@mi}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@il}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@mo}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} +\@namedef{PYG@tok@ch}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} +\@namedef{PYG@tok@cm}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} +\@namedef{PYG@tok@cpf}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} +\@namedef{PYG@tok@c1}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} +\@namedef{PYG@tok@cs}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}} + +\def\PYGZbs{\char`\\} +\def\PYGZus{\char`\_} +\def\PYGZob{\char`\{} +\def\PYGZcb{\char`\}} +\def\PYGZca{\char`\^} +\def\PYGZam{\char`\&} +\def\PYGZlt{\char`\<} +\def\PYGZgt{\char`\>} +\def\PYGZsh{\char`\#} +\def\PYGZpc{\char`\%} +\def\PYGZdl{\char`\$} +\def\PYGZhy{\char`\-} +\def\PYGZsq{\char`\'} +\def\PYGZdq{\char`\"} +\def\PYGZti{\char`\~} +% for compatibility with earlier versions +\def\PYGZat{@} +\def\PYGZlb{[} +\def\PYGZrb{]} +\makeatother + diff --git a/04_k8s/tp/archi.drawio b/04_k8s/tp/archi.drawio new file mode 100644 index 0000000..b978df5 --- /dev/null +++ b/04_k8s/tp/archi.drawio @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/04_k8s/tp/archi.png b/04_k8s/tp/archi.png new file mode 100644 index 0000000..f9eee0f Binary files /dev/null and b/04_k8s/tp/archi.png differ diff --git a/04_k8s/tp/main.org b/04_k8s/tp/main.org new file mode 100644 index 0000000..10fe8a5 --- /dev/null +++ b/04_k8s/tp/main.org @@ -0,0 +1,180 @@ +#+TITLE: TP1 - Cours de virtualisation avancée - /Kubernetes/, dernier TP +#+OPTIONS: toc:nil date:nil author:nil +#+LATEX_CLASS: article +#+LATEX_CLASS_OPTIONS: [12pt,a4paper] +#+LATEX_HEADER: \usepackage[a4paper,margin=0.5in]{geometry} +#+LATEX_HEADER: \usepackage[utf8]{inputenc} +#+LATEX_HEADER: \usepackage[inkscapelatex=false]{svg} +#+LATEX_HEADER: \usepackage[sfdefault]{AlegreyaSans} +#+LATEX_HEADER: \usepackage{multicol} +#+LATEX_HEADER: \usepackage{minted} +#+LATEX_HEADER: \usepackage{float} +#+LATEX_HEADER: \usepackage{tikz} +#+LATEX_HEADER: \usetikzlibrary{positioning} +#+LATEX_HEADER: \renewcommand\listingscaption{Exemple de code} +#+LATEX_HEADER: \usepackage[tikz]{bclogo} +#+LATEX_HEADER: \usepackage{tcolorbox} +#+LATEX_HEADER: \tcbuselibrary{skins} +#+LATEX_HEADER: \usepackage{ragged2e} +#+LATEX_HEADER: \usepackage{environ} + +#+BEGIN_EXPORT latex +\NewEnviron{warning}% + {\begin{center}% + \begin{tcolorbox}[notitle, + colback=orange!5!white, + colbacklower=white, + frame hidden, + boxrule=0pt, + bicolor, + sharp corners, + borderline west={4pt}{0pt}{orange!50!black}, + fontupper=\sffamily] + \textcolor{orange!50!black}{ + \sffamily + \textbf{Attention:\\}% + }% + \BODY + \end{tcolorbox} + \end{center}% + } + +\NewEnviron{good}% + {\begin{center}% + \begin{tcolorbox}[notitle, + colback=green!5!white, + colbacklower=white, + frame hidden, + boxrule=0pt, + bicolor, + sharp corners, + borderline west={4pt}{0pt}{green!50!black}, + fontupper=\sffamily] + \textcolor{green!50!black}{ + \sffamily + }% + \BODY + \end{tcolorbox} + \end{center}% + } +#+END_EXPORT + +#+BEGIN_warning +Comme pour les autres TPs, vous allez travailler dans une machine virtuelle VDN. + +\medskip + +N'oubliez pas de lancer \\ +~export no_proxy="127.0.0.1,.vdn,localhost,10.96.0.0/12,192.168.49.2.nip.io"~ \\ +à chaque connexion =ssh= ! + +\medskip + +Pour lancer /Minikube/, lancez la commande =./minikube start= (attention vous aviez probablement laissé les binaires =minikube= et =kubectl= dans le dossier du TP2). + +\medskip + +N'oubliez pas aussi de laisser un autre terminal tourner avec la commande =minikube tunnel= ;) +#+END_warning + +#+BEGIN_warning +Installez l'outil =httpie=: =sudo apt install -y httpie=. + +Il s'agit d'un outil similaire à =curl= mais plus agréable à utiliser +#+END_warning + +L'objectif de ce TP est de finir le travail commencé la semaine dernière et de tester de nouvelles choses. + +La base de données que vous avez déployé est une simple /API REST/ qui reçoit et retourne une liste de films au format /json/. +Voici une commande permettant d'ajouter quelques films à la base: +#+BEGIN_SRC bash +http POST :/ title="Blade Runner" director="Ridley Scott" release_year:=1982 +http POST :/ title="Dune" director="Denis Villeneuve" release_year:=2021 +http POST :/ title="Dune 2" director="Denis Villeneuve" release_year:=2024 +#+END_SRC + +* Une base de données sans stockage +Déployez le fichier =without_storage.yaml=. +Il contient les déploiements et services de la base de données et de l'application. + +Une fois le fichier déployé, vérifier que les /pods/ sont bien en cours d’exécution. + +Ensuite, lancez la commande =http :4000=. +Vous devriez avoir une sortie telle que : +#+BEGIN_EXAMPLE +HTTP/1.1 200 OK +content-length: 2 +content-type: application/json +date: Wed, 05 Jun 2024 07:21:34 GMT +x-servedby: database-85bddd5ddc-c4fm7 + +[] +#+END_EXAMPLE + +Notez que la valeur de =x-servedby= change d'une requête à l'autre. +Cela montre que le /Service/ /LoadBalancer/ redirige bien le trafic vers les différents /pods/. +La sortie =[]= indique que la liste est vide. + +Maintenant, lancez les commandes : +#+BEGIN_SRC bash +http POST :4000/ title="Blade Runner" director="Ridley Scott" release_year:=1982 +http POST :4000/ title="Dune" director="Denis Villeneuve" release_year:=2021 +http POST :4000/ title="Dune 2" director="Denis Villeneuve" release_year:=2024 +#+END_SRC + +Cela va ajouter des films dans la base de données. + +Maintenant, relancez la commande =http :4000= plusieurs fois. +Vous verrez que les films ne sont pas présents dans toutes les réponses car les requêtes =POST= ont été dirigées vers différents /pods/. + +* Votre travail de la semaine dernière +Si vous aviez fini le TP la semaine dernière, passez à la partie suivante. + +Sinon continuez le. +Si vous le souhaitez, vous pouvez vous baser le fichier =without_storage.yaml= et y ajouter : +- /ConfigMap/ +- /PersistentVolume/ +- /PersistentVolumeClaim/ +- montage du /PVC/ dans les /pods/ du déploiement + +* /Ingress/ +#+BEGIN_warning +Avant tout, lancez la commande =minikube addons enable ingress= qui permet l'utilisation des /Ingress/ dans /minikube/. + +N'oubliez pas aussi \\ +~export no_proxy="127.0.0.1,.vdn,localhost,10.96.0.0/12,192.168.49.2.nip.io"~ \\ + +*Attention à ne pas utiliser la commande des précédents TPs car elle ne contient pas l'exclusion pour =192.168.49.2.nip.io=*. +#+END_warning + +Déployez maintenant un /Ingress/ permettant l'accès à l'application. + +Configurez votre /Ingress/ pour que le chemin =/= arrive sur l'application et le chemin =/api= arrive sur la base de données. + +Lors de la configuration de l'/Ingress/, utilisez =192.168.49.2.nip.io= *comme nom de domaine*. +Il s'agit d'un domaine résolvant vers l'adresse =192.168.49.2=, qui est l'adresse de /minikube/ dans votre machine virtuelle. + +Vérifiez le fonctionnement avec ces commandes : +#+BEGIN_SRC bash +http 192.168.49.2.nip.io/ +http 192.168.49.2.nip.io/api +#+END_SRC + +* Déploiement /Canary/ +Créez maintenant un déploiement identique à celui de l'application mais qui utilise l'image \\ +=evanespen/application:claque= et un nombre de /replicas/ à 1. + +Ne changez pas les valeurs de =template.metadata.labels.app= sinon ce nouveau déploiement ne sera pas géré par le /LoadBalancer/. + +Ouvrez =192.168.49.2.nip.io= dans un navigateur *dans la machine virtuelle* (donc en vous connectant avec =ssh -X=). +Rechargez la page plusieurs fois, *avec =Ctrl+Shift+R=* pour ignorer le cache, et constatez ! + +* Aide +Référez vous au cours et à ces documentations pour y parvenir (ce sont bien des liens): +- [[https://kubernetes.io/fr/docs/concepts/services-networking/service/][/Service/]] +- [[https://kubernetes.io/docs/concepts/workloads/pods/][/Pod/]] +- [[https://kubernetes.io/docs/concepts/workloads/controllers/deployment/][/Deployment/]] +- [[https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/][/PV/ et /PVC/]] +- [[https://kubernetes.io/fr/docs/concepts/services-networking/ingress/][/Ingress/]] + +Amusez vous bien ;) diff --git a/04_k8s/tp/main.pdf b/04_k8s/tp/main.pdf new file mode 100644 index 0000000..c5c2fea Binary files /dev/null and b/04_k8s/tp/main.pdf differ diff --git a/04_k8s/tp/main.tex b/04_k8s/tp/main.tex new file mode 100644 index 0000000..1ae16ff --- /dev/null +++ b/04_k8s/tp/main.tex @@ -0,0 +1,210 @@ +% Created 2024-06-05 mer. 10:04 +% Intended LaTeX compiler: pdflatex +\documentclass[12pt,a4paper]{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{graphicx} +\usepackage{longtable} +\usepackage{wrapfig} +\usepackage{rotating} +\usepackage[normalem]{ulem} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{capt-of} +\usepackage{hyperref} +\usepackage{minted} +\usepackage[a4paper,margin=0.5in]{geometry} +\usepackage[utf8]{inputenc} +\usepackage[inkscapelatex=false]{svg} +\usepackage[sfdefault]{AlegreyaSans} +\usepackage{multicol} +\usepackage{minted} +\usepackage{float} +\usepackage{tikz} +\usetikzlibrary{positioning} +\renewcommand\listingscaption{Exemple de code} +\usepackage[tikz]{bclogo} +\usepackage{tcolorbox} +\tcbuselibrary{skins} +\usepackage{ragged2e} +\usepackage{environ} +\date{} +\title{TP1 - Cours de virtualisation avancée - \emph{Kubernetes}, dernier TP} +\hypersetup{ + pdfauthor={Evrard Van Espen}, + pdftitle={TP1 - Cours de virtualisation avancée - \emph{Kubernetes}, dernier TP}, + pdfkeywords={}, + pdfsubject={}, + pdfcreator={Emacs 30.0.50 (Org mode 9.6.15)}, + pdflang={English}} +\begin{document} + +\maketitle +\NewEnviron{warning}% + {\begin{center}% + \begin{tcolorbox}[notitle, + colback=orange!5!white, + colbacklower=white, + frame hidden, + boxrule=0pt, + bicolor, + sharp corners, + borderline west={4pt}{0pt}{orange!50!black}, + fontupper=\sffamily] + \textcolor{orange!50!black}{ + \sffamily + \textbf{Attention:\\}% + }% + \BODY + \end{tcolorbox} + \end{center}% + } + +\NewEnviron{good}% + {\begin{center}% + \begin{tcolorbox}[notitle, + colback=green!5!white, + colbacklower=white, + frame hidden, + boxrule=0pt, + bicolor, + sharp corners, + borderline west={4pt}{0pt}{green!50!black}, + fontupper=\sffamily] + \textcolor{green!50!black}{ + \sffamily + }% + \BODY + \end{tcolorbox} + \end{center}% + } + +\begin{warning} +Comme pour les autres TPs, vous allez travailler dans une machine virtuelle VDN. + +\medskip + +N'oubliez pas de lancer \\[0pt] +\texttt{export no\_proxy="127.0.0.1,.vdn,localhost,10.96.0.0/12,192.168.49.2.nip.io"} \\[0pt] +à chaque connexion \texttt{ssh} ! + +\medskip + +Pour lancer \emph{Minikube}, lancez la commande \texttt{./minikube start} (attention vous aviez probablement laissé les binaires \texttt{minikube} et \texttt{kubectl} dans le dossier du TP2). + +\medskip + +N'oubliez pas aussi de laisser un autre terminal tourner avec la commande \texttt{minikube tunnel} ;) +\end{warning} + +\begin{warning} +Installez l'outil \texttt{httpie}: \texttt{sudo apt install -y httpie}. + +Il s'agit d'un outil similaire à \texttt{curl} mais plus agréable à utiliser +\end{warning} + +L'objectif de ce TP est de finir le travail commencé la semaine dernière et de tester de nouvelles choses. + +La base de données que vous avez déployé est une simple \emph{API REST} qui reçoit et retourne une liste de films au format \emph{json}. +Voici une commande permettant d'ajouter quelques films à la base: +\begin{minted}[]{bash} +http POST :/ title="Blade Runner" director="Ridley Scott" release_year:=1982 +http POST :/ title="Dune" director="Denis Villeneuve" release_year:=2021 +http POST :/ title="Dune 2" director="Denis Villeneuve" release_year:=2024 +\end{minted} + +\section{Une base de données sans stockage} +\label{sec:orge95a53d} +Déployez le fichier \texttt{without\_storage.yaml}. +Il contient les déploiements et services de la base de données et de l'application. + +Une fois le fichier déployé, vérifier que les \emph{pods} sont bien en cours d’exécution. + +Ensuite, lancez la commande \texttt{http :4000}. +Vous devriez avoir une sortie telle que : +\begin{verbatim} +HTTP/1.1 200 OK +content-length: 2 +content-type: application/json +date: Wed, 05 Jun 2024 07:21:34 GMT +x-servedby: database-85bddd5ddc-c4fm7 + +[] +\end{verbatim} + +Notez que la valeur de \texttt{x-servedby} change d'une requête à l'autre. +Cela montre que le \emph{Service} \emph{LoadBalancer} redirige bien le trafic vers les différents \emph{pods}. +La sortie \texttt{[]} indique que la liste est vide. + +Maintenant, lancez les commandes : +\begin{minted}[]{bash} +http POST :4000/ title="Blade Runner" director="Ridley Scott" release_year:=1982 +http POST :4000/ title="Dune" director="Denis Villeneuve" release_year:=2021 +http POST :4000/ title="Dune 2" director="Denis Villeneuve" release_year:=2024 +\end{minted} + +Cela va ajouter des films dans la base de données. + +Maintenant, relancez la commande \texttt{http :4000} plusieurs fois. +Vous verrez que les films ne sont pas présents dans toutes les réponses car les requêtes \texttt{POST} ont été dirigées vers différents \emph{pods}. + +\section{Votre travail de la semaine dernière} +\label{sec:org59acb8b} +Si vous aviez fini le TP la semaine dernière, passez à la partie suivante. + +Sinon continuez le. +Si vous le souhaitez, vous pouvez vous baser le fichier \texttt{without\_storage.yaml} et y ajouter : +\begin{itemize} +\item \emph{ConfigMap} +\item \emph{PersistentVolume} +\item \emph{PersistentVolumeClaim} +\item montage du \emph{PVC} dans les \emph{pods} du déploiement +\end{itemize} + +\section{\emph{Ingress}} +\label{sec:orgc44da1d} +\begin{warning} +Avant tout, lancez la commande \texttt{minikube addons enable ingress} qui permet l'utilisation des \emph{Ingress} dans \emph{minikube}. + +N'oubliez pas aussi \\[0pt] +\texttt{export no\_proxy="127.0.0.1,.vdn,localhost,10.96.0.0/12,192.168.49.2.nip.io"} \\[0pt] + +\textbf{Attention à ne pas utiliser la commande des précédents TPs car elle ne contient pas l'exclusion pour \texttt{192.168.49.2.nip.io}}. +\end{warning} + +Déployez maintenant un \emph{Ingress} permettant l'accès à l'application. + +Configurez votre \emph{Ingress} pour que le chemin \texttt{/} arrive sur l'application et le chemin \texttt{/api} arrive sur la base de données. + +Lors de la configuration de l'\emph{Ingress}, utilisez \texttt{192.168.49.2.nip.io} \textbf{comme nom de domaine}. +Il s'agit d'un domaine résolvant vers l'adresse \texttt{192.168.49.2}, qui est l'adresse de \emph{minikube} dans votre machine virtuelle. + +Vérifiez le fonctionnement avec ces commandes : +\begin{minted}[]{bash} +http 192.168.49.2.nip.io/ +http 192.168.49.2.nip.io/api +\end{minted} + +\section{Déploiement \emph{Canary}} +\label{sec:org485e115} +Créez maintenant un déploiement identique à celui de l'application mais qui utilise l'image \\[0pt] +\texttt{evanespen/application:claque} et un nombre de \emph{replicas} à 1. + +Ne changez pas les valeurs de \texttt{template.metadata.labels.app} sinon ce nouveau déploiement ne sera pas géré par le \emph{LoadBalancer}. + +Ouvrez \texttt{192.168.49.2.nip.io} dans un navigateur \textbf{dans la machine virtuelle} (donc en vous connectant avec \texttt{ssh -X}). +Rechargez la page plusieurs fois, \textbf{avec \texttt{Ctrl+Shift+R}} pour ignorer le cache, et constatez ! + +\section{Aide} +\label{sec:orgdbe80a5} +Référez vous au cours et à ces documentations pour y parvenir (ce sont bien des liens): +\begin{itemize} +\item \href{https://kubernetes.io/fr/docs/concepts/services-networking/service/}{\emph{Service}} +\item \href{https://kubernetes.io/docs/concepts/workloads/pods/}{\emph{Pod}} +\item \href{https://kubernetes.io/docs/concepts/workloads/controllers/deployment/}{\emph{Deployment}} +\item \href{https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/}{\emph{PV} et \emph{PVC}} +\item \href{https://kubernetes.io/fr/docs/concepts/services-networking/ingress/}{\emph{Ingress}} +\end{itemize} + +Amusez vous bien ;) +\end{document} diff --git a/04_k8s/tp/ressources/database/#Dockerfile# b/04_k8s/tp/ressources/database/#Dockerfile# new file mode 100644 index 0000000..fe55932 --- /dev/null +++ b/04_k8s/tp/ressources/database/#Dockerfile# @@ -0,0 +1,11 @@ +FROM rust as builder + +WORKDIR /build +COPY . . + +RUN cargo build --release + +RUN apt update && \ + apt install -y toto toto toto toto toto && \ + compile && \ + apt remove toto toto toto toto toto diff --git a/04_k8s/tp/ressources/database/.#Dockerfile b/04_k8s/tp/ressources/database/.#Dockerfile new file mode 120000 index 0000000..a55bc83 --- /dev/null +++ b/04_k8s/tp/ressources/database/.#Dockerfile @@ -0,0 +1 @@ +evrardve@orion.1250:1717489275 \ No newline at end of file diff --git a/04_k8s/tp/ressources/database/.dockerignore b/04_k8s/tp/ressources/database/.dockerignore new file mode 100644 index 0000000..3a4e4e1 --- /dev/null +++ b/04_k8s/tp/ressources/database/.dockerignore @@ -0,0 +1,3 @@ +Dockerfile +storage +target \ No newline at end of file diff --git a/04_k8s/tp/ressources/database/.gitignore b/04_k8s/tp/ressources/database/.gitignore new file mode 100644 index 0000000..eb5a316 --- /dev/null +++ b/04_k8s/tp/ressources/database/.gitignore @@ -0,0 +1 @@ +target diff --git a/04_k8s/tp/ressources/database/.idea/.gitignore b/04_k8s/tp/ressources/database/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/04_k8s/tp/ressources/database/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/04_k8s/tp/ressources/database/.idea/database.iml b/04_k8s/tp/ressources/database/.idea/database.iml new file mode 100644 index 0000000..cf84ae4 --- /dev/null +++ b/04_k8s/tp/ressources/database/.idea/database.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/04_k8s/tp/ressources/database/.idea/modules.xml b/04_k8s/tp/ressources/database/.idea/modules.xml new file mode 100644 index 0000000..2a103ea --- /dev/null +++ b/04_k8s/tp/ressources/database/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/04_k8s/tp/ressources/database/.idea/vcs.xml b/04_k8s/tp/ressources/database/.idea/vcs.xml new file mode 100644 index 0000000..4fce1d8 --- /dev/null +++ b/04_k8s/tp/ressources/database/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/04_k8s/tp/ressources/database/Cargo.lock b/04_k8s/tp/ressources/database/Cargo.lock new file mode 100644 index 0000000..9765dd4 --- /dev/null +++ b/04_k8s/tp/ressources/database/Cargo.lock @@ -0,0 +1,1446 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "actix-codec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-sink", + "memchr", + "pin-project-lite", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "actix-http" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb9843d84c775696c37d9a418bbb01b932629d01870722c0f13eb3f95e2536d" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "ahash", + "base64", + "bitflags", + "brotli", + "bytes", + "bytestring", + "derive_more", + "encoding_rs", + "flate2", + "futures-core", + "h2", + "http", + "httparse", + "httpdate", + "itoa", + "language-tags", + "local-channel", + "mime", + "percent-encoding", + "pin-project-lite", + "rand", + "sha1", + "smallvec", + "tokio", + "tokio-util", + "tracing", + "zstd", +] + +[[package]] +name = "actix-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" +dependencies = [ + "quote", + "syn 2.0.66", +] + +[[package]] +name = "actix-router" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" +dependencies = [ + "bytestring", + "cfg-if", + "http", + "regex", + "regex-lite", + "serde", + "tracing", +] + +[[package]] +name = "actix-rt" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" +dependencies = [ + "futures-core", + "tokio", +] + +[[package]] +name = "actix-server" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb13e7eef0423ea6eab0e59f6c72e7cb46d33691ad56a726b3cd07ddec2c2d4" +dependencies = [ + "actix-rt", + "actix-service", + "actix-utils", + "futures-core", + "futures-util", + "mio", + "socket2", + "tokio", + "tracing", +] + +[[package]] +name = "actix-service" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" +dependencies = [ + "futures-core", + "paste", + "pin-project-lite", +] + +[[package]] +name = "actix-utils" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" +dependencies = [ + "local-waker", + "pin-project-lite", +] + +[[package]] +name = "actix-web" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1cf67dadb19d7c95e5a299e2dda24193b89d5d4f33a3b9800888ede9e19aa32" +dependencies = [ + "actix-codec", + "actix-http", + "actix-macros", + "actix-router", + "actix-rt", + "actix-server", + "actix-service", + "actix-utils", + "actix-web-codegen", + "ahash", + "bytes", + "bytestring", + "cfg-if", + "cookie", + "derive_more", + "encoding_rs", + "futures-core", + "futures-util", + "itoa", + "language-tags", + "log", + "mime", + "once_cell", + "pin-project-lite", + "regex", + "regex-lite", + "serde", + "serde_json", + "serde_urlencoded", + "smallvec", + "socket2", + "time", + "url", +] + +[[package]] +name = "actix-web-codegen" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1f50ebbb30eca122b188319a4398b3f7bb4a8cdf50ecfb73bfc6a3c3ce54f5" +dependencies = [ + "actix-router", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "brotli" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6221fe77a248b9117d431ad93761222e1cf8ff282d9d1d5d9f53d6299a1cf76" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "bytestring" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" +dependencies = [ + "bytes", +] + +[[package]] +name = "cc" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +dependencies = [ + "jobserver", + "libc", + "once_cell", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "database" +version = "0.1.0" +dependencies = [ + "actix-web", + "anyhow", + "env_logger", + "gethostname", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] + +[[package]] +name = "language-tags" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "local-channel" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" +dependencies = [ + "futures-core", + "futures-sink", + "local-waker", +] + +[[package]] +name = "local-waker" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.5", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "serde_json" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "zstd" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.10+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/04_k8s/tp/ressources/database/Cargo.toml b/04_k8s/tp/ressources/database/Cargo.toml new file mode 100644 index 0000000..e068c37 --- /dev/null +++ b/04_k8s/tp/ressources/database/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "database" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +actix-web = "4" +serde = { version = "1.0.203", features = ["derive"] } +serde_json = "1.0.117" +anyhow = "1.0.86" +env_logger = "0.11.3" +log = "0.4.21" +gethostname = "0.4.3" diff --git a/04_k8s/tp/ressources/database/Dockerfile b/04_k8s/tp/ressources/database/Dockerfile new file mode 100644 index 0000000..04afb68 --- /dev/null +++ b/04_k8s/tp/ressources/database/Dockerfile @@ -0,0 +1,22 @@ +FROM rust as builder + +WORKDIR /build +COPY . . + +RUN pwd +RUN ls + +RUN cargo build --release +RUN pwd +RUN ls + +FROM debian + +WORKDIR /root +COPY --from=builder /build/target/release/database . +RUN ls -lh + +ENV PORT='' +ENV STORAGE_DIR='' + +CMD ["./database"] diff --git a/04_k8s/tp/ressources/database/src/main.rs b/04_k8s/tp/ressources/database/src/main.rs new file mode 100644 index 0000000..0a6fa01 --- /dev/null +++ b/04_k8s/tp/ressources/database/src/main.rs @@ -0,0 +1,125 @@ +use log::{info}; +use std::env; +use std::fs; + +use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder, middleware::Logger}; +use actix_web::error::HttpError; +use serde::{Deserialize, Serialize}; +use serde_json; +use gethostname::gethostname; + +#[derive(Serialize, Deserialize, Debug)] +struct Movie { + title: String, + director: String, + release_year: u16, +} + +fn gen_error_message(error: &str) -> String { + let hostname = gethostname().into_string().unwrap(); + format!("[served by {}], {}", hostname, error) +} + +fn get_storage_file() -> String { + let storage_dir: String = match env::var("STORAGE_DIR") { + Ok(storage_dir) => storage_dir, + Err(_) => panic!("You must set STORAGE_DIR env var") + }; + + // fs::create_dir_all(storage_dir).expect("unable to create storage directory"); + + match storage_dir.chars().last().unwrap() { + '/' => storage_dir + "storage.json", + _ => storage_dir + "/storage.json", + } +} + +fn get_all_from_storage() -> anyhow::Result> { + let raw_data = match fs::read_to_string(get_storage_file()) { + Ok(raw_data) => raw_data, + Err(e) => { + fs::write(get_storage_file(), "[]").expect("Unable to write file"); + "[]".to_string() + } + }; + let movies: Vec = serde_json::from_str(&raw_data)?; + Ok(movies) +} + +fn write_to_storage(movies: Vec) -> anyhow::Result<()> { + let data = serde_json::to_string_pretty(&movies).expect("Failed to serialize movies."); + fs::write(get_storage_file(), data).expect("Unable to write file"); + Ok(()) +} + +#[get("/")] +async fn get_all() -> Result { + let hostname = gethostname().into_string().unwrap(); + match get_all_from_storage() { + Ok(movies) => return Ok(HttpResponse::Ok().insert_header(("X-ServedBy", hostname)).json(movies)), + Err(_) => return Ok(HttpResponse::InternalServerError().body(gen_error_message("storage file not found at 'storage/storage.json'"))) + } + +} + +#[get("/{title}")] +async fn get_one(title: web::Path) -> Result { + let hostname = gethostname().into_string().unwrap(); + return match get_all_from_storage() { + Ok(movies) => { + for movie in movies { + if movie.title.to_lowercase().replace(' ', "") == title.to_string().to_lowercase().replace(' ', "") { + return Ok(HttpResponse::Ok().insert_header(("X-ServedBy", hostname)).json(movie)); + } + } + + Ok(HttpResponse::NotFound().insert_header(("X-ServedBy", hostname)).body(format!("Movie '{}' not found", title))) + }, + Err(_) => return Ok(HttpResponse::InternalServerError().body(gen_error_message("storage file not found at 'storage/storage.json'"))) + } +} + +#[post("/")] +async fn insert(new_movie: web::Json) -> Result { + let hostname = gethostname().into_string().unwrap(); + let mut movies: Vec; + match get_all_from_storage() { + Ok(_movies) => movies = _movies, + Err(_) => movies = vec!() + }; + + for movie in &movies { + if movie.title.to_lowercase().replace(' ', "") == new_movie.title.to_string().to_lowercase().replace(' ', "") { + return Ok(HttpResponse::BadRequest().body(gen_error_message(format!("Movie '{}' already exists", new_movie.title).as_str()))) + } + } + + movies.push(new_movie.into_inner()); + + write_to_storage(movies); + + Ok(HttpResponse::Created().insert_header(("X-ServedBy", hostname)).body("Created")) +} + +#[actix_web::main] +async fn main() -> std::io::Result<()> { + env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); + + let port: u16 = match env::var("PORT") { + Ok(port) => port.parse().unwrap(), + Err(_) => panic!("You must set PORT env var") + }; + + info!("App started on port {}", port); + + HttpServer::new(|| { + App::new() + .wrap(Logger::new("%a \"%r\" %s b %T")) + .service(get_all) + .service(get_one) + .service(insert) + }) + .bind(("0.0.0.0", port))? + .run() + .await +} diff --git a/04_k8s/tp/ressources/database/storage/storage.json b/04_k8s/tp/ressources/database/storage/storage.json new file mode 100644 index 0000000..de55a73 --- /dev/null +++ b/04_k8s/tp/ressources/database/storage/storage.json @@ -0,0 +1,12 @@ +[ + { + "title": "toto3", + "director": "toto", + "release_year": 2020 + }, + { + "title": "toto2", + "director": "toto", + "release_year": 2020 + } +] \ No newline at end of file diff --git a/04_k8s/tp/ressources/front/.dockerignore b/04_k8s/tp/ressources/front/.dockerignore new file mode 100644 index 0000000..3a4e4e1 --- /dev/null +++ b/04_k8s/tp/ressources/front/.dockerignore @@ -0,0 +1,3 @@ +Dockerfile +storage +target \ No newline at end of file diff --git a/04_k8s/tp/ressources/front/.gitignore b/04_k8s/tp/ressources/front/.gitignore new file mode 100644 index 0000000..eb5a316 --- /dev/null +++ b/04_k8s/tp/ressources/front/.gitignore @@ -0,0 +1 @@ +target diff --git a/04_k8s/tp/ressources/front/Cargo.lock b/04_k8s/tp/ressources/front/Cargo.lock new file mode 100644 index 0000000..32b16fa --- /dev/null +++ b/04_k8s/tp/ressources/front/Cargo.lock @@ -0,0 +1,2036 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "actix-codec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a" +dependencies = [ + "bitflags 2.5.0", + "bytes", + "futures-core", + "futures-sink", + "memchr", + "pin-project-lite", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "actix-http" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb9843d84c775696c37d9a418bbb01b932629d01870722c0f13eb3f95e2536d" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "ahash", + "base64", + "bitflags 2.5.0", + "brotli", + "bytes", + "bytestring", + "derive_more", + "encoding_rs", + "flate2", + "futures-core", + "h2", + "http 0.2.12", + "httparse", + "httpdate", + "itoa", + "language-tags", + "local-channel", + "mime", + "percent-encoding", + "pin-project-lite", + "rand", + "sha1", + "smallvec", + "tokio", + "tokio-util", + "tracing", + "zstd", +] + +[[package]] +name = "actix-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" +dependencies = [ + "quote", + "syn 2.0.66", +] + +[[package]] +name = "actix-router" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d324164c51f63867b57e73ba5936ea151b8a41a1d23d1031eeb9f70d0236f8" +dependencies = [ + "bytestring", + "cfg-if", + "http 0.2.12", + "regex", + "regex-lite", + "serde", + "tracing", +] + +[[package]] +name = "actix-rt" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" +dependencies = [ + "futures-core", + "tokio", +] + +[[package]] +name = "actix-server" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb13e7eef0423ea6eab0e59f6c72e7cb46d33691ad56a726b3cd07ddec2c2d4" +dependencies = [ + "actix-rt", + "actix-service", + "actix-utils", + "futures-core", + "futures-util", + "mio", + "socket2", + "tokio", + "tracing", +] + +[[package]] +name = "actix-service" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" +dependencies = [ + "futures-core", + "paste", + "pin-project-lite", +] + +[[package]] +name = "actix-tls" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac453898d866cdbecdbc2334fe1738c747b4eba14a677261f2b768ba05329389" +dependencies = [ + "actix-rt", + "actix-service", + "actix-utils", + "futures-core", + "http 0.2.12", + "http 1.1.0", + "impl-more", + "pin-project-lite", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "actix-utils" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" +dependencies = [ + "local-waker", + "pin-project-lite", +] + +[[package]] +name = "actix-web" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1cf67dadb19d7c95e5a299e2dda24193b89d5d4f33a3b9800888ede9e19aa32" +dependencies = [ + "actix-codec", + "actix-http", + "actix-macros", + "actix-router", + "actix-rt", + "actix-server", + "actix-service", + "actix-utils", + "actix-web-codegen", + "ahash", + "bytes", + "bytestring", + "cfg-if", + "cookie", + "derive_more", + "encoding_rs", + "futures-core", + "futures-util", + "itoa", + "language-tags", + "log", + "mime", + "once_cell", + "pin-project-lite", + "regex", + "regex-lite", + "serde", + "serde_json", + "serde_urlencoded", + "smallvec", + "socket2", + "time", + "url", +] + +[[package]] +name = "actix-web-codegen" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1f50ebbb30eca122b188319a4398b3f7bb4a8cdf50ecfb73bfc6a3c3ce54f5" +dependencies = [ + "actix-router", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "application" +version = "0.1.0" +dependencies = [ + "actix-web", + "anyhow", + "awc", + "env_logger", + "gethostname", + "log", + "serde", + "serde_json", + "tera", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "awc" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6b67e44fb95d1dc9467e3930383e115f9b4ed60ca689db41409284e967a12d" +dependencies = [ + "actix-codec", + "actix-http", + "actix-rt", + "actix-service", + "actix-tls", + "actix-utils", + "base64", + "bytes", + "cfg-if", + "cookie", + "derive_more", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "itoa", + "log", + "mime", + "percent-encoding", + "pin-project-lite", + "rand", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", +] + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "brotli" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bstr" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "bytestring" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" +dependencies = [ + "bytes", +] + +[[package]] +name = "cc" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +dependencies = [ + "jobserver", + "libc", + "once_cell", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "windows-targets 0.52.5", +] + +[[package]] +name = "chrono-tz" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "deunicode" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "globset" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "globwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +dependencies = [ + "bitflags 1.3.2", + "ignore", + "walkdir", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humansize" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +dependencies = [ + "libm", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "ignore" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "impl-more" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206ca75c9c03ba3d4ace2460e57b189f39f43de612c2f85836e65c929701bb2d" + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "language-tags" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "local-channel" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8" +dependencies = [ + "futures-core", + "futures-sink", + "local-waker", +] + +[[package]] +name = "local-waker" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.5", +] + +[[package]] +name = "parse-zoneinfo" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" +dependencies = [ + "regex", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "pest_meta" +version = "2.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro2" +version = "1.0.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-lite" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "serde_json" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slug" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" +dependencies = [ + "deunicode", + "wasm-bindgen", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tera" +version = "1.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "970dff17c11e884a4a09bc76e3a17ef71e01bb13447a11e85226e254fe6d10b8" +dependencies = [ + "chrono", + "chrono-tz", + "globwalk", + "humansize", + "lazy_static", + "percent-encoding", + "pest", + "pest_derive", + "rand", + "regex", + "serde", + "serde_json", + "slug", + "unic-segment", +] + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-segment" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ed5d26be57f84f176157270c112ef57b86debac9cd21daaabbe56db0f88f23" +dependencies = [ + "unic-ucd-segment", +] + +[[package]] +name = "unic-ucd-segment" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2079c122a62205b421f499da10f3ee0f7697f012f55b675e002483c73ea34700" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.66", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "winapi-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "zstd" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.10+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/04_k8s/tp/ressources/front/Cargo.toml b/04_k8s/tp/ressources/front/Cargo.toml new file mode 100644 index 0000000..fcd520e --- /dev/null +++ b/04_k8s/tp/ressources/front/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "application" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +actix-web = "4" +serde = { version = "1.0.203", features = ["derive"] } +serde_json = "1.0.117" +anyhow = "1.0.86" +env_logger = "0.11.3" +log = "0.4.21" +tera = "1.19.1" +awc = "3.5.0" +gethostname = "0.4.3" diff --git a/04_k8s/tp/ressources/front/Dockerfile b/04_k8s/tp/ressources/front/Dockerfile new file mode 100644 index 0000000..48a3f22 --- /dev/null +++ b/04_k8s/tp/ressources/front/Dockerfile @@ -0,0 +1,23 @@ +FROM rust as builder + +WORKDIR /build +COPY . . + +RUN pwd +RUN ls + +RUN cargo build --release +RUN pwd +RUN ls + +FROM debian + +WORKDIR /root +COPY --from=builder /build/target/release/application ./ +COPY ./templates/ ./ +RUN mkdir templates && mv index.html templates/ + +ENV PORT='' +ENV DATABASE_URL='' + +CMD ["./application"] diff --git a/04_k8s/tp/ressources/front/src/main.rs b/04_k8s/tp/ressources/front/src/main.rs new file mode 100644 index 0000000..6e3a1b8 --- /dev/null +++ b/04_k8s/tp/ressources/front/src/main.rs @@ -0,0 +1,161 @@ +use log::{info, error}; +use std::env; +use std::fs; + +use anyhow::bail; +use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder, middleware::Logger, http::header::ContentType}; +use actix_web::error::HttpError; +use awc::Client; +use serde::{Deserialize, Serialize}; +use serde_json; +use tera::{Tera, Context}; +use gethostname::gethostname; + +#[derive(Serialize, Deserialize, Debug)] +struct Movie { + title: String, + director: String, + release_year: u16, +} + +fn gen_error_message(error: &str) -> String { + let hostname = gethostname().into_string().unwrap(); + format!("[served by {}], {}", hostname, error) +} + +fn parse_database_url() -> String { + let mut database_url: String = match env::var("DATABASE_URL") { + Ok(database_url) => database_url.to_string(), + Err(_) => panic!("You must set DATABASE_URL env var") + }; + + if !database_url.contains("http://") { + database_url = "http://".to_owned() + database_url.as_str(); + } + + database_url = match database_url.chars().last().unwrap() { + '/' => database_url, + _ => database_url + "/", + }; + + database_url +} + +async fn render(is_ok: bool, error_message: &str) -> anyhow::Result { + let hostname = gethostname().into_string().unwrap(); + + let client = Client::default(); + let movies = match client.get(parse_database_url()).send().await { + Ok(mut res) => match res.json::>().await { + Ok(movies) => movies, + Err(e) => { + error!("{}", e.to_string()); + bail!(e.to_string()); + }, + }, + Err(e) => { + error!("{}", e.to_string()); + bail!(e.to_string()); + }, + }; + + + let tera = match Tera::new("templates/*.html") { + Ok(t) => t, + Err(e) => { + println!("Parsing error(s): {}", e); + ::std::process::exit(1); + } + }; + + let mut context = Context::new(); + context.insert("hostname", &hostname); + context.insert("movies", &movies); + + context.insert("error_message", &error_message); + context.insert("is_ok", &is_ok); + + return match tera.render("index.html", &context) { + Ok(page) => Ok(page), + Err(e) => { + error!("{}", e.to_string()); + bail!(e.to_string()); + }, + } + +} + +#[get("/")] +async fn index() -> Result { + + match render(true, "").await { + Ok(page) => Ok(HttpResponse::Ok() + .content_type(ContentType::plaintext()) + .insert_header(("Content-Type", "text/html")) + .body(page)), + Err(e) => { + if e.to_string() == "Failed to connect to host: Connection refused (os error 111)".to_string() { + Ok(HttpResponse::InternalServerError().body(gen_error_message("Cannot connect to database"))) + } else { + Ok(HttpResponse::InternalServerError().body(gen_error_message(e.to_string().as_str()))) + } + } + } + +} + +#[post("/")] +async fn insert(new_movie: web::Form) -> Result { + println!("{:?}", new_movie); + + let client = Client::default(); + match client.post(parse_database_url()).send_json(&new_movie).await { + Ok(mut res) => match res.status().is_success() { + true => { + match render(true, "Film ajouté").await { + Ok(page) => return Ok(HttpResponse::Ok() + .content_type(ContentType::plaintext()) + .insert_header(("Content-Type", "text/html")) + .body(page)), + Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())) + } + } + false => match render(false, "Erreur lors de l'ajout").await { + Ok(page) => return Ok(HttpResponse::Ok() + .content_type(ContentType::plaintext()) + .insert_header(("Content-Type", "text/html")) + .body(page)), + Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())) + } + } + Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())) + }; +} + +#[actix_web::main] +async fn main() -> std::io::Result<()> { + + env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); + + let port: u16 = match env::var("PORT") { + Ok(port) => port.parse().unwrap(), + Err(_) => panic!("You must set PORT env var") + }; + + let database_url = match env::var("DATABASE_URL") { + Ok(database_url) => database_url, + Err(_) => panic!("You must set DATABASE_URL env var") + }; + + info!("App started on port {} using DATABASE_URL {}", port, database_url); + + HttpServer::new(|| { + App::new() + .wrap(Logger::new("%a \"%r\" %s b %T")) + .service(index) + .service(insert) + }) + .bind(("0.0.0.0", port))? + .run() + .await +} diff --git a/04_k8s/tp/ressources/front/templates/index.html b/04_k8s/tp/ressources/front/templates/index.html new file mode 100644 index 0000000..6aaa982 --- /dev/null +++ b/04_k8s/tp/ressources/front/templates/index.html @@ -0,0 +1,124 @@ + + + + + + + Films + + + + + + +
+ + {% if error_message != "" %} + {% if is_ok %} +
{{error_message}}
+ {% else %} +
{{error_message}}
+ {% endif %} + {% endif %} + +

Films - Version qui claque !

+ +

Servi par {{hostname}}

+ +
+ {% for movie in movies %} + +
+

{{movie.title}}

+
Réalisateur: {{movie.director}}
+
Année de sortie: {{movie.release_year}}
+
+ + {% endfor %} +
+ +
+ +
+ + + + + + + +
+ +
+ + + diff --git a/04_k8s/tp/without_storage.yaml b/04_k8s/tp/without_storage.yaml new file mode 100644 index 0000000..832d0b7 --- /dev/null +++ b/04_k8s/tp/without_storage.yaml @@ -0,0 +1,78 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: database +spec: + replicas: 3 + selector: + matchLabels: + app: database + template: + metadata: + labels: + app: database + spec: + containers: + - name: database + image: evanespen/database:latest + env: + - name: PORT + value: "4000" + - name: STORAGE_DIR + value: "/root/" + ports: + - containerPort: 4000 + +--- +apiVersion: v1 +kind: Service +metadata: + name: database-service +spec: + type: LoadBalancer + ports: + - port: 4000 + targetPort: 4000 + selector: + app: database + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: application +spec: + replicas: 3 + selector: + matchLabels: + app: application + template: + metadata: + labels: + app: application + spec: + containers: + - name: application + image: evanespen/application:latest + env: + - name: PORT + value: "4001" + - name: DATABASE_URL + value: "http://database-service:4000" + ports: + - containerPort: 4001 + +--- +apiVersion: v1 +kind: Service +metadata: + name: application-service +spec: + type: LoadBalancer + ports: + - port: 4001 + targetPort: 4001 + selector: + app: application +