Skip to content

Instantly share code, notes, and snippets.

View rikatz's full-sized avatar
Away for the next days

Ricardo Katz rikatz

Away for the next days
View GitHub Profile
@rikatz
rikatz / deprecated.yaml
Created February 3, 2021 18:15
k8s infra deprecated objects
deprecatedapis:
- description: Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. DEPRECATED - This group version of Ingress is deprecated by networking.k8s.io/v1beta1 Ingress. See the release notes for more information.
group: extensions
kind: Ingress
version: v1beta1
name: ""
deprecated: true
items:
- scope: OBJECT
objectname: gcsweb
@rikatz
rikatz / deployment.yaml
Last active February 8, 2021 16:47
prom + certmanager + stackdriver
apiVersion: v1
kind: ConfigMap
metadata:
name: gke-certmanager-config
namespace: kube-system
data:
gke-metrics-agent-config.yaml : |
receivers:
prometheus:
config:
@rikatz
rikatz / gke-agent.yaml
Last active February 8, 2021 21:13
Using GKE Metrics Agent to send Prometheus Metrics to Stack Driver
apiVersion: v1
kind: ConfigMap
metadata:
name: gke-certmanager-config
namespace: kube-system
data:
gke-metrics-agent-config.yaml : |
receivers:
prometheus:
config:
@rikatz
rikatz / cert-manager-exporter.yaml
Created February 19, 2021 22:03
Cert Manager Exporter - GKE
apiVersion: v1
data:
prometheus.yaml: |
global:
scrape_interval: 300s
evaluation_interval: 300s
rule_files:
- "cert_rules.yaml"
scrape_configs:
- job_name: certmanager
@rikatz
rikatz / bla.log
Created March 14, 2021 19:08
failure cyclonus gke + calico
Expected combined:
+--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| TCP/80 | X/A | X/B | X/C | Y/A | Y/B | Y/C | Z/A | Z/B | Z/C |
| TCP/81 | | | | | | | | | |
| UDP/80 | | | | | | | | | |
| UDP/81 | | | | | | | | | |
+--------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| x/a | X | X | X | . | . | X | . | . | X |
| | X | X | X | X | X | X | X | X | X |
| | X | X | X | X | X | X | X | X | X |
@rikatz
rikatz / gcp-monitoring.go
Created March 23, 2021 00:01
Monitoring GCP with Go library
package main
import (
"context"
"fmt"
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
"google.golang.org/protobuf/types/known/durationpb"
)
@rikatz
rikatz / kpng.log
Last active April 9, 2021 17:11
kpng debug 1
Initial startup
=====================================
*****************
Service: &{Service:Namespace:"default" Name:"hello-world1" Type:"ClusterIP" IPs:{ClusterIP:"10.107.43.121" ExternalIPs:{}} Ports:{Name:"management" Protocol:TCP Port:15672 TargetPort:15672} Ports:{Name:"amqp" Protocol:TCP Port:5672 TargetPort:5672} Endpoints:[IPs:{V4:"172.16.104.14"}]}
*****************
*****************
Service: &{Service:Namespace:"default" Name:"hello-world1-nodes" Type:"ClusterIP" IPs:{ClusterIP:"None" ExternalIPs:{}} Ports:{Name:"epmd" Protocol:TCP Port:4369 TargetPort:4369} Ports:{Name:"cluster-rpc" Protocol:TCP Port:25672 TargetPort:25672} Endpoints:[Hostname:"hello-world1-server-0" IPs:{V4:"172.16.104.14"}]}
*****************
*****************
Service: &{Service:Namespace:"default" Name:"kubernetes" Type:"ClusterIP" IPs:{ClusterIP:"10.96.0.1" ExternalIPs:{}} Ports:{Name:"https" Protocol:TCP Port:443 TargetPort:6443} Endpoints:[IPs:{V4:"192.168.0.150"}]}
@rikatz
rikatz / dashboard.json
Created April 16, 2021 19:18
Falco Loki dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
iptables-xml
ldd /usr/bin/iptables-xml
linux-vdso.so.1 (0x00007fff2c394000)
libip4tc.so.2 => /usr/lib/x86_64-linux-gnu/libip4tc.so.2 (0x00007f5f0316c000)
libip6tc.so.2 => /usr/lib/x86_64-linux-gnu/libip6tc.so.2 (0x00007f5f03162000)
libxtables.so.12 => /usr/lib/x86_64-linux-gnu/libxtables.so.12 (0x00007f5f0314f000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5f02f8a000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5f02f84000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5f031fb000)
package main
import (
"context"
"encoding/base64"
"flag"
"fmt"
"log"
"math/rand"
"time"