k8s
组件 资源清单
pod 生命周期
pod 控制器
服务发现
runcher
KubeSphere
Helm
helm命令
helm 常用内置对象
helm 内置函数
helm 的逻辑 和 流程控制
helm 中变量在作用域、列表、元祖、字典中的引用
helm 使用define定义子模版、template和include调用
helm 获取其他文件的内容和文件名
社区的Helm chart仓库
helm几个常用仓库
存储 configMap
进入k8s pod
k8s Node节点的调试
k8s 部署
sealos 部署
kubeadm 1.28部署
增加 node 节点
在aws 上自建k8s
利用NFS动态提供Kubernetes后端存储卷
rook-ceph
CephFS挂载
Ceph Dashboard
ingress
k8s集成kube-prometheus
ServiceMonitor 添加配置
Prometheus 长期远程存储方案 VictoriaMetrics
解决ControllerManager、Scheduler、watchdog监控问题
抓取配置说明
kubernetes配置imagePullSecrets秘钥来拉取镜像
在 Kubernetes 裡跑 curl 來測試內部服務
MetalLB
cloudflare-tunnel-ingress-controller
K8S kubectl 自动补全
argocd
helm部署redis-culster集群
改变默认 StorageClass
自定义指标HPA
istio
kiali
k8s接入graylog
Labels
DNS
HPA
ConfigMap挂载导致容器目录覆盖的问题
污点容忍度
身份认证与权限 RBAC
command
运行crictl ps -a 报错
etcd
cka证书
cert-manager
Kubernetes 创建普通账号
部署 metrics-server 指标
deployment 重启
Kubernetes中如何优雅的解决Pod时区问题
alertmanager
oom killed
eks挂载efs
eks创建集群
eksctl awscli kubectl
污点和容忍度
Kubernetes 删除namespace Terminating解决脚本
k8s 部署 kafka 集群
ack ingress获取客户端客户端真实IP
ingress 反向代理 ws
本文档使用 MrDoc 发布
-
+
首页
ingress
https://kubernetes.github.io/ingress-nginx/deploy/ ## Ingress和Ingress Controller ![](/media/202308/2023-08-10_155149_0491540.12820770941870774.png) #### 安装Nginx Ingress Controller ``` #Helm 安装 helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx helm repo update kubectl create namespace ingress-nginx helm install ingress-nginx ingress-nginx/ingress-nginx \ --namespace ingress-nginx \ --set controller.publishService.enabled=true kubectl get pods -n ingress-nginx kubectl get svc -n ingress-nginx ``` 安装后查看pod ``` tantianran@test-b-k8s-master:~$ kubectl get pod -n ingress-nginx NAME READY STATUS RESTARTS AGE ingress-nginx-admission-create-z4hlb 0/1 Completed 0 47h ingress-nginx-admission-patch-ffbwz 0/1 Completed 0 47h ingress-nginx-controller-5f4c9fdd9b-l55ch 1/1 Running 1 (10m ago) 47h ``` 安装后查看Service ``` tantianran@test-b-k8s-master:~$ kubectl get svc -n ingress-nginx NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE ingress-nginx-controller LoadBalancer 10.106.241.48 <pending> 80:30806/TCP,443:30178/TCP 2d ingress-nginx-controller-admission ClusterIP 10.109.39.65 <none> 443/TCP 2d tantianran@test-b-k8s-master:~$ ``` #### 创建测试应用和ingress资源对象 ``` apiVersion: apps/v1 kind: Deployment metadata: labels: app: test-goweb name: test-goweb spec: replicas: 6 selector: matchLabels: app: test-goweb template: metadata: labels: app: test-goweb spec: containers: - image: 192.168.11.247/web-demo/goweb-demo:20221229v3 name: goweb-demo ports: - containerPort: 8090 protocol: TCP --- apiVersion: v1 kind: Service metadata: labels: app: test-goweb name: test-goweb spec: ports: - name: 80-8090 port: 80 protocol: TCP targetPort: 8090 selector: app: test-goweb type: ClusterIP ``` #### 查看当前集群中定义的所有IngressClass对象 ``` tantianran@test-b-k8s-master:~$ kubectl get ingressclass NAME CONTROLLER PARAMETERS AGE nginx k8s.io/ingress-nginx <none> 2d2h # 这个nginx控制器就是我们等会要用的 tantianran@test-b-k8s-master:~$ ``` #### ingress.yaml ``` apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: test-goweb spec: ingressClassName: nginx rules: - host: "test.noblameops.local" http: paths: - path: /login pathType: Prefix backend: service: name: test-goweb port: number: 80 - path: /home pathType: Prefix backend: service: name: test-goweb port: number: 80 - path: / pathType: Prefix backend: service: name: test-goweb port: number: 80 ``` #### 查看ingress controller的Service ``` tantianran@test-b-k8s-master:~$ kubectl get svc -n ingress-nginx NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE ingress-nginx-controller LoadBalancer 10.106.241.48 <pending> 80:30806/TCP,443:30178/TCP 2d6h ingress-nginx-controller-admission ClusterIP 10.109.39.65 <none> 443/TCP 2d6h tantianran@test-b-k8s-master:~$ ``` ### https 配置 ``` apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: test-goweb spec: ingressClassName: nginx tls: - hosts: - test.noblameops.local secretName: test-noblameops-local-tls rules: - host: "test.noblameops.local" http: paths: - path: /login pathType: Prefix backend: service: name: test-goweb port: number: 80 - path: /home pathType: Prefix backend: service: name: test-goweb port: number: 80 - path: / pathType: Prefix backend: service: name: test-goweb port: number: 80 ```
admin
2024年1月7日 22:58
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码