Skip to content

Instantly share code, notes, and snippets.

View ramesh-lingappan's full-sized avatar
🎯
Focusing

Ramesh Lingappan ramesh-lingappan

🎯
Focusing
View GitHub Profile
@ramesh-lingappan
ramesh-lingappan / dcoker-compose.yaml
Created January 22, 2022 17:56
AdGuard Docker Compose file
---
version: "2"
services:
adguardhome:
image: adguard/adguardhome:latest
container_name: adguardhome
ports:
- 53:53/tcp
- 53:53/udp
- 67:67/udp
package com.example.prometheuspushgateway;
import io.micrometer.core.annotation.Timed;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.stereotype.Service;
@Service
public class HelloService {
@ramesh-lingappan
ramesh-lingappan / prometheus.yml
Created July 9, 2020 15:29
pushgateway sample prometheus config file
# my global config
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
evaluation_interval: 15s # By default, scrape targets every 15 seconds.
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
@ramesh-lingappan
ramesh-lingappan / pushgateway_docker-compose.yml
Created July 9, 2020 15:24
PushGateway docker compose file
version: '3'
networks:
monitor-net:
driver: bridge
volumes:
prometheus_data: {}
pushgateway_data: {}
services:
prometheus:
service: secrets-demo
runtime: java11
instance_class: F2
env_variables:
SPRING_PROFILES_ACTIVE: "prod"
GCP_SECRETS_ENABLED: true
package com.rameshl.demo.secretmanager;
import com.rameshl.demo.secretmanager.config.AppSecrets;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequiredArgsConstructor
public class HelloController {
package com.rameshl.demo.secretmanager.config;
import lombok.Data;
import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Data
@Component
@ConfigurationProperties(prefix = "app.secrets")
spring:
profiles:
active: prod
app:
secrets:
googleClientId: ${gcp-secrets.google_client_id}
googleClientSecret: ${gcp-secrets.google_client_secret}
@ramesh-lingappan
ramesh-lingappan / secretmanager-demo_bootstrap.yml
Created April 4, 2020 10:42
SecretManager Bootstrap yaml configuration
spring:
cloud:
gcp:
secretmanager:
enabled: ${GCP_SECRETS_ENABLED:false}
bootstrap:
enabled: ${GCP_SECRETS_ENABLED:false}
secret-name-prefix: gcp-secrets.
# Pass the following environment variables while calling the command \
GCP_PROJECT - the gcp project name \
SERVICE_NAME - the name of the service to be deployed
# build
.PHONY: build
build:
@echo "🍳 Building docker image using Cloud build"
gcloud builds submit --tag gcr.io/$(GCP_PROJECT)/$(SERVICE_NAME):0.1 --project $(GCP_PROJECT)