Skip to content

Instantly share code, notes, and snippets.

View yogeek's full-sized avatar

Guillaume Dupin yogeek

View GitHub Profile
#!/bin/bash
REPOS=$(aws ecr describe-repositories --query 'repositories[].repositoryName' --output text)
for repo in $REPOS; do
TAGS=$(aws ecr list-images --repository-name $repo --query 'imageIds[].imageDigest' --output text)
for tag in $TAGS; do
echo "Deleting image: $tag"
aws ecr batch-delete-image --repository-name $repo --image-ids imageDigest=$tag
done
done
@yogeek
yogeek / crash.log
Created August 10, 2020 10:37
Terraform crash provider-aws 3.1.0
2020/08/10 11:33:54 [INFO] Terraform version: 0.12.29
2020/08/10 11:33:54 [INFO] Go runtime version: go1.12.13
2020/08/10 11:33:54 [INFO] CLI args: []string{"/home/user/.tfenv/versions/0.12.29/terraform", "plan", "-var", "[email protected]", "-var", "tag_commit_id=018fa1bb0e6014dd23bed805ba1624965fa2c3a4", "-var", "account_id=XXXXX", "-var-file=images.tfvars"}
2020/08/10 11:33:54 [DEBUG] Attempting to open CLI config file: /home/user/.terraformrc
2020/08/10 11:33:54 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/08/10 11:33:54 [DEBUG] checking for credentials in "/home/user/.terraform.d/plugins"
2020/08/10 11:33:54 [INFO] CLI command args: []string{"plan", "-var", "[email protected]", "-var", "tag_commit_id=018fa1bb0e6014dd23bed805ba1624965fa2c3a4", "-var", "account_id=XXXXX", "-var-file=images.tfvars"}
2020/08/10 11:33:54 [TRACE] Meta.Backend: built configuration for "s3" backend with hash value 3112734546
2020/08/10 11:33:54 [TRACE] Preserving existing state
@yogeek
yogeek / grafana-plugins.log
Created August 10, 2020 15:27
China test
ubuntu@ip-10-20-102-176:~$ curl -L https://grafana.com/api/plugins/grafana-piechart-panel/versions/1.6.0/download -o p.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 140 100 140 0 0 170 0 --:--:-- --:--:-- --:--:-- 170
100 469k 0 469k 0 0 60341 0 --:--:-- 0:00:07 --:--:-- 50094
ubuntu@ip-10-20-102-176:~$ curl -L https://grafana.com/api/plugins/camptocamp-prometheus-alertmanager-datasource/versions/0.0.8/download -o cp.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
@yogeek
yogeek / github-cli.sh
Last active April 26, 2021 17:29
github-cli.sh
#########
# Setup #
#########
# Install `gh` CLI
# - With https://github.com/asdf-vm/asdf :
asdf plugin add github-cli
asdf install github-cli latest
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:
@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
@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 / 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 / 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 / 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/