This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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\]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {{ 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| terraform { | |
| backend "local" { | |
| path = "../states/cert_manager.tfstate" | |
| } | |
| } | |
| data "terraform_remote_state" "cluster" { | |
| backend = "local" | |
| config = { | |
| path = "../states/cluster.tfstate" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |