Skip to content

Instantly share code, notes, and snippets.

View stand-sure's full-sized avatar

Christopher J. Anderson stand-sure

View GitHub Profile
@stand-sure
stand-sure / README.md
Created May 3, 2024 14:35
How to spin up a redis cli troubleshooting pod

This is for troubleshooting/fixing redis that is already running or failing to start.

Scheduling the pod on the same node

This is necessary because the PVC is RW once

  affinity:
    podAffinity:
 requiredDuringSchedulingIgnoredDuringExecution:
@stand-sure
stand-sure / .pre-commit-config.yaml
Created April 12, 2024 17:58
Preventing commits to the default branch with pre-commit
repos:
- repo: local
hooks:
- id: prevent-commits-to-default-branch
name: prevent commits to default branch
entry: prevent-commits-to-default-branch.sh
language: script
require_serial: true
@stand-sure
stand-sure / Client.csproj
Last active March 22, 2024 17:01
How to generate a populated OpenAPI spec for .net8 minimal API and hot to generate a client using Kiota
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>Demos.OAS.Client</RootNamespace>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<FileVersion>0.1.0.0</FileVersion>
<LangVersion>latest</LangVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.1.0</Version>
@stand-sure
stand-sure / remove-finalizers.sh
Created March 14, 2024 14:52
remove finalizer for all items of a certain kind
kubectl get REPLACE_WITH_KIND -o name | xargs -n1 kubectl patch --type merge --patch '{"metadata":{"finalizers":null}}'
@stand-sure
stand-sure / README.md
Created March 5, 2024 19:24
Kube Stack Prometheus Grafana Datasource with Secrets

Grafana Datasource with Secrets

  1. Create a secret
  2. Add the secrets as environment variables to the Grafana section of the Prometheus yaml
  3. Use the environment values (secureJsonData)
@stand-sure
stand-sure / README.md
Created February 28, 2024 20:39
Clickhouse & Jaeger

jaeger-config.yaml

Set values for address, username, and password.

Make the password into a hash for the clickhouse installation.

printf `printf 'my-password' | sha256sum` ; echo

# 6fa2288c361becce3e30ba4c41be7d8ba01e3580566f7acc76a7f99994474c46
@stand-sure
stand-sure / README.md
Created February 28, 2024 13:31
Using OpenTelemetry Collector with Clickhouse

Clickhouse & OTel Collector

clickhouse network security

The username/networks/ip under spec.configuration.users was the key to getting things to work.
It seems that "10.0.0.0/16" isn't enough. Allowing all networks solved the problem.

Otel Collector and sensitive data

Secrets can be mounted to environment variables under the extraEnvs key.

@stand-sure
stand-sure / helm-secret-lookup-manual.yaml
Created December 28, 2023 16:17
helm random secret with persistence and optional override
{{- if empty .Values.manualSecretName }}
apiVersion: v1
kind: Secret
metadata:
name: "jwt-secret"
annotations:
"helm.sh/resource-policy": "keep"
type: Opaque
data:
# retrieve the secret data using lookup function and when not exists, return an empty dictionary / map as result
### Keybase proof
I hereby claim:
* I am stand-sure on github.
* I am stand_sure (https://keybase.io/stand_sure) on keybase.
* I have a public key ASCyW_dmVCsEDjWTcomieNrIhS2NJrkfRyww-S2qFc7K2Ao
To claim this, I am signing this object: