Skip to content

Instantly share code, notes, and snippets.

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

Staz stazdx

🏠
Working from home
View GitHub Profile
kubectl create namespace costintel
kubectl -n costintel create secret generic costintel-admin \
--from-literal=email=<tu correo> --from-literal=password='<12+ caracteres>'
helm install costintel oci://registry-1.docker.io/stazdx/cost-intelligence-platform --version 1.0.0 -n costintel \
--set publicUrl=https://<tu dominio> --set ingress.enabled=true --set ingress.host=<tu dominio> \
--set auth.bootstrapAdmin.existingSecret=costintel-admin --set organization.name='<tu empresa>' \
--set cloudIdentity.azure.clientId=<client id de la managed identity>
@stazdx
stazdx / create-api-key.sh
Created November 2, 2026 05:07
create-api-key
#!/usr/bin/env bash
# Creates an ingest API key from inside the central install's backend pod:
# the same key Configuración > API keys creates, without opening the
# dashboard. Only the key goes to stdout, so it chains into
# agent-namespaces.sh:
#
# export DBCA_API_KEY=$(deploy/create-api-key.sh --context central -n dbca --name cluster-aks-prod)
# deploy/agent-namespaces.sh --context apps-1 --apply --restart
#
# Options:
@stazdx
stazdx / agent-namespaces.sh
Last active November 2, 2026 19:36
agent-namespaces
#!/usr/bin/env bash
# Turns the db-cost-advisor Java agent on -- or, with --rollback, off -- in
# the application namespaces of a cluster that runs the agent injector
# (mode=agent, or a full install).
#
# On (the default):
# 1. annotates the namespace with db-cost-advisor.io/inject-java-agent=true;
# 2. stores the ingest API key in it, as the Secret the agent reads;
# 3. with --restart, restarts its Deployments and StatefulSets when 1 or 2
# changed something, so the running pods start again with the agent.
@stazdx
stazdx / iOSCICD.yml
Created August 18, 2022 06:04
github action - iOS Build and Deploy - CI/CD
name: App build
on: push
jobs:
build_with_signing:
runs-on: macos-latest
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.2.1'
@stazdx
stazdx / _helpers.tpl
Created June 26, 2022 06:07
Helpers file - Helm template
{{/*
Expand the name of the chart.
*/}}
{{- define "microservice-template.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
@stazdx
stazdx / values.yaml
Created June 26, 2022 06:01
values yaml - microservice template
# Default values for microservice-template.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: nginx
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
@stazdx
stazdx / Chart.yaml
Created June 26, 2022 05:57
Chart.yaml file - all fields
apiVersion: The chart API version (required)
name: The name of the chart (required)
version: A SemVer 2 version (required)
kubeVersion: A SemVer range of compatible Kubernetes versions (optional)
description: A single-sentence description of this project (optional)
type: The type of the chart (optional)
keywords:
- A list of keywords about this project (optional)
home: The URL of this projects home page (optional)
sources:
@stazdx
stazdx / Chart.yaml
Last active June 1, 2022 08:20
Open Source Grafana Stack on k8s - k8staz.com
apiVersion: v2
name: kube-prometheus-stack
version: 1.0.0-SNAPSHOT
description: Chart to deploy kube-prometheus-stack
dependencies:
# https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/Chart.yaml
- name: kube-prometheus-stack
version: 34.6.0
repository: https://prometheus-community.github.io/helm-charts
@stazdx
stazdx / Controller.java
Created June 1, 2022 07:54
SpringBootOpenTelemetryPrometheusExemplars - k8staz.com
package com.staz.observability;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Controller {
@PostMapping("/fail")
@stazdx
stazdx / bitbucket_list_all.py
Last active June 1, 2022 16:15
Bitbucket List all projects and repos
import requests
from requests.auth import HTTPBasicAuth
username = 'username@github.com' # Replace
password = 'xXxXxxxXxXXx' # Replace
team = 'StazDxru' # Replace
team_replaced = team+'@'
full_repo_list = []