Skip to content

Instantly share code, notes, and snippets.

@rdemoraes
rdemoraes / argocd-app-hcp-vault.yml
Last active August 5, 2024 16:52
ArgoCD Application Object for Vault
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: microk8s-hcp-vault
namespace: argocd
spec:
syncPolicy:
automated:
prune: false
selfHeal: true
@rdemoraes
rdemoraes / github-action-ecs-workflow
Created August 19, 2022 20:12
github-action-ecs-workflow
name: Deploy to Amazon ECS
on:
push:
branches:
- main
- develop
- releases
pull_request:
@rdemoraes
rdemoraes / github-action-ecs-task-definition-from-scratch
Last active August 19, 2022 15:02
github-action-ecs-task-definition-from-scratch
name: generate-task-definition-json
author: Raphael Moraes
decription: Action to generate a custom task definition json file
inputs:
environment:
description: 'Environment Name'
required: true
default: dev
ecr_name:
@rdemoraes
rdemoraes / kube-bench-gitlab-ci
Last active August 18, 2022 18:05
kube-bench-gitlab-ci
stages:
- kube-bench
Kube bench:
stage: kube-bench
environment:
name: dev
variables:
KUBE_BENCH_VERSION: v0.6.9
tags:
@rdemoraes
rdemoraes / prometheus-adapter-values.yaml
Created March 15, 2022 12:48
prometheus-adapter-values.yaml
rules:
default: true
custom: []
# Mounts a configMap with pre-generated rules for use. Overrides the
# default, custom, external and resource entries
existing:
external:
# External metric for Gitlab Runner: Devops Group
- seriesQuery: 'gitlab_runner_jobs{job=~".*your-gitlab-runner-name.*"}'
resources:
@rdemoraes
rdemoraes / prometheus-prometheusSpec-codeSnippet
Created March 15, 2022 12:34
prometheus-prometheusSpec-codeSnippet
prometheusSpec:
additionalAlertManagerConfigs: []
additionalAlertRelabelConfigs: []
additionalPrometheusSecretsAnnotations: {}
additionalRemoteRead: []
additionalRemoteWrite: []
additionalScrapeConfigs:
- job_name: serviceMonitor/gitlab-runners/your-gitlab-runner-name
kubernetes_sd_configs:
- namespaces:
@rdemoraes
rdemoraes / gitlab-runner-values.yaml
Last active August 18, 2022 18:11
gitlab-runner-values.yaml
podLabels:
name: your-gitlab-runner-name
hpa:
minReplicas: 2
maxReplicas: 10
metrics:
- type: External
external:
metricName: gitlab_runner_jobs_devops_group
targetAverageValue: 1000m
@rdemoraes
rdemoraes / kube-prometheus-stack-ClusterRole.yaml
Created March 15, 2022 12:26
kube-prometheus-stack-ClusterRole.yaml
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: horizontal-pod-autoscaler-external-metrics
rules:
- apiGroups:
- external.metrics.k8s.io
resources:
- '*'
@rdemoraes
rdemoraes / prometheus-stack-ClusterRoleBinding.yaml
Created March 15, 2022 12:24
prometheus-stack-ClusterRoleBinding.yaml
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: horizontal-pod-autoscaler-external-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: horizontal-pod-autoscaler-external-metrics
subjects:
@rdemoraes
rdemoraes / prometheus-settings-01
Created March 15, 2022 12:18
prometheus-settings-01
# Url to access prometheus
prometheus:
# Value is templated
url: http://kube-prometheus-stack-helm-prometheus.kube-prometheus-stack.svc.cluster.local
port: 9090
path: ""