使用 Jenkins 进行服务拨测
· ☕ 3 分钟
1. 为什么要拨测 对于系统中的一些关键服务,我们通常会配置监控服务。当故障发生时,能够尽快被检测到,发送通知给关注人。当故障发生后,能够有效地追溯故障过程。 拨测是监控系统中的一个重要环节,能够检测服务的网络质量,并提供实时告警。 在公有云上,云厂

开发 Tips(16)
· ☕ 2 分钟
主要记录最近遇到的一些开发问题,解决方法。 1. Kubernetes 服务仅在负载节点可用 正常情况下 NodePort 类型的 Service ,任意 Node 节点 IP + 端口,都可以访问。但是,也有可能仅负载的 Node 节点 IP + 端口可以访问。 首先,可以尝试配置转发相关参数: 1 2 3 4 5 6 cat <<EOF > /etc/sysctl.d/k8s.conf net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 net.ipv4.ip_forward=1 vm.swappiness=0 EOF 1 sysctl

Kubernetes 签发 Ingress 证书及日常故障运维
· ☕ 2 分钟
1. 自动签发 Ingress 证书 安装 cert-manager 1 2 3 4 5 6 7 8 9 10 kubectl apply -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.10/deploy/manifests/00-crds.yaml kubectl create namespace cert-manager kubectl label namespace cert-manager certmanager.k8s.io/disable-validation=true helm repo add jetstack https://charts.jetstack.io helm repo update helm install \ --name cert-manager \ --namespace cert-manager \ --version v0.10.0 \ jetstack/cert-manager 创建一个全局的签发机构 新建文件 issuer.yaml 1 2 3 4 5 6 7 8 9 10 11 12 apiVersion: certmanager.k8s.io/v1alpha1 kind: ClusterIssuer metadata: name: letsencrypt-prod namespace: cert-manager spec: acme: server: https://acme-v02.api.letsencrypt.org/directory email: [email protected] privateKeySecretRef: name: letsencrypt-prod http01: {} 创建签发机构 1 kubectl apply -f issuer.yaml 签发证书 新建

Kubernetes 中 Deployment 的基本操作
· ☕ 2 分钟
Deployment 通过创建 ReplicaSet 控制 Pod 的数量、状态。本篇主要介绍一些 Deployment 常用的操作。 1. Deployment yaml 格式 带上 --dry-run 参数表示并不执行命令,仅生成 yaml 输出: 1 kubectl create deployment nginx --image=nginx --dry-run -o yaml apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: null labels: app: nginx name: nginx spec: replicas: 1 selector: matchLabels: app: nginx strategy: {} template: metadata: creationTimestamp: null labels: app: nginx spec: containers: - image: nginx name: nginx resources: {} status: {} 2. 创建 使用 run 参数 1 kubectl run nginx --image=nginx 使用

Kubernetes 中的证书
· ☕ 2 分钟
我使用的是 Kubernetes 1.15.3 ,不同版本的处理方法可能会有不同。 1. 关于证书 根证书是自签的 根证书是由自己签发的。在浏览器中,内置了常见的证书服务商的 CA 证书。因此,浏览器才会信任这些证书服务商签发的下一级证书。 我们也可以生成根证书,但是需要将根证书添加到系统信