- Descargarse terraform y ubicarlo en el PATH en su equipo https://www.terraform.io/downloads.html
- Usando el provider de Kubernetes, transformar el manifiesto yaml del proyecto web-go en un manifiesto de terraform .tf (https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/guides/getting-started)
- Para hacer funcionar esto, van a necesitar un token de conexion al cluster, para esto se puede usar el mismo usado para Jenkins.
- No crear el recurso ingress, ya que no es compatible con la api usada en la catedra
- De la misma forma ejectuar el container web-go solamente usando docker con el provider de docker https://www.terraform.io/docs/providers/docker/index.html
- Intentar conectarse a traves del socket de docker, el cual debe ser configurado a tal fin.
- Elegir un provider diferente y crear un recurso del mismo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE | |
@SearchText varchar(200), | |
@Table varchar(100), | |
@TableID int, | |
@ColumnName varchar(100), | |
@String varchar(1000); | |
--modify the variable, specify the text to search for | |
SET @SearchText = '%Per6%'; | |
DECLARE CursorSearch CURSOR | |
FOR SELECT name, object_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Install Kubernetes | |
hosts: localhost | |
become: yes | |
vars: | |
k8s_version: 1.25 | |
os: "xUbuntu_22.04" | |
tasks: | |
- name: Update all packages to their latest version | |
apt: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
control-plane | |
sudo kubeadm join 192.168.88.233:6443 --token eo3ed6.77bdvlpz7vbnxn9q \ | |
--discovery-token-ca-cert-hash sha256:30f7690b6cd5927e425686477f389a795f1901ede98f3888fa626c9694ad1869 \ | |
--control-plane | |
worker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: mysql | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: mysql | |
namespace: mysql |
- Desplegar Jenkins en K8s
- Conectar Jenkins con K8s
- Instalar los plugins de docker y K8s
- Crear un Pod Template con el container Docker
- Crear un Pipeline (a partir de un Jenkinsfile) que compile el dockerfile del siguiente proyecto https://github.com/nelsonyaccuzzi/web-go-public
- Crear un container que tenga solo el binario de kubectl, pushearlo a dockerhub
- Agregar el container al pod template que anteriormente creamos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { label 'docker'} | |
stages { | |
stage('Build') { | |
steps { | |
container('docker') { | |
script { | |
sh 'docker ps' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: jenkins | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: jenkins | |
namespace: jenkins |
Partir de 1 maquinas virtuales Ubuntu 20, con docker instalado
Instalar Kubeadm - https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/
- Configurar 2 cpus a la maquina virtual
- IPtables
- Instalar runtime (hecho)
- Configurar runtime - https://kubernetes.io/docs/setup/cri/
Partir 2 maquinas virtuales con Ubuntu 20 recien instalado con un snapshot inicial antes de comenzar.
- En ambas instalar docker usando el repositorio oficial
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
-
Hacer un nuevo snapshot
-
Realizar los siguientes tutoriales, ambos en la plataforma como en una maquina virtual
NewerOlder