zoukankan      html  css  js  c++  java
  • 给服务添加路由--ingress

    kind: Namespace
    apiVersion: v1
    metadata:
      name: demo-webshell
      generateName: demo-webshell
      labels:
        name: demo-webshell
        purpose: Demonstration
      annotations:
        describe: Just show how to create
    status:
      phase: ''
    ---
    apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
      name: webshell-ingress
      namespace: demo-webshell
    spec:
      rules:
      - host: webshell.com
        http:
          paths:
          - path: /
            backend:
              serviceName: webshell
              servicePort: 80
          - path: /ping
            backend:
              serviceName: webshell
              servicePort: 80
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: webshell
      namespace: demo-webshell
    spec:
      type: ClusterIP
      ports:
      - name: webshell
        port: 80
        targetPort: 80
        protocol: TCP
      - name: ssh
        port: 22
        targetPort: 22
        protocol: TCP
      selector:
        app: webshell
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: webshell-nodeport
      namespace: demo-webshell
    spec:
      type: NodePort
      ports:
      - name: webshell
        port: 80
        targetPort: 80
        protocol: TCP
      - name: ssh
        port: 22
        targetPort: 22
        protocol: TCP
      selector:
        app: webshell
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: webshell
      namespace: demo-webshell
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: webshell
      template:
        metadata:
          labels:
            name: webshell
            app: webshell
        spec:
          containers:
          - name: webshell
            image: lijiaocn/webshell:1.0
            resources:
              limits:
                cpu: 3
                memory: 128Mi
              requests:
                cpu: 0.1
                memory: 32Mi
            livenessProbe:
              tcpSocket:
                port: 80
              initialDelaySeconds: 5
              timeoutSeconds: 5
              periodSeconds: 10
              successThreshold: 1
              failureThreshold: 3
            imagePullPolicy: Always
            securityContext:
              privileged: false
              runAsNonRoot: false
            stdin: false
            stdinOnce: false
            tty: false
          - name: sshproxy
            image: lijiaocn/sshproxy:1.0
            env:
            - name: ROOTPASS
              value: '123456'
            resources:
              limits:
                cpu: 3
                memory: 128Mi
              requests:
                cpu: 0.1
                memory: 32Mi
            livenessProbe:
              tcpSocket:
                port: 22
              initialDelaySeconds: 5
              timeoutSeconds: 5
            imagePullPolicy: Always
            securityContext:
              privileged: false
              runAsNonRoot: false
            stdin: false
            stdinOnce: false
            tty: false
          restartPolicy: Always
          dnsPolicy: Default
          serviceAccountName: default
          hostNetwork: false
          hostPID: false
          hostIPC: false

  • 相关阅读:
    php 字符串查找
    php缓存与加速分析与汇总
    oracle 时间问题
    mysql数据迁移
    浅谈千万级PV/IP规模高性能高并发网站架构
    对memcache分布式的一点理解
    美国程序员将工作廉价外包给中国公司遭解雇
    16个Linux服务器监控命令
    在yii中使用memcache
    Windows电脑快捷健大全
  • 原文地址:https://www.cnblogs.com/justart/p/11950150.html
Copyright © 2011-2022 走看看