当前位置: 首页 > news >正文

做网站分析网站怎么开发

做网站分析,网站怎么开发,电脑单页网站建设,我想创业做网站备考ICA----Istio实验10—为单个主机配置 TLS Istio Ingress Gateway实验 1. 环境准备 部署httpbin kubectl apply -f istio/samples/httpbin/httpbin.yaml 2. 证书生成 2.1 生成根证书 生成根证书keyfile和crt文件 mkdir example_certs_root openssl req -x509 -sha256 …

备考ICA----Istio实验10—为单个主机配置 TLS Istio Ingress Gateway实验

1. 环境准备

部署httpbin

kubectl apply -f istio/samples/httpbin/httpbin.yaml 

2. 证书生成

2.1 生成根证书

生成根证书keyfile和crt文件

mkdir example_certs_root
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 \-subj '/O=example Inc./CN=example.com' \-keyout example_certs_root/example.com.key \-out example_certs_root/example.com.crt

2.2 生成httpbin.example.com证书

生成httpbin.example.com的keyfile和证书请求文件

mkdir example_certs_httpbin
openssl req -out example_certs_httpbin/httpbin.example.com.csr  -newkey rsa:2048 \
-nodes -keyout example_certs_httpbin/httpbin.example.com.key \
-subj "/CN=httpbin.example.com/O=httpbin organization"

使用根证书签发httpbin.example.com的证书
这里我们为了后续实验只签发了1年

openssl x509 -req -sha256 -days 365 -CA example_certs_root/example.com.crt \
-CAkey example_certs_root/example.com.key \
-set_serial 0 -in example_certs_httpbin/httpbin.example.com.csr \
-out example_certs_httpbin/httpbin.example.com.crt

至此证书已经准备完毕
在这里插入图片描述

3. Istio配置

3.1 创建secret

这个证书由于调用的是istio ingressgateway所以必须放在istio-system命名空间下.

kubectl create -n istio-system secret tls httpbin-credential \
--key=example_certs_httpbin/httpbin.example.com.key \
--cert=example_certs_httpbin/httpbin.example.com.crt 

确认秘钥被正确创建

kubectl get secrets -n istio-system 

在这里插入图片描述

3.2 为httpbin配置Gateway

将证书应用给gw
tls-ingress/httpbin-TLS-gateway.yaml

apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:name: mygateway
spec:selector:istio: ingressgateway  # use istio default ingress gatewayservers:- port:number: 443name: httpsprotocol: HTTPStls:mode: SIMPLEcredentialName: httpbin-credential # must be the same as secrethosts:- httpbin.example.com

部署gw

kubectl apply -f tls-ingress/httpbin-TLS-gateway.yaml 

在这里插入图片描述

3.3 为httpbin配置VS

tls-ingress/httpbin-TLS-VirtualService.yaml

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:name: httpbin
spec:hosts:- "httpbin.example.com"gateways:- mygatewayhttp:- match:- uri:prefix: /status- uri:prefix: /delayroute:- destination:port:number: 8000host: httpbin

部署

kubectl apply -f tls-ingress/httpbin-TLS-VirtualService.yaml 

将istio-ingressgateway的ex-ip绑定到hosts后测试访问,服务访问正常,证书可以被正确加载
可以看到1年后我们的证书会到期.
在这里插入图片描述
在本机上配置了hosts后测试也没有问题

curl -v -HHost:httpbin.example.com --resolve "httpbin.example.com:443:192.168.126.220" \
--cacert example_certs_root/example.com.crt "https://httpbin.example.com:443/status/418"

在这里插入图片描述

3.4 轮转httpbin证书

当证书到期后我们需要更新证书,我们之前的证书是2025年到期.比如我们现在已经到期了,我们另外颁发1个10年的证书.
在这里插入图片描述

openssl req -out example_certs_httpbin/httpbin.example.com-2025.csr  -newkey rsa:2048 \
-nodes -keyout example_certs_httpbin/httpbin.example.com-2025.key \
-subj "/CN=httpbin.example.com/O=httpbin organization"

使用根证书签发pana.example.com的证书,这里的-days 就是指定证书到期时间

openssl x509 -req -sha256 -days 3650 -CA example_certs_root/example.com.crt \
-CAkey example_certs_root/example.com.key \
-set_serial 0 -in example_certs_httpbin/httpbin.example.com-2025.csr \
-out example_certs_httpbin/httpbin.example.com-2025.crt

更新secret,更新秘钥后不需要去重启pod和gw等其他资源

kubectl delete secrets -n istio-system httpbin-credential
kubectl create -n istio-system secret tls httpbin-credential \
--key=example_certs_httpbin/httpbin.example.com-2025.key \
--cert=example_certs_httpbin/httpbin.example.com-2025.crt 

这里可以看到颁发日期已经是新的了,到期日期已经是10年后的日期
在这里插入图片描述

http://www.tj-hxxt.cn/news/109394.html

相关文章:

  • 做网站乱码免费舆情网站下载大全最新版
  • 网站分为那几个模块企业网页设计与推广
  • 不上此网站枉做男人网址大全浏览器下载
  • 专门做海外服装购的网站安卓优化软件
  • 备案网站系统今日重要新闻
  • 网站功能介绍是什么南宁网络推广平台
  • 怎么做门户网站设计方案网站怎么做推广和宣传
  • 营销网站的概念白帽seo
  • 宁波易通宁波网站建设站长工具天美传媒
  • 云主机 做网站临沂网站建设方案服务
  • 公司 网站 源码做网站排名服务热线
  • 商标与logo的区别临沂seo代理商
  • 哪个网站有适合小学生做的题目移动建站优化
  • 电商 网站建设文字营销型网站有哪些
  • php开发网站流程新榜数据平台
  • WordPress导入hexo优化营商环境建议
  • 网站开发强制使用急速内核免费的b2b平台
  • 网站建设应用技术互联网平台
  • 营销型企业网站的功能有哪些今日足球赛事推荐
  • 专业网站建站公司什么推广方法是有效果的
  • 信息网站 微站网站页面分析
  • 咋样建设网站做一个网站
  • 网站建设没有图片百度开户渠道商哪里找
  • 自己编程怎么做网站教程站长推荐产品
  • 机票网站制作怎么制作个人网站
  • 湖南网站建设企业长沙seo 优化选智投未来no1
  • 百度糯米网站怎么做宁波seo关键词优化方法
  • 西部数码网站管理助手 v3.0市场调研的重要性
  • 查看网站是由什么开源做的鸡西seo顾问
  • 哪个网站做攻略比较好seo排名优化软件免费