cli-tool
intermediate
utility
Waypoint
📋 Copy All Commands
📄 Generate PDF
Guía completa de comandos y flujos de trabajo de HashiCorp Waypoint para implementación de aplicaciones y gestión de lanzamientos en múltiples plataformas.
Instalación y Configuración
Comando
Descripción
waypoint version
Mostrar versión de Waypoint
waypoint server install -platform=docker
Instalar servidor en Docker
waypoint server install -platform=kubernetes
Instalar servidor en Kubernetes
waypoint context create -server-addr=localhost:9701
Crear contexto
waypoint login
Iniciar sesión en el servidor de Waypoint
## Gestión de Proyectos
Operaciones de Proyecto
Comando
Descripción
waypoint init
Inicializar proyecto
waypoint project list
Listar proyectos
waypoint project inspect myapp
Inspeccionar proyecto
waypoint project destroy myapp
Destruir proyecto
## Ciclo de Vida de la Aplicación
Construcción, Implementación, Lanzamiento
Comando
Descripción
waypoint build
Construir aplicación
waypoint deploy
Desplegar aplicación
waypoint release
Liberar aplicación
waypoint up
Construir, implementar y lanzar
### Gestión de Aplicaciones
Comando
Descripción
---------
-------------
waypoint status
Mostrar estado de la aplicación
waypoint logs
Mostrar registros de aplicación
waypoint logs -follow
Seguir registros de aplicación
waypoint exec /bin/bash
Ejecutar comando en despliegue
## Gestión de Espacios de Trabajo
Comando
Descripción
waypoint workspace list
Listar workspaces
waypoint workspace create dev
Crear espacio de trabajo
waypoint workspace use dev
Cambiar espacio de trabajo
## Ejemplos de Configuración
Configuración Básica de waypoint.hcl
project = "myapp"
app "web" \\\\ {
labels = \\\\ {
"service" = "web"
"env" = "dev"
\\\\ }
build \\\\ {
use "docker" \\\\ {
dockerfile = "./Dockerfile"
\\\\ }
registry \\\\ {
use "docker" \\\\ {
image = "myapp"
tag = "latest"
\\\\ }
\\\\ }
\\\\ }
deploy \\\\ {
use "docker" \\\\ {
service_port = 3000
\\\\ }
\\\\ }
release \\\\ {
use "docker" \\\\ { \\\\ }
\\\\ }
\\\\ }
Implementación en Kubernetes
project = "myapp"
app "web" \\\\ {
build \\\\ {
use "docker" \\\\ {
dockerfile = "./Dockerfile"
\\\\ }
registry \\\\ {
use "docker" \\\\ {
image = "registry.example.com/myapp"
tag = gitrefpretty ()
\\\\ }
\\\\ }
\\\\ }
deploy \\\\ {
use "kubernetes" \\\\ {
probe_path = "/health"
replicas = 3
resources \\\\ {
requests \\\\ {
memory = "256Mi"
cpu = "250m"
\\\\ }
limits \\\\ {
memory = "512Mi"
cpu = "500m"
\\\\ }
\\\\ }
\\\\ }
\\\\ }
release \\\\ {
use "kubernetes" \\\\ {
load_balancer = true
port = 80
\\\\ }
\\\\ }
\\\\ }
Implementación en AWS ECS
project = "myapp"
app "web" \\\\ {
build \\\\ {
use "docker" \\\\ {
dockerfile = "./Dockerfile"
\\\\ }
registry \\\\ {
use "aws-ecr" \\\\ {
region = "us-west-2"
repository = "myapp"
tag = gitrefpretty ()
\\\\ }
\\\\ }
\\\\ }
deploy \\\\ {
use "aws-ecs" \\\\ {
region = "us-west-2"
cluster = "production"
memory = 512
cpu = 256
count = 3
subnets = [
"subnet-12345" ,
"subnet-67890"
]
security_groups = [
"sg-abcdef"
]
\\\\ }
\\\\ }
release \\\\ {
use "aws-alb" \\\\ {
listener_arn = "arn:aws:elasticloadbalancing:..."
health_check \\\\ {
enabled = true
healthy_threshold = 2
interval = 30
matcher = "200"
path = "/health"
port = "traffic-port"
protocol = "HTTP"
timeout = 5
unhealthy_threshold = 2
\\\\ }
\\\\ }
\\\\ }
\\\\ }
Proyecto Multi-Aplicación
project = "microservices"
app "api" \\\\ {
labels = \\\\ {
"service" = "api"
"tier" = "backend"
\\\\ }
build \\\\ {
use "docker" \\\\ {
dockerfile = "./api/Dockerfile"
\\\\ }
registry \\\\ {
use "docker" \\\\ {
image = "mycompany/api"
tag = gitrefpretty ()
\\\\ }
\\\\ }
\\\\ }
deploy \\\\ {
use "kubernetes" \\\\ {
probe_path = "/health"
replicas = 2
env = \\\\ {
"DATABASE_URL" = var.database_url
"REDIS_URL" = var.redis_url
\\\\ }
\\\\ }
\\\\ }
release \\\\ {
use "kubernetes" \\\\ {
port = 8080
\\\\ }
\\\\ }
\\\\ }
app "frontend" \\\\ {
labels = \\\\ {
"service" = "frontend"
"tier" = "frontend"
\\\\ }
build \\\\ {
use "docker" \\\\ {
dockerfile = "./frontend/Dockerfile"
\\\\ }
registry \\\\ {
use "docker" \\\\ {
image = "mycompany/frontend"
tag = gitrefpretty ()
\\\\ }
\\\\ }
\\\\ }
deploy \\\\ {
use "kubernetes" \\\\ {
probe_path = "/"
replicas = 3
\\\\ }
\\\\ }
release \\\\ {
use "kubernetes" \\\\ {
load_balancer = true
port = 80
\\\\ }
\\\\ }
\\\\ }
Variables y Configuración
Definiciones de Variables
variable "database_url" \\\\ {
description = "Database connection URL"
type = string
sensitive = true
\\\\ }
variable "replicas" \\\\ {
description = "Number of replicas"
type = number
default = 2
\\\\ }
variable "environment" \\\\ {
description = "Environment name"
type = string
default = "dev"
\\\\ }
Uso de Variables
app "web" \\\\ {
deploy \\\\ {
use "kubernetes" \\\\ {
replicas = var.replicas
env = \\\\ {
"DATABASE_URL" = var.database_url
"ENVIRONMENT" = var.environment
\\\\ }
\\\\ }
\\\\ }
\\\\ }
Funciones y Expresiones
Funciones Integradas
app "web" \\\\ {
build \\\\ {
registry \\\\ {
use "docker" \\\\ {
image = "myapp"
tag = gitrefpretty () # Git reference
\\\\ }
\\\\ }
\\\\ }
deploy \\\\ {
use "kubernetes" \\\\ {
env = \\\\ {
"BUILD_TIME" = timestamp ()
"GIT_SHA" = gitsha ()
"VERSION" = gitrefpretty ()
\\\\ }
\\\\ }
\\\\ }
\\\\ }
Plugins y Constructores
Plugin de Construcción Personalizado
app "web" \\\\ {
build \\\\ {
use "pack" \\\\ {
builder = "heroku/buildpacks:20"
\\\\ }
\\\\ }
\\\\ }
Plugin de Implementación Personalizado
app "web" \\\\ {
deploy \\\\ {
use "nomad" \\\\ {
datacenter = "dc1"
region = "global"
resources \\\\ {
cpu = 500
memory = 256
\\\\ }
\\\\ }
\\\\ }
\\\\ }
Mejores Prácticas
Estructura del Proyecto
project/
├── waypoint.hcl
├── .waypointignore
├── apps/
│ ├── api/
│ │ ├── Dockerfile
│ │ └── src/
│ └── frontend/
│ ├── Dockerfile
│ └── src/
├── infrastructure/
│ └── terraform/
└── scripts/
└── deploy.sh
Seguridad