V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  dunhanson  ›  全部回复第 13 页 / 共 26 页
回复总数  509
1 ... 9  10  11  12  13  14  15  16  17  18 ... 26  
@liuxu 了解,ubuntu 我也试试
@liuxu 不过,我之前自己用 virtualbox 自己安装的 debian 10.7 好像就没有这个问题
@liuxu 谢了,太用心了。两种我都是试试
@liuxu 必须要升级内核吗
@liuxu 上面三个回复我把步骤发出来了,谢了
kubeadm init --apiserver-advertise-address=192.168.33.10
安装 kubeadm 、kubelet 和 kubectl
# 这一步需要手动下载保存到对应路径
# https://mirrors.tuna.tsinghua.edu.cn/help/kubernetes/
# mv /home/vagrant/apt-key.gpg /usr/share/keyrings/kubernetes-archive-keyring.gpg
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg

echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://mirrors.tuna.tsinghua.edu.cn/kubernetes/apt kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl
允许 iptables 检查桥接流量
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
net.bridge.bridge-nf-call-iptables = 1
EOF
sudo sysctl --system
# 设置
sudo apt-get remove docker docker-engine docker.io

sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \
$(lsb_release -cs) \
stable"

# 安装
sudo apt-get update
sudo apt-get install docker-ce

# 服务开启并设置开机启动
systemctl start docker
systemctl enable docker

# 关闭 firewalld
systemctl stop firewalld
systemctl disable firewalld

# 关闭 swap
swapoff -a
sed -i 's/^.*swap.*$/#&/' /etc/fstab

# cgroupdriver 修改(不设置 kubeadm init 会有警告)
vi /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"],
"registry-mirrors": ["https://tp9vl69u.mirror.aliyuncs.com"]
}
systemctl daemon-reload
systemctl restart docker
@12101111 我对比了,debian10 的内核是 Linux 4.19.0-16-amd64,centos7 是 Linux 3.10.0-1127.el7.x86_64
@liuxu 这个方法我搜到过,没效果,你可以吗
2021-06-22 09:08:30 +08:00
回复了 dunhanson 创建的主题 程序员 docker 运行 redis, NFS 挂载目录权限不足的问题
@xuanbg jumpserver 本身就做了映射,我是把怎么 jumpserver 目录做了 nfs 挂载
2021-06-03 10:18:04 +08:00
回复了 beryl 创建的主题 Kubernetes 是否有必要用 K8S
之前我用过 docker compse 真的是难用,自己还要写很多辅助脚本来控制
2021-06-03 10:17:22 +08:00
回复了 beryl 创建的主题 Kubernetes 是否有必要用 K8S
懂 k8s 的人应该还好吧,我们公司我自己搭建的,生产环境部分用了 k8s
k8s 的优势就是人家有一整套的流程和规范,扩容回滚什么超级方便
2021-06-02 10:55:55 +08:00
回复了 dunhanson 创建的主题 程序员 kubernetes ingress 怎么获取真实的 ip?有使用 frp
@amrom @comphilip 已解决
2021-06-02 10:27:17 +08:00
回复了 dunhanson 创建的主题 程序员 kubernetes ingress 怎么获取真实的 ip?有使用 frp
这么配置,http 请求时可以正常获取到真实 ip 的
```yml
# Source: ingress-nginx/templates/controller-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
labels:
helm.sh/chart: ingress-nginx-2.13.0
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/version: 0.35.0
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: controller
name: ingress-nginx-controller
namespace: ingress-nginx
data:
enable-real-ip: "true"
forwarded-for-header: "X-Forwarded-For"
proxy-real-ip-cidr: "192.168.2.0/24"
```

[![2M3wDK.png]( https://z3.ax1x.com/2021/06/02/2M3wDK.png)]( https://imgtu.com/i/2M3wDK)
2021-06-01 15:54:21 +08:00
回复了 dunhanson 创建的主题 程序员 kubernetes ingress 怎么获取真实的 ip?有使用 frp
@amrom 我回头在研究研究
2021-06-01 14:44:38 +08:00
回复了 dunhanson 创建的主题 程序员 kubernetes ingress 怎么获取真实的 ip?有使用 frp
@amrom 第一种我之前试过,应该是不行的

应该是配置在 ingress-nginx 的 configmap 中吧?
2021-06-01 14:06:40 +08:00
回复了 dunhanson 创建的主题 程序员 kubernetes ingress 怎么获取真实的 ip?有使用 frp
@amrom 能具体说下吗
2021-06-01 14:06:20 +08:00
回复了 dunhanson 创建的主题 程序员 kubernetes ingress 怎么获取真实的 ip?有使用 frp
生产环境的机子都是直通公网 ip,就可以 nginx 和 client 直连。
但是线下环境,必须通过路由器转发一道,或者 frp 进行
1 ... 9  10  11  12  13  14  15  16  17  18 ... 26  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5602 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 22ms · UTC 07:22 · PVG 15:22 · LAX 00:22 · JFK 03:22
Developed with CodeLauncher
♥ Do have faith in what you're doing.