k8s 安装ingress并配置flink服务
参考Kubernetes Ingress - misakivv - 博客园
1.下载deploy.yaml
wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.0/deploy/static/provider/baremetal/deploy.yaml
2.下载镜像
按理说网络好的话不用这么整,也可采用”参考“中的那种方式
kubecel get all -n ingress-nginx
docker save -o controller.tar
docker save -o webhook.tar
-----------以上在win保存的包上传至linux解压---------------------
docker load -i controller.tar
docker load -i controller.tar
3.修改并应用 deploy.yaml 文件
sed -i 's/@sha256:.*//g' deploy.yaml
kubectl apply -f deploy.yaml
4.检查ingress服务
kubectl get all -n ingress-nginx
[root@k8s-master ~]# kubectl get all -n ingress-nginx
NAME READY STATUS RESTARTS AGE
pod/ingress-nginx-controller-fd98fbdfb-jfqwt 1/1 Running 0 147m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/ingress-nginx-controller LoadBalancer 10.233.31.82 <pending> 80:32244/TCP,443:31765/TCP 150m
service/ingress-nginx-controller-admission ClusterIP 10.233.11.246 <none> 443/TCP 150m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/ingress-nginx-controller 1/1 1 1 150m
NAME DESIRED CURRENT READY AGE
replicaset.apps/ingress-nginx-controller-fd98fbdfb 1 1 1 150m
NAME COMPLETIONS DURATION AGE
job.batch/ingress-nginx-admission-create 1/1 9m3s 150m
job.batch/ingress-nginx-admission-patch 1/1 9m4s 150m
5.配置flink
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: flink-ingress
namespace: flink-apps
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx # 指定 IngressClass
rules:
- host: flink.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: scaleauto-rest
port:
number: 8081
这里有个问题是我不想加端口访问,这里周一问问同事怎么整的把