k8s
Docker常用操作
Docker推送本地镜像到内网Harbor
Harbor 部署
使用kk部署kubesphere
kubernetes 挂载 configMap 中的单个文件
Jenkins
使用Docker部署Apt-Cacher-ng服务
序列图
kubernetes拉取内网Harbor中的私有镜像
rook-ceph 使用常见问题
ingress-nginx 安装与使用
gitlab ubuntu 安装文档
gitlab runner 相关问题
minio 常用操作
202304代办列表
redis 常用操作
curve 常用操作
kubeadm搭建k8s集群
如何将 kubeadm init 需要的镜像离线到本地 Harbor
前置依赖安装
podman非根用户容器开机自启
本文档使用 MrDoc 发布
-
+
home page
ingress-nginx 安装与使用
``` # https://github.com/kubernetes/ingress-nginx/releases # 直接部署 kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.2/deploy/static/provider/cloud/deploy.yaml # 下载配置,修改后部署 wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.8.2/deploy/static/provider/cloud/deploy.yaml -O ingress-nginx-deploy.yaml kubectl apply -f ingress-nginx-deploy.yaml ``` ``` docker pull registry.k8s.io/ingress-nginx/controller:v1.8.2@sha256:74834d3d25b336b62cabeb8bf7f1d788706e2cf1cfd64022de4137ade8881ff2 docker pull registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20230407@sha256:543c40fd093964bc9ab509d3e791f9989963021f1e9e4c9c7b6700b02bfb227b docker tag f2e1146a6d96 harbor.dtdream.com/k8s/ingress-nginx/controller:v1.8.2 docker tag 520347519a8c harbor.dtdream.com/k8s/ingress-nginx/kube-webhook-certgen:v20230407 docker push harbor.dtdream.com/k8s/ingress-nginx/controller:v1.8.2 docker push harbor.dtdream.com/k8s/ingress-nginx/kube-webhook-certgen:v20230407 ``` # ingress 直接监听 80、443 端口 <https://github.com/kubernetes/ingress-nginx/issues/4799> [ingress在物理机上的nodePort和hostNetwork两种部署方式解析及比较](https://xuxinkun.github.io/2019/06/11/ingress/) 在 `deploy.yaml` 中添加 `hostNetwork: true` 配置 ```yaml spec: template: spec: hostNetwork: true nodeName: k8s00 containers: - args: image: harbor.dtdream.com/k8s/ingress-nginx/controller:v1.7.1 ``` - `hostNetwork` 主机网络模式,直接监听 80、443 接口 - `nodeName` 指定分配的节点 ```yaml kind: ConfigMap data: compute-full-forwarded-for: "true" use-forwarded-headers: "true" proxy-body-size: 100m ``` # 查看已安装版本 ```shell POD_NAME=$(kubectl get pods -n ingress-nginx -l app.kubernetes.io/name=ingress-nginx --field-selector=status.phase=Running -o name) kubectl exec $POD_NAME -n ingress-nginx -- /nginx-ingress-controller --version ``` # 配置应用路由 > 指定 `ingressClassName` 为 `nginx` ```yaml kind: Ingress apiVersion: networking.k8s.io/v1 metadata: name: pypa-route namespace: pypa annotations: kubesphere.io/creator: admin spec: ingressClassName: nginx rules: - host: pypa.dtdream.vip http: paths: - path: / pathType: ImplementationSpecific backend: service: name: pypa-server port: number: 8080 ```
幻翼
Jan. 24, 2024, 9:05 p.m.
转发文档
Collection documents
Last
Next
手机扫码
Copy link
手机扫一扫转发分享
Copy link
Markdown文件
share
link
type
password
Update password