k8s_难产的Ingress&ingress controller环境准备

本章为入门三部曲之一,最终状态为ingress-nginx-controller可以正常运行

三部曲之二,最终状态为 ingress能够正常部署运行

https://blog.csdn.net/cds992/article/details/106246616

入门三部曲终篇,最终状态为公网可以验证ingress的基本功能,不同路径分流至不同的pod。

见 https://blog.csdn.net/cds992/article/details/106374545

正文

Ingress可以用于解析ssl域名证书
标准的kubenete 资源
Ingress is a collection of rules that allow inbound connections to reach
the endpoints defined by a backend. An Ingress can be configured to give
services externally-reachable urls, load balance traffic, terminate SSL,
offer name based virtual hosting etc. DEPRECATED - This group version of
Ingress is deprecated by networking.k8s.io/v1beta1 Ingress. See the release
notes for more information.
4个核心附件之一
k8s_难产的Ingress&ingress controller环境准备_第1张图片

环境准备

安装说明:

  1. https://kubernetes.github.io/ingress-nginx/deploy/
  2. https://github.com/kubernetes/ingress-nginx/blob/master/docs/deploy/index.md
    k8s_难产的Ingress&ingress controller环境准备_第2张图片
    **

先跟着说明2

  1. 笔者自己是腾讯云的环境,需要在安全组先放行8443端口
  2. 执行命令
[root@test /]# kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-0.32.0/deploy/static/provider/cloud/deploy.yaml
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
namespace/ingress-nginx configured
serviceaccount/ingress-nginx created
configmap/ingress-nginx-controller created
clusterrole.rbac.authorization.k8s.io/ingress-nginx created
clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx created
role.rbac.authorization.k8s.io/ingress-nginx created
rolebinding.rbac.authorization.k8s.io/ingress-nginx created
service/ingress-nginx-controller-admission created
service/ingress-nginx-controller created
deployment.apps/ingress-nginx-controller created
validatingwebhookconfiguration.admissionregistration.k8s.io/ingress-nginx-admission created
clusterrole.rbac.authorization.k8s.io/ingress-nginx-admission created
clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created
job.batch/ingress-nginx-admission-create created
job.batch/ingress-nginx-admission-patch created
role.rbac.authorization.k8s.io/ingress-nginx-admission created
rolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created
serviceaccount/ingress-nginx-admission created
[root@test /]# kubectl get pods -n ingress-nginx \
>   -l app.kubernetes.io/name=ingress-nginx --watch
NAME                                        READY   STATUS              RESTARTS   AGE
ingress-nginx-admission-create-rknmn        0/1     Completed           0          2m35s
ingress-nginx-admission-patch-nltpn         0/1     Completed           2          2m35s
ingress-nginx-controller-866488c6d4-2sz9s   0/1     ContainerCreating   0          2m45s
ingress-nginx-controller-866488c6d4-2sz9s   0/1     ErrImagePull        0          5m11s
ingress-nginx-controller-866488c6d4-2sz9s   0/1     ImagePullBackOff    0          5m23s

也不知道是啥镜像没拉下来
打开第一条命令中的链接,
其中deployment有指定镜像 quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.32.0
另外Job中也有用到 jettech/kube-webhook-certgen:v1.2.0
先都pull下来再看看状态。

[root@test2 ~]# docker pull quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.32.0
Error response from daemon: Get https://quay.io/v2/: EOF

在dig quay.io后再执行命令,可以正常执行了,继续漫长的等待。EOF 还是会出现。
晚上九点半了。多次尝试依旧无果。
在这里插入图片描述
想起之前的github+dockerhub建镜像,那就试试吧。
k8s_难产的Ingress&ingress controller环境准备_第3张图片
在这里插入图片描述
终于get~~
在这里插入图片描述
十点半,哭瞎
k8s_难产的Ingress&ingress controller环境准备_第4张图片
总之又是一番波折,镜像到手。查看运行状态,已经running了

[root@test2 ~]# kubectl get pods -n ingress-nginx
NAME                                        READY   STATUS      RESTARTS   AGE
ingress-nginx-admission-create-rknmn        0/1     Completed   0          153m
ingress-nginx-admission-patch-nltpn         0/1     Completed   2          153m
ingress-nginx-controller-866488c6d4-2sz9s   1/1     Running     0          153m

你可能感兴趣的:(TroubleShooting,零散笔记,k8s和它的坑们)