Skip to content

Instantly share code, notes, and snippets.

View yangl's full-sized avatar
🎯
Focusing

YANGLiiN yangl

🎯
Focusing
View GitHub Profile
@yangl
yangl / Kubernetes Ingress.md
Last active December 12, 2018 11:01
Kubernetes Ingress 对比

https://docs.google.com/spreadsheets/d/16bxRgpO1H_Bn-5xVZ1WrR_I-0A-GOI6egmhvqqLMOmg/edit#gid=1612037324

nginx-ingress安装:

https://github.com/helm/charts/blob/master/stable/nginx-ingress/README.md

helm upgrade --install nginx-ingress stable/nginx-ingress --namespace kube-system --set controller.replicaCount=3 --set controller.service.type=NodePort --set controller.service.nodePorts.http=20080 --set controller.service.nodePorts.https=20443 --set defaultBackend.image.repository=chenliujin/defaultbackend --set controller.stats.enabled=true --set controller.metrics.enabled=true
@yangl
yangl / centos7-update-kernel.md
Last active December 7, 2018 01:46
CentOS7 内核升级

https://www.elrepo.org/

升级内核

# 载入公钥
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# 安装ELRepo
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
# 载入elrepo-kernel元数据
yum --disablerepo=\* --enablerepo=elrepo-kernel repolist
@yangl
yangl / haproxy.cfg
Last active December 11, 2018 06:01
kubernetes master高可用:HAProxy + keepalived配置 公有云上由于默认禁用vrrp,要申请开放!腾讯云可使用HAVIP产品。
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
nbproc 1
@yangl
yangl / istio.helm.md
Last active December 27, 2018 09:01
istio 1.0.5 helm方式安装

安装

kubectl create namespace istio-system

helm upgrade istio . --install --namespace=istio-system --set gateways.istio-ingressgateway.type=NodePort,grafana.enabled=true,grafana.service.type=NodePort,prometheus.service.service.nodePort.enabled=true,servicegraph.enabled=true,tracing.enabled=true,tracing.jaeger.ingress.enabled=true,tracing.ingress.enabled=true,kiali.enabled=true,kiali.ingress.enabled=true,kiali.ingress.hosts[0]=kiali.local,kiali.dashboard.grafanaURL=http://grafana:3000,kiali.dashboard.jaegerURL=http://jaeger-query:16686,pilot.traceSampling=100.0  --set global.proxy.includeIPRanges="10.68.0.0/16\,172.20.0.0/16"

删除 清理

helm delete istio --purge
@yangl
yangl / istio-ServiceEntry-curl.md
Last active December 27, 2018 11:13
Istio访问集群多个外部服务,可以使用istio sleep那个pod进去发送curl验证 https://preliminary.istio.io/zh/docs/tasks/traffic-management/egress/
kubectl exec -it sleep-68648fd5b5-p6hsc -c sleep -- sh

distinct

{
  "size": 0,
  "aggs": {
    "uniq_country": {
      "terms": {
        "field": "alarmData.alarmType"
      }
@yangl
yangl / docker.sh
Last active May 11, 2019 03:25
spring-boot-saturn Dockerfile 例子 在外边调用dubbo内部的start.sh并tail -f /dev/null阻止容器退出
docker build -t saturn-console:latest ./
docker run --rm --name=saturn-console -itd -p28080:8080 -e DB_USER=root -e DB_PASSWORD=67890 saturn-console:latest
docker exec -it saturn-console /bin/sh
docker save xxxx > myap.tar
tar -zcvf myap.tar.gz myap.tar
@yangl
yangl / 0-pulsar 收发消息过程.md
Last active February 8, 2021 09:45
Pulsar 收发消息过程

Broker启动

Main class: org.apache.pulsar.PulsarStandaloneStarter
VM Options: -Dlog4j2.configurationFile=D:\opensource\pulsar\conf\log4j2.xml
Projram arguments: --config conf/standalone.conf --no-functions-worker --no-stream-storage --wipe-data

查看进程是否正常启动?

@yangl
yangl / bookkeeper-topology.conf
Last active December 13, 2022 07:41
Apache Pulsar 机架感知策略 --networkTopologyScript
# bookie-1
10.207.128.13 /SZ/FT
10.207.128.14 /SZ/FT
10.207.128.15 /SZ/FT
10.207.128.16 /SZ/FT
10.207.128.17 /SZ/FT
# bookie-2
10.206.128.204 /SZ/NS
10.206.128.205 /SZ/NS
@yangl
yangl / EpollChannelConfig.java
Last active June 12, 2019 06:25
Netty Epoll的LT、ET模式使用场景,详见注释。
/**
* Set the {@link EpollMode} used. Default is
* {@link EpollMode#EDGE_TRIGGERED}. If you want to use {@link #isAutoRead()} {@code false} or
* {@link #getMaxMessagesPerRead()} and have an accurate behaviour you should use
* {@link EpollMode#LEVEL_TRIGGERED}.
*
* <strong>Be aware this config setting can only be adjusted before the channel was registered.</strong>
*/
public EpollChannelConfig setEpollMode(EpollMode mode) {
if (mode == null) {