Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行完,kube-proxy还是报证书问题,有重启过proxy #22

Open
wushunqing opened this issue Jul 29, 2024 · 3 comments
Open

执行完,kube-proxy还是报证书问题,有重启过proxy #22

wushunqing opened this issue Jul 29, 2024 · 3 comments

Comments

@wushunqing
Copy link

image

@wushunqing
Copy link
Author

我的域名是i定义的,这个kebeadmin生成的证书貌似没有我的域名

@yuyicai
Copy link
Owner

yuyicai commented Jul 29, 2024

cluster-endpoint 这个域名不在你的原来的证书里面(新证书是复制旧证书的域名列表)

@yuyicai
Copy link
Owner

yuyicai commented Jul 29, 2024

cluster-endpoint 这个域名不在你的原来的证书里面(新证书是复制旧证书的域名列表)

有两种方法可解决:

  1. 可以修改admin config 配置文件使用证书上已经有的域名列表去访问
  2. 可以修改证书脚本 42 行 https://github.com/yuyicai/update-kube-cert/blob/master/update-kubeadm-cert.sh#L42
    修改前:
# get x509v3 subject alternative name from the old certificate
cert::get_subject_alt_name() {
  local cert=${1}.crt
  local alt_name

  check_file "${cert}"
  alt_name=$(openssl x509 -text -noout -in "${cert}" | grep -A1 'Alternative' | tail -n1 | sed 's/[[:space:]]*Address//g')
  printf "%s\n" "${alt_name}"
}

修改后:

# get x509v3 subject alternative name from the old certificate
cert::get_subject_alt_name() {
  local cert=${1}.crt
  local alt_name

  check_file "${cert}"
  alt_name=$(openssl x509 -text -noout -in "${cert}" | grep -A1 'Alternative' | tail -n1 | sed 's/[[:space:]]*Address//g')
  # 加入 你想要的域名,和原有域名列表拼接在一起,比如 cluster-endpoint,如果加入多个,就是 printf "DNS:xxx1, DNS:xxx2, %s\n" "${alt_name}"
  printf "DNS:cluster-endpoint, %s\n" "${alt_name}"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants