安装nginx-ingress

267 阅读1分钟

安装Helm

helm安装过程

  1. 下载helm安装包
    下载地址:github.com/helm/helm/r…
    本文下载3.9.3版本:get.helm.sh/helm-v3.9.2…
    在这里插入图片描述2. 解压helm
    解压(tar -zxvf helm-v3.0.0-linux-amd64.tar.gz),然后复制helm到/usr/local/bin
[root@k3s-master helm]# tar -zxvf helm-v3.9.2-linux-amd64.tar.gz 
linux-amd64/
linux-amd64/helm
linux-amd64/LICENSE
linux-amd64/README.md
[root@k3s-master helm]# mv linux-amd64/helm /usr/local/bin/helm
[root@k3s-master helm]# helm version
version.BuildInfo{Version:"v3.9.2", GitCommit:"1addefbfe665c350f4daf868a9adc5600cc064fd", GitTreeState:"clean", GoVersion:"go1.17.12"}
[root@k3s-master helm]# 

配置参考:www.cnblogs.com/syushin/p/1…
安装参照:blog.csdn.net/qq_38983728…

root@ubuntu:~# helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
"ingress-nginx" has been added to your repositories
root@ubuntu:~# helm repo update ingress-nginx
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "ingress-nginx" chart repository
Update Complete. ⎈Happy Helming!⎈
root@ubuntu:~# helm repo list
NAME            URL                                       
ingress-nginx   https://kubernetes.github.io/ingress-nginx
root@ubuntu:~# helm  search repo ingress-nginx
NAME                            CHART VERSION   APP VERSION     DESCRIPTION                                       
ingress-nginx/ingress-nginx     4.5.2           1.6.4           Ingress controller for Kubernetes using NGINX a...
root@ubuntu:~#  helm pull ingress-nginx/ingress-nginx --version 4.5.2
root@ubuntu:~# ls
  ingress-nginx-4.5.2.tgz  

安装nginx-controller

[root@k3s-master helm]# wget  https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.3.0/deploy/static/provider/cloud/deploy.yaml
--2022-08-02 13:49:33--  https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.3.0/deploy/static/provider/cloud/deploy.yaml
正在解析主机 raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.110.133, ...
正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:15490 (15K) [text/plain]
正在保存至: “deploy.yaml.1”

100%[=========================================================================================================================================================================================>] 15,490      10.8KB/s 用时 1.4s   

2022-08-02 13:49:36 (10.8 KB/s) - 已保存 “deploy.yaml.1” [15490/15490])

[root@k3s-master helm]# ls
deploy.yaml    
[root@k3s-master helm]# kubectl apply -f deploy.yaml 
namespace/ingress-nginx created
serviceaccount/ingress-nginx created
serviceaccount/ingress-nginx-admission created
role.rbac.authorization.k8s.io/ingress-nginx created
role.rbac.authorization.k8s.io/ingress-nginx-admission created
clusterrole.rbac.authorization.k8s.io/ingress-nginx created
clusterrole.rbac.authorization.k8s.io/ingress-nginx-admission created
rolebinding.rbac.authorization.k8s.io/ingress-nginx created
rolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created
clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx created
clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created
configmap/ingress-nginx-controller created
service/ingress-nginx-controller created
service/ingress-nginx-controller-admission created
deployment.apps/ingress-nginx-controller created
job.batch/ingress-nginx-admission-create created
job.batch/ingress-nginx-admission-patch created
ingressclass.networking.k8s.io/nginx created
validatingwebhookconfiguration.admissionregistration.k8s.io/ingress-nginx-admission created
[root@server6 ingress-nginx]# helm install ingress-nginx-1 --namespace ingress-nginx --create-namespace -f ./values.yaml .

Error: INSTALLATION FAILED: failed pre-install: timed out waiting for the condition

[root@k3s-master helm]# helm upgrade -i ingress-nginx ingress-nginx/ingress-nginx \
-n kube-system \
-f /root/i/helm/ingress-nginx/my-values.yaml \
--version 4.0.18