Skip to content

Instantly share code, notes, and snippets.

View rpfreitas111's full-sized avatar
🏠
Working from home

Rodrigo Freitas rpfreitas111

🏠
Working from home
View GitHub Profile
@rpfreitas111
rpfreitas111 / terminal-colors-branch.sh
Created February 27, 2024 17:29 — forked from danielalvarenga/terminal-colors-branch.sh
Show branch in terminal Ubuntu
# Add in ~/.bashrc or ~/.bash_profile
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
RED="\[\033[01;31m\]"
YELLOW="\[\033[01;33m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
NO_COLOR="\[\033[00m\]"
# Create Linux Azure AKS Spot instance Node Pool
# Required extension:
# az extension add --name aks-preview
#
resource "azurerm_kubernetes_cluster_node_pool" "nodepool_cpu_spot" {
#availability_zones = [1, 2, 3]
enable_auto_scaling = true
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks_cluster.id
max_count = 3
min_count = 1
{{ define "slack.default.title" }}
[ {{ .Status | toUpper }} ]
{{ end }}
{{ define "slack.default.message" }}
{{ range . }}
{{ if gt (len .Annotations.summary) 0 }}Alert Summary: {{ .Annotations.summary }} {{ end }}
{{ if gt (len .Annotations.runbook_url) 0 }}Alert Runbook: {{ .Annotations.runbook_url }} {{ end }}
Labels:
@rpfreitas111
rpfreitas111 / delete-evicted-pods-all-namespaces.sh
Created May 13, 2022 18:11 — forked from svx/delete-evicted-pods-all-namespaces.sh
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces
@rpfreitas111
rpfreitas111 / README-PTBR.md
Created March 3, 2022 12:17 — forked from lohhans/README-PTBR.md
Um modelo para fazer um bom README.md

Título do projeto

Um parágrafo da descrição do projeto vai aqui

🚀 Começando

Essas instruções permitirão que você obtenha uma cópia do projeto em operação na sua máquina local para fins de desenvolvimento e teste.

Consulte Implantação para saber como implantar o projeto.

@rpfreitas111
rpfreitas111 / cert-manager|backend.tf
Created November 25, 2021 02:29 — forked from TylerWanner/cert-manager|backend.tf
Cert-Manager Helm Release in Terraform
terraform {
backend "local" {
path = "../states/cert_manager.tfstate"
}
}
data "terraform_remote_state" "cluster" {
backend = "local"
config = {
path = "../states/cluster.tfstate"
@rpfreitas111
rpfreitas111 / .gitlab.ci.yml
Created April 8, 2021 01:17 — forked from yannhowe/.gitlab.ci.yml
.gitlab.ci.yml for SSH with private key.
# Image neeeds to have ssh-client
image: docker:git
services:
- docker:dind
stages:
- staging
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY