ingress-controller安装配置

ingress-controller有两种安装方式:Deployment和DeamonSet

Deployment模式安装:

   需要注意的是:

       

        当pod 设置hostNetwork: true时候,Pod中的所有容器就直接暴露在宿主机的网络环境中,这时候,Pod的PodIP就是其所在Node的IP。

       对于同Deployment下的hostNetwork: true启动的Pod,每个node上只能启动一个。也就是说,Host模式的Pod启动副本数不可以多于“目标node”的数量,“目标node”指的是在启动Pod时选定的node,若未选定(没有指定nodeSelector),“目标node”的数量就是集群中全部的可用的node的数量。当副本数大于“目标node”的数量时,多出来的Pod会一直处于Pending状态,因为schedule已经找不到可以调度的node了。【摘取博客https://segmentfault.com/a/1190000016123122

apiVersion: v1
kind: Namespace
metadata:
  name: ingress-nginx

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: default-http-backend
  labels:
    app.kubernetes.io/name: default-http-backend
    app.kubernetes.io/part-of: ingress-nginx
  namespace: ingress-nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: default-http-backend
      app.kubernetes.io/part-of: ingress-nginx
  template:
    metadata:
      labels:
        app.kubernetes.io/name: default-http-backend
        app.kubernetes.io/part-of: ingress-nginx
    spec:
      terminationGracePeriodSeconds: 60
      containers:
        - name: default-http-backend
          # Any image is permissible as long as:
          # 1. It serves a 404 page at /
          # 2. It serves 200 on a /healthz endpoint
          image: ibmcom/defaultbackend-amd64:1.5
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 30
            timeoutSeconds: 5
          ports:
            - containerPort: 8080
          resources:
            limits:
              cpu: 10m
              memory: 20Mi
            requests:
              cpu: 10m
              memory: 20Mi

---
apiVersion: v1
kind: Service
metadata:
  name: default-http-backend
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: default-http-backend
    app.kubernetes.io/part-of: ingress-nginx
spec:
  ports:
    - port: 80
      targetPort: 8080
  selector:
    app.kubernetes.io/name: default-http-backend
    app.kubernetes.io/part-of: ingress-nginx

---

kind: ConfigMap
apiVersion: v1
metadata:
  name: nginx-configuration
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx

---

kind: ConfigMap
apiVersion: v1
metadata:
  name: tcp-services
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx

---

kind: ConfigMap
apiVersion: v1
metadata:
  name: udp-services
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx

---

apiVersion: v1
kind: ServiceAccount
metadata:
  name: nginx-ingress-serviceaccount
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: nginx-ingress-clusterrole
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
rules:
  - apiGroups:
      - ""
    resources:
      - configmaps
      - endpoints
      - nodes
      - pods
      - secrets
    verbs:
      - list
      - watch
  - apiGroups:
      - ""
    resources:
      - nodes
    verbs:
      - get
  - apiGroups:
      - ""
    resources:
      - services
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - "extensions"
    resources:
      - ingresses
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - ""
    resources:
      - events
    verbs:
      - create
      - patch
  - apiGroups:
      - "extensions"
    resources:
      - ingresses/status
    verbs:
      - update

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: nginx-ingress-role
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
rules:
  - apiGroups:
      - ""
    resources:
      - configmaps
      - pods
      - secrets
      - namespaces
    verbs:
      - get
  - apiGroups:
      - ""
    resources:
      - configmaps
    resourceNames:
      # Defaults to "<election-id>-<ingress-class>"
      # Here: "<ingress-controller-leader>-<nginx>"
      # This has to be adapted if you change either parameter
      # when launching the nginx-ingress-controller.
      - "ingress-controller-leader-nginx"
    verbs:
      - get
      - update
  - apiGroups:
      - ""
    resources:
      - configmaps
    verbs:
      - create
  - apiGroups:
      - ""
    resources:
      - endpoints
    verbs:
      - get

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: nginx-ingress-role-nisa-binding
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: nginx-ingress-role
subjects:
  - kind: ServiceAccount
    name: nginx-ingress-serviceaccount
    namespace: ingress-nginx

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: nginx-ingress-clusterrole-nisa-binding
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: nginx-ingress-clusterrole
subjects:
  - kind: ServiceAccount
    name: nginx-ingress-serviceaccount
    namespace: ingress-nginx

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-ingress-controller
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: ingress-nginx
      app.kubernetes.io/part-of: ingress-nginx
  template:
    metadata:
      labels:
        app.kubernetes.io/name: ingress-nginx
        app.kubernetes.io/part-of: ingress-nginx
      annotations:
        prometheus.io/port: "10254"
        prometheus.io/scrape: "true"
    spec:
      serviceAccountName: nginx-ingress-serviceaccount
      hostNetwork: true
      containers:
        - name: nginx-ingress-controller
          image: registry.cn-qingdao.aliyuncs.com/kubernetes_xingej/nginx-ingress-controller:0.20.0
          args:
            - /nginx-ingress-controller
            - --default-backend-service=$(POD_NAMESPACE)/default-http-backend
            - --configmap=$(POD_NAMESPACE)/nginx-configuration
            - --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
            - --udp-services-configmap=$(POD_NAMESPACE)/udp-services
            - --publish-service=$(POD_NAMESPACE)/ingress-nginx
            - --annotations-prefix=nginx.ingress.kubernetes.io
          securityContext:
            capabilities:
              drop:
                - ALL
              add:
                - NET_BIND_SERVICE
            # www-data -> 33
            runAsUser: 33
          env:
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          ports:
            - name: http
              containerPort: 80
            - name: https
              containerPort: 443
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 10254
              scheme: HTTP
            initialDelaySeconds: 10
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 1
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 10254
              scheme: HTTP
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 1

