Skip to content

Instantly share code, notes, and snippets.

@oke-py
oke-py / bundle.yaml.diff
Created November 22, 2021 08:24
diff -uprN prometheus-operator/v0.48.1/bundle.yaml prometheus-operator/v0.52.1/bundle.yaml
This file has been truncated, but you can view the full file.
--- 48.yaml 2021-11-22 17:17:10.000000000 +0900
+++ 52.yaml 2021-11-22 17:16:53.000000000 +0900
@@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.4.1
+ controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
@oke-py
oke-py / setup.sh
Last active November 15, 2021 12:52
dreamkast development environment on AWS Cloud9 Ubuntu
#!/bin/bash
sudo apt update
sudo apt install -y build-essential vim curl git gzip unzip apt-transport-https ca-certificates gnupg-agent software-properties-common libssl-dev zlib1g-dev
# asdf
# https://asdf-vm.com/guide/getting-started.html
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
. ~/.bashrc
@oke-py
oke-py / kubelet-metrics-cadvisor.txt
Created September 18, 2021 00:46
kubectl get --raw /api/v1/nodes/kind-worker/proxy/metrics/cadvisor
This file has been truncated, but you can view the full file.
# HELP cadvisor_version_info A metric with a constant '1' value labeled by kernel version, OS version, docker version, cadvisor version & cadvisor revision.
# TYPE cadvisor_version_info gauge
cadvisor_version_info{cadvisorRevision="",cadvisorVersion="",dockerVersion="Unknown",kernelVersion="5.10.47-linuxkit",osVersion="Ubuntu 21.04"} 1
# HELP container_blkio_device_usage_total Blkio Device bytes usage
# TYPE container_blkio_device_usage_total counter
container_blkio_device_usage_total{container="",device="/dev/vda",id="/",image="",major="254",minor="0",name="",namespace="",operation="Async",pod=""} 8.9628672e+07 1631925974172
container_blkio_device_usage_total{container="",device="/dev/vda",id="/",image="",major="254",minor="0",name="",namespace="",operation="Discard",pod=""} 0 1631925974172
container_blkio_device_usage_total{container="",device="/dev/vda",id="/",image="",major="254",minor="0",name="",namespace="",operation="Read",pod=""} 2.493857792e+10 1631925974172
@oke-py
oke-py / kubelet-metrics.txt
Created September 18, 2021 00:45
kubectl get --raw /api/v1/nodes/kind-worker/proxy/metrics
# HELP apiserver_audit_event_total [ALPHA] Counter of audit events generated and sent to the audit backend.
# TYPE apiserver_audit_event_total counter
apiserver_audit_event_total 0
# HELP apiserver_audit_requests_rejected_total [ALPHA] Counter of apiserver requests rejected due to an error in audit logging backend.
# TYPE apiserver_audit_requests_rejected_total counter
apiserver_audit_requests_rejected_total 0
# HELP apiserver_client_certificate_expiration_seconds [ALPHA] Distribution of the remaining lifetime on the certificate used to authenticate a request.
# TYPE apiserver_client_certificate_expiration_seconds histogram
apiserver_client_certificate_expiration_seconds_bucket{le="0"} 0
apiserver_client_certificate_expiration_seconds_bucket{le="1800"} 0
@oke-py
oke-py / metrics-server.txt
Created September 18, 2021 00:24
metrics-server.kube-system/metrics
# HELP apiserver_audit_event_total [ALPHA] Counter of audit events generated and sent to the audit backend.
# TYPE apiserver_audit_event_total counter
apiserver_audit_event_total 0
# HELP apiserver_audit_requests_rejected_total [ALPHA] Counter of apiserver requests rejected due to an error in audit logging backend.
# TYPE apiserver_audit_requests_rejected_total counter
apiserver_audit_requests_rejected_total 0
# HELP apiserver_client_certificate_expiration_seconds [ALPHA] Distribution of the remaining lifetime on the certificate used to authenticate a request.
# TYPE apiserver_client_certificate_expiration_seconds histogram
apiserver_client_certificate_expiration_seconds_bucket{le="0"} 0
apiserver_client_certificate_expiration_seconds_bucket{le="1800"} 0
@oke-py
oke-py / node-exporter.txt
Created September 18, 2021 00:18
node-expoter:9100/metrics
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 6.1916e-05
go_gc_duration_seconds{quantile="0.25"} 0.000530375
go_gc_duration_seconds{quantile="0.5"} 0.001654042
go_gc_duration_seconds{quantile="0.75"} 0.007034125
go_gc_duration_seconds{quantile="1"} 0.192434791
go_gc_duration_seconds_sum 110.340325737
go_gc_duration_seconds_count 3153
# HELP go_goroutines Number of goroutines that currently exist.
@oke-py
oke-py / grafana-datasource.md
Last active June 29, 2023 21:33
grafana datasource

