Loading

lvscare 基于 lvs 实现的 k8s 高可用方案

#!/bin/bash

VIP="240.8.8.8"
master1="10.1.1.20"
master2="10.1.1.21"
master3="10.1.1.22"
mkdir -p /etc/kubernetes/manifests
cat << EOF | tee /etc/kubernetes/manifests/lvscare.yaml
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    component: lvscare
    tier: control-plane
  name: lvscare
  namespace: kube-system
spec:
  containers:
  - args:
    - care
    - --vs
    - ${VIP}:6443
    - --health-path
    - /healthz
    - --health-schem
    - https
    - --rs
    - ${master1}:6443
    - --rs
    - ${master2}:6443
    - --rs
    - ${master3}:6443
    command:
    - /usr/bin/lvscare
    image: lvscare:v4.0.0-amd64
    imagePullPolicy: IfNotPresent
    name: lvscare
    resources: {}
    securityContext:
      privileged: true
    volumeMounts:
    - mountPath: /lib/modules
      name: lib-modules
      readOnly: true
  hostNetwork: true
  priorityClassName: system-cluster-critical
  volumes:
  - hostPath:
      path: /lib/modules
      type: ""
    name: lib-modules
status: {}
EOF

lvscare

posted @ 2023-02-21 18:08  小维江湖  阅读(259)  评论(0编辑  收藏  举报