Skip to content

Instantly share code, notes, and snippets.

@busyboy77
busyboy77 / mapping.yaml
Created October 20, 2023 11:51 — forked from mweibel/mapping.yaml
banzaicloud/logging-operator working ElasticSearch example with index lifecycle management
apiVersion: v1
kind: Secret
metadata:
name: index-template
stringData:
template: '{"index_patterns":["logstash-*"],"template":{"aliases":{"logstash":{}},"mappings":{"dynamic":"true","dynamic_date_formats":["strict_date_optional_time","yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"],"dynamic_templates":[]},"settings":{"index":{"lifecycle":{"name":"logstash_policy","rollover_alias":"logstash"},"number_of_shards":"1","number_of_replicas":"0"}}}}'
@superseb
superseb / rancher_v263plus_etcd_maintenance.md
Last active April 13, 2023 07:04
Rancher v2.6.3 and up single install etcd maintenance

Rancher v2.6.3 and up single install embedded etcd maintenance

This is not official documentation, have/make backups, use at your own risk.

v2.6.3 and up only

When etcd db size exceeds quota, it will raise an alarm and throw the error mvcc: database space exceeded.

To manually trigger this situation:

@mweibel
mweibel / mapping.yaml
Created July 5, 2021 08:18
banzaicloud/logging-operator working ElasticSearch example with index lifecycle management
apiVersion: v1
kind: Secret
metadata:
name: index-template
stringData:
template: '{"index_patterns":["logstash-*"],"template":{"aliases":{"logstash":{}},"mappings":{"dynamic":"true","dynamic_date_formats":["strict_date_optional_time","yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"],"dynamic_templates":[]},"settings":{"index":{"lifecycle":{"name":"logstash_policy","rollover_alias":"logstash"},"number_of_shards":"1","number_of_replicas":"0"}}}}'
@jakexks
jakexks / cert-manager-test.sh
Last active September 29, 2024 17:48
Cert-manager selfsigned as cluster issuer
#!/usr/bin/env bash
set -ex
export TEST_CLUSTER_NAME=quick-test
export CERT_MANAGER_VERSION=v1.3.1
export KIND_IMAGE=kindest/node:v1.20.2
# Create test cluster
echo "Creating test cluster..."
kind create cluster --name="$TEST_CLUSTER_NAME" --image="$KIND_IMAGE"
until kubectl --timeout=120s wait --for=condition=Ready pods --all --namespace kube-system; do sleep 1; done
@bgulla
bgulla / rke2_kubevip.md
Last active January 20, 2025 05:57
RKE2 api-server HA with Kube-VIP

On-Prem RKE2 api-server HA with Kube-VIP

               ,        ,  _______________________________
   ,-----------|'------'|  |                             |
  /.           '-'    |-'  |_____________________________|
 |/|             |    |    
   |   .________.'----'    _______________________________
   |  ||        |  ||      |                             |
   \__|'        \__|'      |_____________________________|
@superseb
superseb / k3s-etcd-commands.md
Last active April 12, 2025 07:57
k3s etcd commands

k3s etcd commands

etcd

Setup etcdctl using the instructions at https://github.com/etcd-io/etcd/releases/tag/v3.4.13 (changed path to /usr/local/bin):

Note: if you want to match th etcdctl binaries with the embedded k3s etcd version, please run the curl command for getting the version first and adjust ETCD_VER below accordingly:

curl -L --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/server-client.crt --key /var/lib/rancher/k3s/server/tls/etcd/server-client.key https://127.0.0.1:2379/version
@janeczku
janeczku / clusterflow-archive.yaml
Last active January 15, 2024 09:31
Banzai Cluster Logging Elasticsearch Example
apiVersion: logging.banzaicloud.io/v1beta1
kind: ClusterFlow
metadata:
name: archive
spec:
match:
- select: {}
outputRefs:
- s3
@davidedg
davidedg / USERDATA
Last active April 6, 2024 03:39
AWS NAT Instance HA
#!/bin/bash
#https://gist.github.com/davidedg/c29c478ee9c15a804a99cbd1de364647#file-userdata
# Intended to run together with AMI amzn-ami-vpc-nat-hvm-*, with ASG min=max=desired=1
# Tested with amzn-ami-vpc-nat-hvm-2018.03.0.20180811-x86_64-ebs (ami-0ea87e2bfa81ca08a)
# Expected TAGS:
# - Backend Subnets: Name=InternetNAT Values=AvailabilityZone ( eg: eu-west-1 ) where Frontend NAT Instance is (this allows for multiple NAT instances to serve differenze AZ subnets
# - Backend Subnets + ASG: Name=Environment, Values=EnvironmentLabel ( eg: "production", "staging" ... ) (this allows for multiple environments in same VPC, served by different NAT instances)
# - ASG: Name=EIP Values=EIP-allocation-id ( eg eipalloc-abcdef12 )
PATH="/usr/sbin:/sbin:/usr/bin:/bin"
function log { logger -t "NAT-instance" -- $1; }
@shamil
shamil / mount_qcow2.md
Last active April 14, 2025 05:44
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8