---

ingress解析的时候需要把对应的域名解析到ingress-controller所在的节点上。

DeamonSet模式安装: 

# 只在 master 节点执行
kubectl apply -f https://kuboard.cn/install-script/v1.19.x/nginx-ingress.yaml
 

# 如果打算用于生产环境,请参考 https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/ 并根据您自己的情况做进一步定制

---
apiVersion: v1
kind: Namespace
metadata:
  name: nginx-ingress 
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: nginx-ingress 
  namespace: nginx-ingress

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: nginx-ingress
rules:
- apiGroups:
  - ""
  resources:
  - services
  - endpoints
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - secrets
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - get
  - list
  - watch
  - update
  - create
- apiGroups:
  - ""
  resources:
  - pods
  verbs:
  - list
  - watch
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - patch
  - list
- apiGroups:
  - networking.k8s.io
  resources:
  - ingresses
  verbs:
  - list
  - watch
  - get
- apiGroups:
  - networking.k8s.io
  resources:
  - ingresses/status
  verbs:
  - update
- apiGroups:
  - k8s.nginx.org
  resources:
  - virtualservers
  - virtualserverroutes
  - globalconfigurations
  - transportservers
  - policies
  verbs:
  - list
  - watch
  - get
- apiGroups:
  - k8s.nginx.org
  resources:
  - virtualservers/status
  - virtualserverroutes/status
  verbs:
  - update
- apiGroups:
  - networking.k8s.io
  resources:
  - ingressclasses
  verbs:
  - get
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: nginx-ingress
subjects:
- kind: ServiceAccount
  name: nginx-ingress
  namespace: nginx-ingress
roleRef:
  kind: ClusterRole
  name: nginx-ingress
  apiGroup: rbac.authorization.k8s.io

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: nginx-ingress-app-protect
rules:
- apiGroups: 
  - appprotect.f5.com
  resources: 
  - appolicies
  - aplogconfs
  verbs: 
  - "get" 
  - "watch" 
  - "list"
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: nginx-ingress-app-protect
subjects:
- kind: ServiceAccount
  name: nginx-ingress
  namespace: nginx-ingress
roleRef:
  kind: ClusterRole
  name: nginx-ingress-app-protect
  apiGroup: rbac.authorization.k8s.io


---
apiVersion: v1
kind: Secret
metadata:
  name: default-server-secret
  namespace: nginx-ingress
type: Opaque
data:
  tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN2akNDQWFZQ0NRREFPRjl0THNhWFhEQU5CZ2txaGtpRzl3MEJBUXNGQURBaE1SOHdIUVlEVlFRRERCWk8KUjBsT1dFbHVaM0psYzNORGIyNTBjbTlzYkdWeU1CNFhEVEU0TURreE1qRTRNRE16TlZvWERUSXpNRGt4TVRFNApNRE16TlZvd0lURWZNQjBHQTFVRUF3d1dUa2RKVGxoSmJ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dERYbE5ZSndUeThXczNKY3dlSTdqZVp2b0ZpbmNvVlVIMwphdmxoTUVCRGYxSjltSDB5cDBwWUNaS2ROdHNvZEZtQktzVEtQMjJhTmtsVVhCS3gyZzR6cFE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: globalconfigurations.k8s.nginx.org
spec:
  group: k8s.nginx.org
  versions:
  - name: v1alpha1
    served: true
    storage: true
  scope: Namespaced
  names:
    plural: globalconfigurations
    singular: globalconfiguration
    kind: GlobalConfiguration
    shortNames:
    - gc
  preserveUnknownFields: false
  validation:
    openAPIV3Schema:
      description: GlobalConfiguration defines the GlobalConfiguration resource.
      type: object
      properties:
        apiVersion:
          description: 'APIVersion defines the versioned schema of this representation
            of an object. Servers should convert recognized schemas to the latest
            internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
          type: string
        kind:
          description: 'Kind is a string value representing the REST resource this
            object represents. Servers may infer this from the endpoint the client
            submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
          type: string
        metadata:
          type: object
        spec:
          description: GlobalConfigurationSpec is the spec of the GlobalConfiguration
            resource.
          type: object
          properties:
            listeners:
              type: array
              items:
                description: Listener defines a listener.
                type: object
                properties:
                  name:
                    type: string
                  port:
                    type: integer
                  protocol:
                    type: string


---
kind: ConfigMap
apiVersion: v1
metadata:
  name: nginx-config
  namespace: nginx-ingress
data:

---
apiVersion: networking.k8s.io/v1beta1
kind: IngressClass
metadata:
  name: nginx
  annotations:
    ingressclass.kubernetes.io/is-default-class: "true"
spec:
  controller: nginx.org/ingress-controller 

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: virtualservers.k8s.nginx.org
spec:
  group: k8s.nginx.org
  versions:
  - name: v1
    served: true
    storage: true
  scope: Namespaced
  subresources:
    status: {}
  names:
    kind: VirtualServer
    plural: virtualservers
    singular: virtualserver
    shortNames:
    - vs
  preserveUnknownFields: false
  additionalPrinterColumns:
  - name: State
    type: string
    description: Current state of the VirtualServer. If the resource has a valid status,
      it means it has been validated and accepted by the Ingress Controller.
    JSONPath: .status.state
  - name: Host
    type: string
    JSONPath: .spec.host
  - name: IP
    type: string
    JSONPath: .status.externalEndpoints[*].ip
  - name: Ports
    type: string
    JSONPath: .status.externalEndpoints[*].ports
  - name: Age
    type: date
    JSONPath: .metadata.creationTimestamp
  validation:
    openAPIV3Schema:
      description: VirtualServer defines the VirtualServer resource.
      type: object
      properties:
        apiVersion:
          description: 'APIVersion defines the versioned schema of this representation
            of an object. Servers should convert recognized schemas to the latest
            internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
          type: string
        kind:
          description: 'Kind is a string value representing the REST resource this
            object represents. Servers may infer this from the endpoint the client
            submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
          type: string
        metadata:
          type: object
        spec:
          description: VirtualServerSpec is the spec of the VirtualServer resource.
          type: object
          properties:
            host:
              type: string
            http-snippets:
              type: string
            ingressClassName:
              type: string
            policies:
              type: array
              items:
                description: PolicyReference references a policy by name and an optional
                  namespace.
                type: object
                properties:
                  name:
                    type: string
                  namespace:
                    type: string
            routes:
              type: array
              items:
                description: Route defines a route.
                type: object
                properties:
                  action:
                    description: Action defines an action.
                    type: object
                    properties:
                      pass:
                        type: string
                      proxy:
                        description: ActionProxy defines a proxy in an Action.
                        type: object
                        properties:
                          requestHeaders:
                            description: ProxyRequestHeaders defines the request headers
                              manipulation in an ActionProxy.
                            type: object
                            properties:
                              pass:
                                type: boolean
                              set:
                                type: array
                                items:
                                  description: Header defines an HTTP Header.
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                    value:
                                      type: string
                          responseHeaders:
                            description: ProxyRequestHeaders defines the response
                              headers manipulation in an ActionProxy.
                            type: object
                            properties:
                              add:
                                type: array
                                items:
                                  description: Header defines an HTTP Header with
                                    an optional Always field to use with the add_header
                                    NGINX directive.
                                  type: object
                                  properties:
                                    always:
                                      type: boolean
                                    name:
                                      type: string
                                    value:
                                      type: string
                              hide:
                                type: array
                                items:
                                  type: string
                              ignore:
                                type: array
                                items:
                                  type: string
                              pass:
                                type: array
                                items:
                                  type: string
                          rewritePath:
                            type: string
                          upstream:
                            type: string
                      redirect:
                        description: ActionRedirect defines a redirect in an Action.
                        type: object
                        properties:
                          code:
                            type: integer
                          url:
                            type: string
                      return:
                        description: ActionReturn defines a return in an Action.
                        type: object
                        properties:
                          body:
                            type: string
                          code:
                            type: integer
                          type:
                            type: string
                  errorPages:
                    type: array
                    items:
                      description: ErrorPage defines an ErrorPage in a Route.
                      type: object
                      properties:
                        codes:
                          type: array
                          items:
                            type: integer
                        redirect:
                          description: ErrorPageRedirect defines a redirect for an
                            ErrorPage.
                          type: object
                          properties:
                            code:
                              type: integer
                            url:
                              type: string
                        return:
                          description: ErrorPageReturn defines a return for an ErrorPage.
                          type: object
                          properties:
                            body:
                              type: string
                            code:
                              type: integer
                            headers:
                              type: array
                              items:
                                description: Header defines an HTTP Header.
                                type: object
                                properties:
                                  name:
                                    type: string
                                  value:
                                    type: string
                            type:
                              type: string
                  location-snippets:
                    type: string
                  matches:
                    type: array
                    items:
                      description: Match defines a match.
                      type: object
                      properties:
                        action:
                          description: Action defines an action.
                          type: object
                          properties:
                            pass:
                              type: string
                            proxy:
                              description: ActionProxy defines a proxy in an Action.
                              type: object
                              properties:
                                requestHeaders:
                                  description: ProxyRequestHeaders defines the request
                                    headers manipulation in an ActionProxy.
                                  type: object
                                  properties:
                                    pass:
                                      type: boolean
                                    set:
                                      type: array
                                      items:
                                        description: Header defines an HTTP Header.
                                        type: object
                                        properties:
                                          name:
                                            type: string
                                          value:
                                            type: string
                                responseHeaders:
                                  description: ProxyRequestHeaders defines the response
                                    headers manipulation in an ActionProxy.
                                  type: object
                                  properties:
                                    add:
                                      type: array
                                      items:
                                        description: Header defines an HTTP Header
                                          with an optional Always field to use with
                                          the add_header NGINX directive.
                                        type: object
                                        properties:
                                          always:
                                            type: boolean
                                          name:
                                            type: string
                                          value:
                                            type: string
                                    hide:
                                      type: array
                                      items:
                                        type: string
                                    ignore:
                                      type: array
                                      items:
                                        type: string
                                    pass:
                                      type: array
                                      items:
                                        type: string
                                rewritePath:
                                  type: string
                                upstream:
                                  type: string
                            redirect:
                              description: ActionRedirect defines a redirect in an
                                Action.
                              type: object
                              properties:
                                code:
                                  type: integer
                                url:
                                  type: string
                            return:
                              description: ActionReturn defines a return in an Action.
                              type: object
                              properties:
                                body:
                                  type: string
                                code:
                                  type: integer
                                type:
                                  type: string
                        conditions:
                          type: array
                          items:
                            description: Condition defines a condition in a MatchRule.
                            type: object
                            properties:
                              argument:
                                type: string
                              cookie:
                                type: string
                              header:
                                type: string
                              value:
                                type: string
                              variable:
                                type: string
                        splits:
                          type: array
                          items:
                            description: Split defines a split.
                            type: object
                            properties:
                              action:
                                description: Action defines an action.
                                type: object
                                properties:
                                  pass:
                                    type: string
                                  proxy:
                                    description: ActionProxy defines a proxy in an
                                      Action.
                                    type: object
                                    properties:
                                      requestHeaders:
                                        description: ProxyRequestHeaders defines the
                                          request headers manipulation in an ActionProxy.
                                        type: object
                                        properties:
                                          pass:
                                            type: boolean
                                          set:
                                            type: array
                                            items:
                                              description: Header defines an HTTP
                                                Header.
                                              type: object
                                              properties:
                                                name:
                                                  type: string
                                                value:
                                                  type: string
                                      responseHeaders:
                                        description: ProxyRequestHeaders defines the
                                          response headers manipulation in an ActionProxy.
                                        type: object
                                        properties:
                                          add:
                                            type: array
                                            items:
                                              description: Header defines an HTTP
                                                Header with an optional Always field
                                                to use with the add_header NGINX directive.
                                              type: object
                                              properties:
                                                always:
                                                  type: boolean
                                                name:
                                                  type: string
                                                value:
                                                  type: string
                                          hide:
                                            type: array
                                            items:
                                              type: string
                                          ignore:
                                            type: array
                                            items:
                                              type: string
                                          pass:
                                            type: array
                                            items:
                                              type: string
                                      rewritePath:
                                        type: string
                                      upstream:
                                        type: string
                                  redirect:
                                    description: ActionRedirect defines a redirect
                                      in an Action.
                                    type: object
                                    properties:
                                      code:
                                        type: integer
                                      url:
                                        type: string
                                  return:
                                    description: ActionReturn defines a return in
                                      an Action.
                                    type: object
                                    properties:
                                      body:
                                        type: string
                                      code:
                                        type: integer
                                      type:
                                        type: string
                              weight:
                                type: integer
                  path:
                    type: string
                  policies:
                    type: array
                    items:
                      description: PolicyReference references a policy by name and
                        an optional namespace.
                      type: object
                      properties:
                        name:
                          type: string
                        namespace:
                          type: string
                  route:
                    type: string
                  splits:
                    type: array
                    items:
                      description: Split defines a split.
                      type: object
                      properties:
                        action:
                          description: Action defines an action.
                          type: object
                          properties:
                            pass:
                              type: string
                            proxy:
                              description: ActionProxy defines a proxy in an Action.
                              type: object
                              properties:
                                requestHeaders:
                                  description: ProxyRequestHeaders defines the request
                                    headers manipulation in an ActionProxy.
                                  type: object
                                  properties:
                                    pass:
                                      type: boolean
                                    set:
                                      type: array
                                      items:
                                        description: Header defines an HTTP Header.
                                        type: object
                                        properties:
                                          name:
                                            type: string
                                          value:
                                            type: string
                                responseHeaders:
                                  description: ProxyRequestHeaders defines the response
                                    headers manipulation in an ActionProxy.
                                  type: object
                                  properties:
                                    add:
                                      type: array
                                      items:
                                        description: Header defines an HTTP Header
                                          with an optional Always field to use with
                                          the add_header NGINX directive.
                                        type: object
                                        properties:
                                          always:
                                            type: boolean
                                          name:
                                            type: string
                                          value:
                                            type: string
                                    hide:
                                      type: array
                                      items:
                                        type: string
                                    ignore:
                                      type: array
                                      items:
                                        type: string
                                    pass:
                                      type: array
                                      items:
                                        type: string
                                rewritePath:
                                  type: string
                                upstream:
                                  type: string
                            redirect:
                              description: ActionRedirect defines a redirect in an
                                Action.
                              type: object
                              properties:
                                code:
                                  type: integer
                                url:
                                  type: string
                            return:
                              description: ActionReturn defines a return in an Action.
                              type: object
                              properties:
                                body:
                                  type: string
                                code:
                                  type: integer
                                type:
                                  type: string
                        weight:
                          type: integer
            server-snippets:
              type: string
            tls:
              description: TLS defines TLS configuration for a VirtualServer.
              type: object
              properties:
                redirect:
                  description: TLSRedirect defines a redirect for a TLS.
                  type: object
                  properties:
                    basedOn:
                      type: string
                    code:
                      type: integer
                    enable:
                      type: boolean
                secret:
                  type: string
            upstreams:
              type: array
              items:
                description: Upstream defines an upstream.
                type: object
                properties:
                  buffer-size:
                    type: string
                  buffering:
                    type: boolean
                  buffers:
                    description: UpstreamBuffers defines Buffer Configuration for
                      an Upstream.
                    type: object
                    properties:
                      number:
                        type: integer
                      size:
                        type: string
                  client-max-body-size:
                    type: string
                  connect-timeout:
                    type: string
                  fail-timeout:
                    type: string
                  healthCheck:
                    description: HealthCheck defines the parameters for active Upstream
                      HealthChecks.
                    type: object
                    properties:
                      connect-timeout:
                        type: string
                      enable:
                        type: boolean
                      fails:
                        type: integer
                      headers:
                        type: array
                        items:
                          description: Header defines an HTTP Header.
                          type: object
                          properties:
                            name:
                              type: string
                            value:
                              type: string
                      interval:
                        type: string
                      jitter:
                        type: string
                      passes:
                        type: integer
                      path:
                        type: string
                      port:
                        type: integer
                      read-timeout:
                        type: string
                      send-timeout:
                        type: string
                      statusMatch:
                        type: string
                      tls:
                        description: UpstreamTLS defines a TLS configuration for an
                          Upstream.
                        type: object
                        properties:
                          enable:
                            type: boolean
                  keepalive:
                    type: integer
                  lb-method:
                    type: string
                  max-conns:
                    type: integer
                  max-fails:
                    type: integer
                  name:
                    type: string
                  next-upstream:
                    type: string
                  next-upstream-timeout:
                    type: string
                  next-upstream-tries:
                    type: integer
                  port:
                    type: integer
                  queue:
                    description: UpstreamQueue defines Queue Configuration for an
                      Upstream.
                    type: object
                    properties:
                      size:
                        type: integer
                      timeout:
                        type: string
                  read-timeout:
                    type: string
                  send-timeout:
                    type: string
                  service:
                    type: string
                  sessionCookie:
                    description: SessionCookie defines the parameters for session
                      persistence.
                    type: object
                    properties:
                      domain:
                        type: string
                      enable:
                        type: boolean
                      expires:
                        type: string
                      httpOnly:
                        type: boolean
                      name:
                        type: string
                      path:
                        type: string
                      secure:
                        type: boolean
                  slow-start:
                    type: string
                  subselector:
                    type: object
                    additionalProperties:
                      type: string
                  tls:
                    description: UpstreamTLS defines a TLS configuration for an Upstream.
                    type: object
                    properties:
                      enable:
                        type: boolean
        status:
          description: VirtualServerStatus defines the status for the VirtualServer
            resource.
          type: object
          properties:
            externalEndpoints:
              type: array
              items:
                description: ExternalEndpoint defines the IP and ports used to connect
                  to this resource.
                type: object
                properties:
                  ip:
                    type: string
                  ports:
                    type: string
            message:
              type: string
            reason:
              type: string
            state:
              type: string

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: virtualserverroutes.k8s.nginx.org
spec:
  group: k8s.nginx.org
  versions:
  - name: v1
    served: true
    storage: true
  scope: Namespaced
  subresources:
    status: {}
  names:
    kind: VirtualServerRoute
    plural: virtualserverroutes
    singular: virtualserverroute
    shortNames:
    - vsr
  preserveUnknownFields: false
  additionalPrinterColumns:
  - name: State
    type: string
    description: Current state of the VirtualServerRoute. If the resource has a valid
      status, it means it has been validated and accepted by the Ingress Controller.
    JSONPath: .status.state
  - name: Host
    type: string
    JSONPath: .spec.host
  - name: IP
    type: string
    JSONPath: .status.externalEndpoints[*].ip
  - name: Ports
    type: string
    JSONPath: .status.externalEndpoints[*].ports
  - name: Age
    type: date
    JSONPath: .metadata.creationTimestamp
  validation:
    openAPIV3Schema:
      type: object
      properties:
        apiVersion:
          description: 'APIVersion defines the versioned schema of this representation
            of an object. Servers should convert recognized schemas to the latest
            internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
          type: string
        kind:
          description: 'Kind is a string value representing the REST resource this
            object represents. Servers may infer this from the endpoint the client
            submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
          type: string
        metadata:
          type: object
        spec:
          type: object
          properties:
            host:
              type: string
            ingressClassName:
              type: string
            subroutes:
              type: array
              items:
                description: Route defines a route.
                type: object
                properties:
                  action:
                    description: Action defines an action.
                    type: object
                    properties:
                      pass:
                        type: string
                      proxy:
                        description: ActionProxy defines a proxy in an Action.
                        type: object
                        properties:
                          requestHeaders:
                            description: ProxyRequestHeaders defines the request headers
                              manipulation in an ActionProxy.
                            type: object
                            properties:
                              pass:
                                type: boolean
                              set:
                                type: array
                                items:
                                  description: Header defines an HTTP Header.
                                  type: object
                                  properties:
                                    name:
                                      type: string
                                    value:
                                      type: string
                          responseHeaders:
                            description: ProxyRequestHeaders defines the response
                              headers manipulation in an ActionProxy.
                            type: object
                            properties:
                              add:
                                type: array
                                items:
                                  description: Header defines an HTTP Header with
                                    an optional Always field to use with the add_header
                                    NGINX directive.
                                  type: object
                                  properties:
                                    always:
                                      type: boolean
                                    name:
                                      type: string
                                    value:
                                      type: string
                              hide:
                                type: array
                                items:
                                  type: string
                              ignore:
                                type: array
                                items:
                                  type: string
                              pass:
                                type: array
                                items:
                                  type: string
                          rewritePath:
                            type: string
                          upstream:
                            type: string
                      redirect:
                        description: ActionRedirect defines a redirect in an Action.
                        type: object
                        properties:
                          code:
                            type: integer
                          url:
                            type: string
                      return:
                        description: ActionReturn defines a return in an Action.
                        type: object
                        properties:
                          body:
                            type: string
                          code:
                            type: integer
                          type:
                            type: string
                  errorPages:
                    type: array
                    items:
                      description: ErrorPage defines an ErrorPage in a Route.
                      type: object
                      properties:
                        codes:
                          type: array
                          items:
                            type: integer
                        redirect:
                          description: ErrorPageRedirect defines a redirect for an
                            ErrorPage.
                          type: object
                          properties:
                            code:
                              type: integer
                            url:
                              type: string
                        return:
                          description: ErrorPageReturn defines a return for an ErrorPage.
                          type: object
                          properties:
                            body:
                              type: string
                            code:
                              type: integer
                            headers:
                              type: array
                              items:
                                description: Header defines an HTTP Header.
                                type: object
                                properties:
                                  name:
                                    type: string
                                  value:
                                    type: string
                            type:
                              type: string
                  location-snippets:
                    type: string
                  matches:
                    type: array
                    items:
                      description: Match defines a match.
                      type: object
                      properties:
                        action:
                          description: Action defines an action.
                          type: object
                          properties:
                            pass:
                              type: string
                            proxy:
                              description: ActionProxy defines a proxy in an Action.
                              type: object
                              properties:
                                requestHeaders:
                                  description: ProxyRequestHeaders defines the request
                                    headers manipulation in an ActionProxy.
                                  type: object
                                  properties:
                                    pass:
                                      type: boolean
                                    set:
                                      type: array
                                      items:
                                        description: Header defines an HTTP Header.
                                        type: object
                                        properties:
                                          name:
                                            type: string
                                          value:
                                            type: string
                                responseHeaders:
                                  description: ProxyRequestHeaders defines the response
                                    headers manipulation in an ActionProxy.
                                  type: object
                                  properties:
                                    add:
                                      type: array
                                      items:
                                        description: Header defines an HTTP Header
                                          with an optional Always field to use with
                                          the add_header NGINX directive.
                                        type: object
                                        properties:
                                          always:
                                            type: boolean
                                          name:
                                            type: string
                                          value:
                                            type: string
                                    hide:
                                      type: array
                                      items:
                                        type: string
                                    ignore:
                                      type: array
                                      items:
                                        type: string
                                    pass:
                                      type: array
                                      items:
                                        type: string
                                rewritePath:
                                  type: string
                                upstream:
                                  type: string
                            redirect:
                              description: ActionRedirect defines a redirect in an
                                Action.
                              type: object
                              properties:
                                code:
                                  type: integer
                                url:
                                  type: string
                            return:
                              description: ActionReturn defines a return in an Action.
                              type: object
                              properties:
                                body:
                                  type: string
                                code:
                                  type: integer
                                type:
                                  type: string
                        conditions:
                          type: array
                          items:
                            description: Condition defines a condition in a MatchRule.
                            type: object
                            properties:
                              argument:
                                type: string
                              cookie:
                                type: string
                              header:
                                type: string
                              value:
                                type: string
                              variable:
                                type: string
                        splits:
                          type: array
                          items:
                            description: Split defines a split.
                            type: object
                            properties:
                              action:
                                description: Action defines an action.
                                type: object
                                properties:
                                  pass:
                                    type: string
                                  proxy:
                                    description: ActionProxy defines a proxy in an
                                      Action.
                                    type: object
                                    properties:
                                      requestHeaders:
                                        description: ProxyRequestHeaders defines the
                                          request headers manipulation in an ActionProxy.
                                        type: object
                                        properties:
                                          pass:
                                            type: boolean
                                          set:
                                            type: array
                                            items:
                                              description: Header defines an HTTP
                                                Header.
                                              type: object
                                              properties:
                                                name:
                                                  type: string
                                                value:
                                                  type: string
                                      responseHeaders:
                                        description: ProxyRequestHeaders defines the
                                          response headers manipulation in an ActionProxy.
                                        type: object
                                        properties:
                                          add:
                                            type: array
                                            items:
                                              description: Header defines an HTTP
                                                Header with an optional Always field
                                                to use with the add_header NGINX directive.
                                              type: object
                                              properties:
                                                always:
                                                  type: boolean
                                                name:
                                                  type: string
                                                value:
                                                  type: string
                                          hide:
                                            type: array
                                            items:
                                              type: string
                                          ignore:
                                            type: array
                                            items:
                                              type: string
                                          pass:
                                            type: array
                                            items:
                                              type: string
                                      rewritePath:
                                        type: string
                                      upstream:
                                        type: string
                                  redirect:
                                    description: ActionRedirect defines a redirect
                                      in an Action.
                                    type: object
                                    properties:
                                      code:
                                        type: integer
                                      url:
                                        type: string
                                  return:
                                    description: ActionReturn defines a return in
                                      an Action.
                                    type: object
                                    properties:
                                      body:
                                        type: string
                                      code:
                                        type: integer
                                      type:
                                        type: string
                              weight:
                                type: integer
                  path:
                    type: string
                  policies:
                    type: array
                    items:
                      description: PolicyReference references a policy by name and
                        an optional namespace.
                      type: object
                      properties:
                        name:
                          type: string
                        namespace:
                          type: string
                  route:
                    type: string
                  splits:
                    type: array
                    items:
                      description: Split defines a split.
                      type: object
                      properties:
                        action:
                          description: Action defines an action.
                          type: object
                          properties:
                            pass:
                              type: string
                            proxy:
                              description: ActionProxy defines a proxy in an Action.
                              type: object
                              properties:
                                requestHeaders:
                                  description: ProxyRequestHeaders defines the request
                                    headers manipulation in an ActionProxy.
                                  type: object
                                  properties:
                                    pass:
                                      type: boolean
                                    set:
                                      type: array
                                      items:
                                        description: Header defines an HTTP Header.
                                        type: object
                                        properties:
                                          name:
                                            type: string
                                          value:
                                            type: string
                                responseHeaders:
                                  description: ProxyRequestHeaders defines the response
                                    headers manipulation in an ActionProxy.
                                  type: object
                                  properties:
                                    add:
                                      type: array
                                      items:
                                        description: Header defines an HTTP Header
                                          with an optional Always field to use with
                                          the add_header NGINX directive.
                                        type: object
                                        properties:
                                          always:
                                            type: boolean
                                          name:
                                            type: string
                                          value:
                                            type: string
                                    hide:
                                      type: array
                                      items:
                                        type: string
                                    ignore:
                                      type: array
                                      items:
                                        type: string
                                    pass:
                                      type: array
                                      items:
                                        type: string
                                rewritePath:
                                  type: string
                                upstream:
                                  type: string
                            redirect:
                              description: ActionRedirect defines a redirect in an
                                Action.
                              type: object
                              properties:
                                code:
                                  type: integer
                                url:
                                  type: string
                            return:
                              description: ActionReturn defines a return in an Action.
                              type: object
                              properties:
                                body:
                                  type: string
                                code:
                                  type: integer
                                type:
                                  type: string
                        weight:
                          type: integer
            upstreams:
              type: array
              items:
                description: Upstream defines an upstream.
                type: object
                properties:
                  buffer-size:
                    type: string
                  buffering:
                    type: boolean
                  buffers:
                    description: UpstreamBuffers defines Buffer Configuration for
                      an Upstream.
                    type: object
                    properties:
                      number:
                        type: integer
                      size:
                        type: string
                  client-max-body-size:
                    type: string
                  connect-timeout:
                    type: string
                  fail-timeout:
                    type: string
                  healthCheck:
                    description: HealthCheck defines the parameters for active Upstream
                      HealthChecks.
                    type: object
                    properties:
                      connect-timeout:
                        type: string
                      enable:
                        type: boolean
                      fails:
                        type: integer
                      headers:
                        type: array
                        items:
                          description: Header defines an HTTP Header.
                          type: object
                          properties:
                            name:
                              type: string
                            value:
                              type: string
                      interval:
                        type: string
                      jitter:
                        type: string
                      passes:
                        type: integer
                      path:
                        type: string
                      port:
                        type: integer
                      read-timeout:
                        type: string
                      send-timeout:
                        type: string
                      statusMatch:
                        type: string
                      tls:
                        description: UpstreamTLS defines a TLS configuration for an
                          Upstream.
                        type: object
                        properties:
                          enable:
                            type: boolean
                  keepalive:
                    type: integer
                  lb-method:
                    type: string
                  max-conns:
                    type: integer
                  max-fails:
                    type: integer
                  name:
                    type: string
                  next-upstream:
                    type: string
                  next-upstream-timeout:
                    type: string
                  next-upstream-tries:
                    type: integer
                  port:
                    type: integer
                  queue:
                    description: UpstreamQueue defines Queue Configuration for an
                      Upstream.
                    type: object
                    properties:
                      size:
                        type: integer
                      timeout:
                        type: string
                  read-timeout:
                    type: string
                  send-timeout:
                    type: string
                  service:
                    type: string
                  sessionCookie:
                    description: SessionCookie defines the parameters for session
                      persistence.
                    type: object
                    properties:
                      domain:
                        type: string
                      enable:
                        type: boolean
                      expires:
                        type: string
                      httpOnly:
                        type: boolean
                      name:
                        type: string
                      path:
                        type: string
                      secure:
                        type: boolean
                  slow-start:
                    type: string
                  subselector:
                    type: object
                    additionalProperties:
                      type: string
                  tls:
                    description: UpstreamTLS defines a TLS configuration for an Upstream.
                    type: object
                    properties:
                      enable:
                        type: boolean
        status:
          description: VirtualServerRouteStatus defines the status for the VirtualServerRoute
            resource.
          type: object
          properties:
            externalEndpoints:
              type: array
              items:
                description: ExternalEndpoint defines the IP and ports used to connect
                  to this resource.
                type: object
                properties:
                  ip:
                    type: string
                  ports:
                    type: string
            message:
              type: string
            reason:
              type: string
            referencedBy:
              type: string
            state:
              type: string

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: transportservers.k8s.nginx.org
spec:
  group: k8s.nginx.org
  versions:
  - name: v1alpha1
    served: true
    storage: true
  scope: Namespaced
  names:
    plural: transportservers
    singular: transportserver
    kind: TransportServer
    shortNames:
    - ts
  preserveUnknownFields: false
  validation:
    openAPIV3Schema:
      description: TransportServer defines the TransportServer resource.
      type: object
      properties:
        apiVersion:
          description: 'APIVersion defines the versioned schema of this representation
            of an object. Servers should convert recognized schemas to the latest
            internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
          type: string
        kind:
          description: 'Kind is a string value representing the REST resource this
            object represents. Servers may infer this from the endpoint the client
            submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
          type: string
        metadata:
          type: object
        spec:
          description: TransportServerSpec is the spec of the TransportServer resource.
          type: object
          properties:
            action:
              description: Action defines an action.
              type: object
              properties:
                pass:
                  type: string
            host:
              type: string
            listener:
              description: TransportServerListener defines a listener for a TransportServer.
              type: object
              properties:
                name:
                  type: string
                protocol:
                  type: string
            upstreamParameters:
              description: UpstreamParameters defines parameters for an upstream.
              type: object
              properties:
                udpRequests:
                  type: integer
                udpResponses:
                  type: integer
            upstreams:
              type: array
              items:
                description: Upstream defines an upstream.
                type: object
                properties:
                  name:
                    type: string
                  port:
                    type: integer
                  service:
                    type: string

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: policies.k8s.nginx.org
spec:
  group: k8s.nginx.org
  versions:
  - name: v1alpha1
    served: true
    storage: true
  scope: Namespaced
  names:
    plural: policies
    singular: policy
    kind: Policy
    shortNames:
    - pol
  preserveUnknownFields: false
  validation:
    openAPIV3Schema:
      description: Policy defines a Policy for VirtualServer and VirtualServerRoute
        resources.
      type: object
      properties:
        apiVersion:
          description: 'APIVersion defines the versioned schema of this representation
            of an object. Servers should convert recognized schemas to the latest
            internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
          type: string
        kind:
          description: 'Kind is a string value representing the REST resource this
            object represents. Servers may infer this from the endpoint the client
            submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
          type: string
        metadata:
          type: object
        spec:
          description: PolicySpec is the spec of the Policy resource. The spec includes
            multiple fields, where each field represents a different policy. Only
            one policy (field) is allowed.
          type: object
          properties:
            accessControl:
              description: AccessControl defines an access policy based on the source
                IP of a request.
              type: object
              properties:
                allow:
                  type: array
                  items:
                    type: string
                deny:
                  type: array
                  items:
                    type: string
            egressMTLS:
              description: EgressMTLS defines an Egress MTLS policy.
              type: object
              properties:
                ciphers:
                  type: string
                protocols:
                  type: string
                serverName:
                  type: boolean
                sessionReuse:
                  type: boolean
                sslName:
                  type: string
                tlsSecret:
                  type: string
                trustedCertSecret:
                  type: string
                verifyDepth:
                  type: integer
                verifyServer:
                  type: boolean
            ingressMTLS:
              description: IngressMTLS defines an Ingress MTLS policy.
              type: object
              properties:
                clientCertSecret:
                  type: string
                verifyClient:
                  type: string
                verifyDepth:
                  type: integer
            jwt:
              description: JWTAuth holds JWT authentication configuration.
              type: object
              properties:
                realm:
                  type: string
                secret:
                  type: string
                token:
                  type: string
            rateLimit:
              description: RateLimit defines a rate limit policy.
              type: object
              properties:
                burst:
                  type: integer
                delay:
                  type: integer
                dryRun:
                  type: boolean
                key:
                  type: string
                logLevel:
                  type: string
                noDelay:
                  type: boolean
                rate:
                  type: string
                rejectCode:
                  type: integer
                zoneSize:
                  type: string


