Skip to content

Instantly share code, notes, and snippets.

View yogeek's full-sized avatar

Guillaume Dupin yogeek

View GitHub Profile
@yogeek
yogeek / deploy-and-svc.yaml
Last active April 18, 2024 13:37
K8s useful resources
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
registry=# select * from schedule;
id | creation_time | update_time | vendor_type | vendor_id | cron | callback_func_name | callback_func_param | cron_type | extra_attrs | revision
-----+----------------------------+----------------------------+-------------------------+-----------+---------------+-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+--------------------------+------------
296 | 2023-04-25 08:30:21.377146 | 2023-04-25 08:30:21.377146 | RETENTION | 35 | 0 0 0 * * * | RETENTION | {"PolicyID":35,"Trigger":"Schedule"}
@yogeek
yogeek / manifest.yaml
Last active May 17, 2023 15:11
k8s-echoserver
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
labels:
app: echoserver
spec:
replicas: 1
selector:
matchLabels:
@yogeek
yogeek / glow.md
Last active May 15, 2023 21:38
Charm.sh

Glow

https://github.com/charmbracelet/glow

Install

# for now we use a forked version of the official plugin to fix an issue (https://github.com/chessmango/asdf-glow/pull/1)
asdf plugin install https://github.com/yogeek/asdf-glow/
asdf install glow latest
@yogeek
yogeek / AWSContainerDay.txt
Created April 18, 2023 16:58
KubeCon EU 2023
AWS Container Day
https://aws-kubecon-eu.splashthat.com/
-------------------
VPC Lattice
- https://aws.amazon.com/fr/blogs/aws/introducing-vpc-lattice-simplify-networking-for-service-to-service-communication-preview/
- https://aws.amazon.com/blogs/networking-and-content-delivery/build-secure-multi-account-multi-vpc-connectivity-for-your-applications-with-amazon-vpc-lattice/
- https://aws.amazon.com/blogs/containers/introducing-aws-gateway-api-controller-for-amazon-vpc-lattice-an-implementation-of-kubernetes-gateway-api/
New K8S registry : https://kubernetes.io/blog/2022/11/28/registry-k8s-io-faster-cheaper-ga/
@yogeek
yogeek / ranked_failures_by_ns.sh
Created April 13, 2023 13:59
Kyverno reports
#!/usr/bin/env bash
declare -A failures
failures=()
for ns in $(kubectl get ns -l owner!="gtp" -o name)
do
NS=$(echo $ns | cut -d'/' -f2)
if [[ "$(kubectl get polr -n $NS 2>/dev/null | wc -l)" != "0" ]]
then
@yogeek
yogeek / calico-node.log
Created October 27, 2022 09:32
Calico-node issue with node local cache DNS
This file has been truncated, but you can view the full file.
calico-node-vgs4z calico-node 2022-10-27 08:14:45.911 [INFO][22] startup/startup.go 427: Early log level set to info
calico-node-vgs4z calico-node 2022-10-27 08:14:45.911 [INFO][22] startup/utils.go 127: Using NODENAME environment for node name ip-10-215-103-50.eu-central-1.compute.internal
calico-node-vgs4z calico-node 2022-10-27 08:14:45.911 [INFO][22] startup/utils.go 139: Determined node name: ip-10-215-103-50.eu-central-1.compute.internal
calico-node-vgs4z calico-node 2022-10-27 08:14:45.911 [INFO][22] startup/startup.go 94: Starting node ip-10-215-103-50.eu-central-1.compute.internal with version v3.24.3
calico-node-vgs4z calico-node 2022-10-27 08:14:46.145 [INFO][22] startup/startup.go 432: Checking datastore connection
calico-node-vgs4z calico-node 2022-10-27 08:14:46.257 [INFO][22] startup/startup.go 456: Datastore connection verified
calico-node-vgs4z calico-node 2022-10-27 08:14:46.258 [INFO][22] startup/startup.go 104: Datastore is ready
calico-node-vgs4z calico-node 2022-10-27 08:14:46.364 [INFO]
@yogeek
yogeek / sopssecret-cert-template.txt
Created October 12, 2022 07:58
Template k8s manifest with yq
$ cat /tmp/cert.pem
-------BEGIN CERTIFICATE-------
asdoqijepoqjwe1i49i120941p2j4omslasdajsdqweqwe
qwelqjwkasdlajsölkjasldkjakljsdlkjasdasdpiqwe
-------END CERTIFICATE--------
$ CERT=$(cat /tmp/cert.pem)
$ cat /tmp/test0.yaml
apiVersion: isindir.github.com/v1alpha2
@yogeek
yogeek / velero-pod-previous-log.txt
Created August 3, 2021 08:23
Velero github #4003
time="2021-08-03T07:00:57Z" level=info msg="setting log-level to INFO" logSource="pkg/cmd/server/server.go:172"
time="2021-08-03T07:00:57Z" level=info msg="Starting Velero server v1.6.2 (8c9cdb9603446760452979dc77f93b17054ea1cc)" logSource="pkg/cmd/server/server.go:174"
time="2021-08-03T07:00:57Z" level=info msg="No feature flags enabled" logSource="pkg/cmd/server/server.go:178"
time="2021-08-03T07:00:57Z" level=info msg="registering plugin" command=/velero kind=BackupItemAction logSource="pkg/plugin/clientmgmt/registry.go:100" name=velero.io/crd-remap-version
time="2021-08-03T07:00:57Z" level=info msg="registering plugin" command=/velero kind=BackupItemAction logSource="pkg/plugin/clientmgmt/registry.go:100" name=velero.io/pod
time="2021-08-03T07:00:57Z" level=info msg="registering plugin" command=/velero kind=BackupItemAction logSource="pkg/plugin/clientmgmt/registry.go:100" name=velero.io/pv
time="2021-08-03T07:00:57Z" level=info msg="registering plugin" command=/velero kind=BackupItemAction logSource="pkg
initContainers:
- command:
- sh
- -c
- id; whoami; mkdir /tmp/bench; /bin/thanosbench block plan -p continuous-365d-tiny
--max-time=6h | /bin/thanosbench block gen --output.dir /tmp/bench; cp -r /tmp/bench/*
/prometheus
image: quay.io/thanos/thanosbench:v0.2.0-rc.1
name: prom-init-thanosbench
volumeMounts: