Ryan Nakamura

39 code snips · on codesnips 5 months

DevOps and Cloud Infrastructure engineer with 12+ years automating deployments, building resilient systems, and scaling cloud-native architectures. Expert in Docker, Kubernetes,...

yaml
# Grafana provisioning: datasources
# /etc/grafana/provisioning/datasources/prometheus.yml
apiVersion: 1
datasources:
  - name: Prometheus
    type: prometheus

Grafana dashboards as code with JSON provisioning

grafana dashboards monitoring
by Ryan Nakamura 2 tabs
yaml
# Prometheus configuration
global:
  scrape_interval: 15s
  evaluation_interval: 15s
  scrape_timeout: 10s

Prometheus monitoring and alerting configuration

prometheus monitoring alerting
by Ryan Nakamura 2 tabs
nginx
# Main nginx.conf

worker_processes auto;
worker_rlimit_nofile 65535;

events {

Nginx reverse proxy and load balancing

nginx reverse-proxy load-balancing
by Ryan Nakamura 1 tab
bash
#!/bin/bash
set -euo pipefail

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'

Shell scripting for DevOps automation

bash shell-scripting devops
by Ryan Nakamura 1 tab
hcl
# RDS PostgreSQL instance
resource "aws_db_instance" "main" {
  identifier = "${var.project_name}-db"

  engine         = "postgres"
  engine_version = "16.1"

Terraform AWS RDS and ElastiCache provisioning

terraform aws rds
by Ryan Nakamura 1 tab
hcl
# Using the module

module "api_service" {
  source = "./modules/ecs_service"

  service_name       = "api"

Terraform modules for reusable infrastructure

terraform modules iac
by Ryan Nakamura 2 tabs
hcl
# Configure Terraform
terraform {
  required_version = ">= 1.6.0"

  required_providers {
    aws = {

Terraform basics: providers, resources, and state

terraform iac devops
by Ryan Nakamura 3 tabs
yaml
stages:
  - lint
  - test
  - build
  - deploy

CI/CD pipeline with GitLab CI

ci-cd gitlab devops
by Ryan Nakamura 1 tab
yaml
name: CI Pipeline

on:
  push:
    branches: [main, develop]
  pull_request:

CI/CD pipeline with GitHub Actions

ci-cd github-actions devops
by Ryan Nakamura 1 tab
yaml
# HPA v2 with multiple metrics
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: web-app-hpa
  namespace: production

Kubernetes Horizontal Pod Autoscaler and resource management

kubernetes k8s autoscaling
by Ryan Nakamura 1 tab
yaml
# ConfigMap from literal values
apiVersion: v1
kind: ConfigMap
metadata:
  name: web-app-config
  namespace: production

Kubernetes ConfigMaps and Secrets management

kubernetes k8s configmaps
by Ryan Nakamura 2 tabs
yaml
# ClusterIP Service (internal only)
apiVersion: v1
kind: Service
metadata:
  name: web-app
  namespace: production

Kubernetes Services and Ingress for traffic routing

kubernetes k8s services
by Ryan Nakamura 2 tabs