Commit 3658e27f authored by Rémi Cailletaud's avatar Rémi Cailletaud
Browse files

add data-terra-hashicorp

parent f55bf046
---
header-includes:
- '\usetheme[titleformat=smallcaps,numbering=none,progressbar=frametitle]{metropolis}'
- '\usepackage[fixed]{fontawesome5}'
- '\definecolor{links}{HTML}{661100}'
- '\hypersetup{colorlinks,linkcolor=,urlcolor=links}'
title: Infrastructure as Code avec Packer/Terraform/...
subtitle: "Retour d'expérience sur les outils d'IaC"
author: Rémi Cailletaud
date: 30 mars 2021
institute: Data Terra GT Architecture
---
# \faPlayCircle Intro
## Définition
* Gestion de l'infrastructure via des scripts ou des fichier descripteurs
* Initialement pour les VM maintenant aussi pour le réseau (DNS, sécurité, équilibrage de charge...)
## Avantages
* Automatisation
* Replicabilité
* Auto documentation
# \faTools Les outils: Packer
:::: {.columns}
::: {.column width=35%}
![Packer](packer-vertical-color.png){ width=150px }\
:::
::: {.column width=65%}
* Hashicorp, Open Source (MPL2)
* Construction d'image de VM
* Multi plateforme (VirtualBox, vSphere, Openstack, différents *cloud providers*)
* Utilisation possible d'un *SCM* (puppet, ansible, salt, chef)
:::
::::
# \faTools Les outils: Packer
\tiny
```json
{
"builders": [
{
"type": "openstack",
"image_name": "ubuntu-18.04-docker-x86_64",
"source_image_name": "ubuntu-18.04-bionic-x86_64",
"ssh_username": "ubuntu",
"networks": [
"59981445-9379-44f2-ad36-a4e91e174f96"
],
"floating_ip_network": "b7658133-6810-4804-aa76-a0ab096092ee",
"floating_ip": "7ac29e38-3332-4a21-b568-ab2d8fac6600",
"security_groups": "default"
}
],
"provisioners": [
{
"type": "salt-masterless",
"bootstrap_args": "-X -d -D stable 2019.2.0",
"local_state_tree": "./salt",
"custom_state": "docker",
"salt_call_args": "pillar='{\"docker_version\": \"5:18.09.1~3-0~ubuntu-bionic\"}'"
},
{
"type": "shell",
"inline": ["sudo adduser ubuntu docker"]
}
]
}
```
# \faTools Les outils: Terraform
:::: {.columns}
::: {.column width=35%}
![Terraform](terraform-vertical-color.png){ width=150px }\
:::
::: {.column width=65%}
* Hashicorp, Open Source (MPL2)
* *Infrastructure as Code*
* Multi plateforme (plusieurs centaines de fournisseurs)
* Gestion des dépendances
* Gestion et partage de l'état de l'infrastructure
:::
::::
# \faTools Les outils: Terraform
\small
```json
resource "openstack_compute_instance_v2" "instance" {
name = "nvidialic"
image_name = "ubuntu-18.04.4-bionic-x86_64"
flavor_name = "m1.medium"
key_pair = "cailletr-rsa"
network {
uuid = openstack_networking_network_v2.nvidialic_net.id
fixed_ip_v4 = "192.168.0.10"
}
}
```
# Exemple: terraform-openstack-rke
> https://github.com/remche/terraform-openstack-rke/
* Déploiement d'un cluster Kubernetes sur OpenStack
* Utilisation du fournisseur OpenStack pour :
* les clés
* le réseau
* les groupes de sécurité
* le load balancer
* Utilisation du fournisseur RKE pour le déploiement du cluster K8s
# Plus loin
# \faCreativeCommons\ \faCreativeCommonsBy\ \faCreativeCommonsSa
Merci
Made with [Pandoc](https://pandoc.org), [Metropolis Beamer Theme](https://github.com/matze/mtheme) and [FontAwesome](https://fontawesome.com/)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment