欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

k8s 配置

程序员文章站 2022-07-13 10:10:14
...
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: k8s-eureka
spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
        - name: front-end
          image: nginx
          ports:
            - containerPort: 80
        - name: flaskapp-demo
          image: registry.cn-zhangjiakou.aliyuncs.com/icezhang/eureka
          ports:
            - containerPort: 8761
apiVersion: v1
kind: Service
metadata:
  labels:
    run: nginx
  name: eureka
  namespace: default
spec:
  ports:
  - port: 8761
    targetPort: 8761
  selector:
    app: web

 

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: eureka-ingress
spec:
  rules:
  - host: eureka.com
    http:
      paths:
      - backend:
          serviceName: eureka
          servicePort: 8761