package com.example.demo.client;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
stages:
- lint
- test
- build
- deploy
# Prometheus configuration
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_timeout: 10s
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.4
hooks:
- id: gitleaks
- repo: https://github.com/Yelp/detect-secrets
auth:
- authentication required for non-public endpoints
- authorization rules documented and tested
data:
- secrets stored outside source control
- encryption in transit enabled
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-app
namespace: production
labels:
# ConfigMap from literal values
apiVersion: v1
kind: ConfigMap
metadata:
name: web-app-config
namespace: production
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-service
labels:
app: user-service
cleanup_expired_sessions:
cron: '0 2 * * *' # Daily at 2 AM
class: CleanupExpiredSessionsWorker
queue: low
description: Remove expired sessions from Redis
# Pre-commit hooks configuration
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
# HPA v2 with multiple metrics
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web-app-hpa
namespace: production
---
# Main playbook
- name: Configure web servers
hosts: webservers
become: yes
vars: