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
  • 09:51 (UTC +08:00)
  • LinkedIn in/yankay
View GitHub Profile
@yankay
yankay / gist:bdd3ca69fe236d300e4f190540f829e8
Last active February 21, 2022 08:13
快速安装 Docker - Centos
# 适用于 centos、redhat、x86 和 arm版本
export DOCKER_CE_YUM="mirrors.aliyun.com/docker-ce"
# 安装 Docker-CE
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://$DOCKER_CE_YUM/linux/centos/docker-ce.repo
sed -i 's+download.docker.com+$DOCKER_CE_YUM+' /etc/yum.repos.d/docker-ce.repo
@yankay
yankay / gist:f8d425da1f0c3cf95e0f4d59b694c326
Last active February 21, 2022 08:50
快速安装 Docker - Ubuntu
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# Step 4: 更新并安装Docker-CE
@yankay
yankay / gist:56811ecc4b8324b1cba602e0213537a3
Last active April 10, 2024 03:45
快速创建 kind 集群(Ubuntu)
export KUBE_VERSION="1.29.2"
export KIND_VERSION=$(curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' )
# 配置内核
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
br_netfilter
EOF
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
@yankay
yankay / gist:4b320500f6a10fa192cb6ef9da020372
Last active December 20, 2023 07:09
快速安装 Helm
cd /tmp
export HELM_VERSION=$(curl -s https://api.github.com/repos/helm/helm/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' )
wget "https://files.m.daocloud.io/get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz"
tar -zxvf helm-${HELM_VERSION}-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
helm version
cd /tmp
export K9S_VERSION=$(curl -s https://api.github.com/repos/derailed/k9s/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' )
wget https://files.m.daocloud.io/github.com/derailed/k9s/releases/download/${K9S_VERSION}/k9s_Linux_amd64.tar.gz
# wget https://github.com/derailed/k9s/releases/download/${K9S_VERSION}/k9s_Linux_amd64.tar.gz
tar -zxvf k9s_Linux_amd64.tar.gz
chmod +x k9s
mv k9s /usr/bin/k9s
k9s version
@yankay
yankay / gist:c912bd5b238f61c8b45f0a81a5b921a9
Last active March 17, 2023 08:21
一键安装 istio(Helm)
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}/
kubectl create namespace istio-system
helm install istio-base manifests/charts/base -n istio-system
helm install istiod manifests/charts/istio-control/istio-discovery \
--set global.hub="docker.m.daocloud.io/istio" \
@yankay
yankay / gist:1df83f25bb8a6711f65d909d8af20480
Created February 23, 2022 12:05
快速安装 elasticsearch
helm repo add bitnami https://charts.bitnami.com/bitnami
helm upgrade --install --create-namespace \
elasticsearch bitnami/elasticsearch \
--set global.imageRegistry=docker.m.daocloud.io \
-n elasticsearch
kubectl get pods -n elasticsearch
@yankay
yankay / gist:dbac42eaa648955b61272c861f7861ff
Last active August 15, 2022 01:50
快速安装 kubectl 和 kubens (ubuntu)
export KUBE_VERSION="1.22.1"
# 安装 Kubectl
apt-get update && apt-get install -y apt-transport-https
curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
EOF
# 参考:https://github.com/minio/operator/blob/master/helm/operator/README.md
helm install \
--namespace minio-operator \
--create-namespace \
minio-operator minio/operator \
--set operator.image.repository=docker.m.daocloud.io/minio/operator \
--set console.image.repository=docker.m.daocloud.io/minio/console
@yankay
yankay / gist:2ed348709063683a1df5b1649720fb11
Last active March 25, 2022 03:19
快速创建 kube-prometheus-stack
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install \
--namespace prometheus \
--create-namespace \
prometheus prometheus-community/kube-prometheus-stack \
--set alertmanager.alertmanagerSpec.image.repository=quay.m.daocloud.io/prometheus/alertmanager \
--set prometheusOperator.image.repository=quay.m.daocloud.io/prometheus-operator/prometheus-operator \
--set prometheusOperator.prometheusDefaultBaseImage=quay.m.daocloud.io/prometheus/prometheus \