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
  • 13:14 (UTC +08:00)
  • LinkedIn in/yankay
View GitHub Profile
export http_proxy="http://xxxx:10809"
export https_proxy="http://xxxx:10809"
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash
@yankay
yankay / gist:35fa88f347764ab344cdc31ff14563a3
Created August 15, 2023 06:03
快速启动 kubectl-node-shell
curl -LO https://files.m.daocloud.io/github.com/kvaps/kubectl-node-shell/raw/v1.7.0/kubectl-node_shell
chmod +x ./kubectl-node_shell
mv ./kubectl-node_shell /usr/local/bin/kubectl-node_shell
@yankay
yankay / tf-distributed-mnist.py
Created July 20, 2023 07:06
tf-distributed-mnist.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import gzip
import numpy as np
import tensorflow as tf
from tensorflow import keras
print('TensorFlow version: {}'.format(tf.__version__))
dataset_path = "/root/data/"
@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"}}}'