Install grafana via helm

grafana.yaml

datasources:
  datasources.yaml:
    apiVersion: 1
    datasources:
    - name: Loki
 type: loki
@oke-py
oke-py / prometheus.yaml
Created June 20, 2021 10:33
[1ed762d] kubectl -n argocd get application prometheus -o yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"argoproj.io/v1alpha1","kind":"Application","metadata":{"annotations":{},"finalizers":["resources-finalizer.argocd.argoproj.io"],"labels":{"argocd.argoproj.io/instance":"argocd-apps"},"name":"prometheus","namespace":"argocd"},"spec":{"destination":{"namespace":"argocd","server":"https://kubernetes.default.svc"},"project":"default","source":{"path":"manifests/infra/prometheus/overlays/development","repoURL":"https://github.com/cloudnativedaysjp/dreamkast-infra.git","targetRevision":"426-prometheus"},"syncPolicy":{"automated":{"prune":true},"syncOptions":["CreateNamespace=true"]}}}
creationTimestamp: "2021-06-19T06:45:58Z"
finalizers:
- resources-finalizer.argocd.argoproj.io
generation: 24
@oke-py
oke-py / 5ac42e8.txt
Created June 20, 2021 10:32
kubectl -n prometheus logs prometheus-k8s-0
level=error ts=2021-06-18T12:31:11.055Z caller=klog.go:116 component=k8s_client_runtime func=ErrorDepth msg="pkg/mod/k8s.io/client-go@v0.21.0/tools/cache/reflector.go:167: Failed to watch *v1.Pod: failed to list *v1.Pod: pods is forbidden: User \"system:serviceaccount:prometheus:prometheus-k8s\" cannot list resource \"pods\" in API group \"\" in the namespace \"prometheus\""
level=error ts=2021-06-18T12:31:11.147Z caller=klog.go:116 component=k8s_client_runtime func=ErrorDepth msg="pkg/mod/k8s.io/client-go@v0.21.0/tools/cache/reflector.go:167: Failed to watch *v1.Endpoints: failed to list *v1.Endpoints: endpoints is forbidden: User \"system:serviceaccount:prometheus:prometheus-k8s\" cannot list resource \"endpoints\" in API group \"\" in the namespace \"prometheus\""
level=error ts=2021-06-18T12:31:31.129Z caller=klog.go:116 component=k8s_client_runtime func=ErrorDepth msg="pkg/mod/k8s.io/client-go@v0.21.0/tools/cache/reflector.go:167: Failed to watch *v1.Service: failed to list *v1.Service: services is forbi
@oke-py
oke-py / create-control-plane.sh
Last active January 11, 2021 08:14
falco-with-containerd
#!/bin/bash
gcloud compute instances create control-plane --zone=europe-west3-c \
--machine-type=e2-medium \
--image=ubuntu-1804-bionic-v20201014 \
--image-project=ubuntu-os-cloud \
--boot-disk-size=50GB