---
apiVersion: k8s.nginx.org/v1alpha1
kind: GlobalConfiguration
metadata:
  name: nginx-configuration
  namespace: nginx-ingress

---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: nginx-ingress
  namespace: nginx-ingress
spec:
  selector:
    matchLabels:
      app: nginx-ingress
  template:
    metadata:
      labels:
        app: nginx-ingress
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9113"
    spec:
      serviceAccountName: nginx-ingress
      containers:
      - image: swr.cn-east-2.myhuaweicloud.com/kuboard-dependency/nginx-ingress:1.9.1
        imagePullPolicy: IfNotPresent
        name: nginx-ingress
        ports:
        - name: http
          containerPort: 80
          hostPort: 80
        - name: https
          containerPort: 443
          hostPort: 443
        - name: readiness-port
          containerPort: 8081
        - name: prometheus
          containerPort: 9113
        readinessProbe:
          httpGet:
            path: /nginx-ready
            port: readiness-port
          periodSeconds: 1
        securityContext:
          allowPrivilegeEscalation: true
          runAsUser: 101 #nginx
          capabilities:
            drop:
            - ALL
            add:
            - NET_BIND_SERVICE
        env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        args:
          - -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
          - -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
          - -enable-prometheus-metrics
         #- -v=3 # Enables extensive logging. Useful for troubleshooting.
         #- -report-ingress-status
         #- -external-service=nginx-ingress
         #- -global-configuration=$(POD_NAMESPACE)/nginx-configuration

猜你喜欢

转载自blog.csdn.net/qq_35008624/article/details/122156352