Skip to content

Instantly share code, notes, and snippets.

View yankay's full-sized avatar
🦆
I love nature

Kay Yan yankay

🦆
I love nature
  • DaoCloud
  • Shanghai, China
  • 18:07 (UTC +08:00)
  • LinkedIn in/yankay
View GitHub Profile
@yankay
yankay / gist:9aa11090a5dc8dfabf52c047501956f9
Last active March 28, 2023 08:50
快速 用 kube-bench 做 CIS-Benchmark
wget "https://ghproxy.com/raw.githubusercontent.com/aquasecurity/kube-bench/main/job-master.yaml"
kubectl apply -f job-master.yaml
kubectl get pods
kubectl logs kube-bench-master-zvplg
@yankay
yankay / gist:e0deda7aca5f891d9237351c4510bb35
Created March 17, 2023 08:21
一键安装 istio ( istioctl)
export ISTIO_VERSION="1.17.1"
wget "https://files.m.daocloud.io/github.com/istio/istio/releases/download/${ISTIO_VERSION}/istio-${ISTIO_VERSION}-linux-amd64.tar.gz"
tar -zxvf istio-${ISTIO_VERSION}-linux-amd64.tar.gz
cd istio-${ISTIO_VERSION}/
@yankay
yankay / gist:52ec6efe6d49631e5f673a22eb5b1ca5
Last active March 14, 2023 09:14
公司内网 containerd 加速
修改配置 `vi /etc/containerd/config.toml`
```
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
# docker
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
endpoint = ["https://release-ci.daocloud.io/v2/docker.m.daocloud.io"]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.m.daocloud.io"]
endpoint = ["https://release-ci.daocloud.io/v2/docker.m.daocloud.io"]
cd /tmp
export ISTIO_VERSION="1.16.1"
wget "https://ghproxy.com/https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/istioctl-${ISTIO_VERSION}-linux-amd64.tar.gz"
tar -zxvf istioctl-${ISTIO_VERSION}-linux-amd64.tar.gz
chmod +x istioctl
mv istioctl /usr/bin/istioctl
istioctl version
@yankay
yankay / gist:7d2fba33d59c33b43d0a78b2fe047cb0
Created November 15, 2022 10:19
快速安装 opentelemetry-demo
参考:https://github.com/open-telemetry/opentelemetry-demo
wget "https://ghproxy.com/github.com/open-telemetry/opentelemetry-helm-charts/releases/download/opentelemetry-demo-0.11.1/opentelemetry-demo-0.11.1.tgz"
kubectl create ns otel-demo
helm upgrade --install my-otel-demo opentelemetry-demo-0.11.1.tgz --namespace otel-demo \
--set observability.jaeger.image.repository=docker.m.daocloud.io/jaegertracing/all-in-one \
--set default.image.repository=docker.m.daocloud.io/otel/demo \
--set components.redis.imageOverride.repository=docker.m.daocloud.io/redis \
@yankay
yankay / gist:82548c10b763dd230e77604c1ba52d02
Last active November 3, 2022 06:07
快速安装 kubecost
参考:https://www.kubecost.com/install.html
kubectl create namespace kubecost
wget "https://kubecost.github.io/cost-analyzer/cost-analyzer-1.97.0.tgz"
helm upgrade --install kubecost cost-analyzer-1.97.0.tgz --namespace kubecost \
--set kubecostFrontend.image=gcr.m.daocloud.io/kubecost1/frontend \
--set kubecostModel.image=gcr.m.daocloud.io/kubecost1/cost-model \
--set grafana.image.repository=docker.m.daocloud.io/grafana/grafana \
--set grafana.sidecar.image=docker.m.daocloud.io/kiwigrid/k8s-sidecar:1.19.2 \
@yankay
yankay / gist:8711b7413cb8eded7a7133c4f4d7d387
Last active October 18, 2022 11:18
快速安装 nfs-subdir-external-provisioner
helm repo add community https://release.daocloud.io/chartrepo/community
helm install nfs-subdir-external-provisioner community/nfs-subdir-external-provisioner \
--set image.repository=k8s.m.daocloud.io/sig-storage/nfs-subdir-external-provisioner \
--set nfs.server=10.6.108.184 \
--set nfs.path=/nfs/exports/myshare
kubectl patch storageclass nfs-client -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
@yankay
yankay / gist:39f94bb7c62a5184acb59ceb26afa0b2
Created September 27, 2022 03:07
快速安装 lazygit
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[0-35.]+')
curl -Lo lazygit.tar.gz "https://files.m.daocloud.io/github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
sudo tar xf lazygit.tar.gz -C /usr/local/bin lazygit
lazygit --version
helm repo add minio https://charts.min.io/
helm install --namespace minio --create-namespace \
--set rootUser=rootuser,rootPassword=rootpass123 \
--set image.repository=docker.m.daocloud.io/minio/minio \
--set mcImage.repository=docker.m.daocloud.io/minio/mc \
minio minio/minio
@yankay
yankay / gist:edcd16d4a6f7887527d541a2507b0247
Last active August 22, 2022 09:53
快速安装 cert-manager
cd /tmp
wget https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.yaml
cat cert-manager.yaml | sed 's/quay.io/quay.m.daocloud.io/g' > c.yaml
kubectl apply -f c.yaml