ingress-svc-deployment

发表于 Kubernetes 分类,标签:


curl http://nginx-test.yyyy.xxxx.com/hostname.html 
curl https://nginx-test.yyyy.xxxx.com/hostname.html
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
spec:
  rules:
  - host: nginx-test.yyyy.xxxx.com
    http:
      paths:
      - backend:
          service:
            name: myservice
            port:
              name: http
        path: /
        pathType: ImplementationSpecific
  tls:
  - hosts:
    - nginx-test.yyyy.xxxx.com
    secretName: yyyy.xxxx.com
   
---
apiVersion: v1
kind: Service
metadata:
  name: myservice
spec:
  selector:
    app: myapp
  ports:
  - protocol: TCP
    name: http
    port: 80
    targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: myapp
        # image: registry.cn-shenzhen.aliyuncs.com/linuxnb-stone/nginx:alpine
        image: ikubernetes/myapp:v1




apiVersion: extensions/v1beta1
# apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
spec:
  rules:
  - host: my.service.nginx
    http:
      paths:
      - path: /
        backend:
          serviceName: myservice
          servicePort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: myservice
spec:
  selector:
    app: myapp
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: myapp
        image: registry.cn-shenzhen.aliyuncs.com/linuxnb-stone/nginx:alpine




0 篇评论

发表我的评论