Skip to content

Instantly share code, notes, and snippets.

Avatar

Naoki Oketani oke-py

View GitHub Profile
@oke-py
oke-py / bundle.yaml.diff
Created Nov 22, 2021
diff -uprN prometheus-operator/v0.48.1/bundle.yaml prometheus-operator/v0.52.1/bundle.yaml
View bundle.yaml.diff
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 Nov 15, 2021
dreamkast development environment on AWS Cloud9 Ubuntu
View setup.sh
#!/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 Sep 18, 2021
kubectl get --raw /api/v1/nodes/kind-worker/proxy/metrics/cadvisor
View kubelet-metrics-cadvisor.txt
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 Sep 18, 2021
kubectl get --raw /api/v1/nodes/kind-worker/proxy/metrics
View kubelet-metrics.txt
# 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 Sep 18, 2021
metrics-server.kube-system/metrics
View metrics-server.txt
# 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 Sep 18, 2021
node-expoter:9100/metrics
View node-exporter.txt
# 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 Aug 15, 2021
grafana datasource
View grafana-datasource.md

Install grafana via helm

grafana.yaml

datasources:
  datasources.yaml:
    apiVersion: 1
    datasources:
    - name: Loki
      type: loki
@oke-py
oke-py / prometheus.yaml
Created Jun 20, 2021
[1ed762d] kubectl -n argocd get application prometheus -o yaml
View prometheus.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 Jun 20, 2021
kubectl -n prometheus logs prometheus-k8s-0
View 5ac42e8.txt
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 Jan 11, 2021
falco-with-containerd
View create-control-plane.sh
#!/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