V
V
VITYA-XY12019-08-22 03:06:08
Nginx
VITYA-XY1, 2019-08-22 03:06:08

How to throw the Ingress controller out?

Hello gentlemen DevOps For an hour I ca n't
figure out how to "exposure" ports 80 and 443 out: I roughly understood the app service (according to the service label). But how to correctly deploy the ingress controller for the normal operation of ingress resources is not yet clear to me: 1) the ingress-nginx image is deployed by Google or from nginx itself. 2) the corresponding service, configmaps are created and a service account is created. So now the question is: HOW to forward this service outside 80.443 through NodePort if only ports from 30000 are available.
5d5dda2422b35571685076.png
Google found a post where this is done through the daemon set
I met examples where this is done through the cloud LoadBalancer. But as to how this is done correctly on the iron, I did not understand.
Could you explain clearly or share an example?
Thanks to

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Zamyatin, 2019-08-22
@VITYA-XY1

Greetings.
Below is an example daemon set configuration for bare-metal k8s. If there are questions - write.

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: nginx-ingress-lb
  labels:
    name: nginx-ingress-lb
  namespace: kube-system
spec:
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        name: nginx-ingress-lb
      annotations:
        prometheus.io/port: '10254'
        prometheus.io/scrape: 'true'
    spec:
      serviceAccountName: nginx-ingress-serviceaccount
      # This may be used to push kubernetes SVCs to the internet
      # Label a secure host as 'edge-router' + setup forwarding, SSL certs, etc.
      hostNetwork: true
      nodeSelector:
        node-role.kubernetes.io/ingress: "true"
      terminationGracePeriodSeconds: 60
      containers:
      - image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.25.0
        name: nginx-ingress-lb
        readinessProbe:
          httpGet:
            path: /healthz
            port: 10254
            scheme: HTTP
        livenessProbe:
          httpGet:
            path: /healthz
            port: 10254
            scheme: HTTP
          initialDelaySeconds: 10
          timeoutSeconds: 1
        ports:
        - containerPort: 80
          hostPort: 80
        - containerPort: 443
          hostPort: 443
        env:
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
        args:
        - /nginx-ingress-controller
        - --default-backend-service=$(POD_NAMESPACE)/default-http-backend
        - --configmap=$(POD_NAMESPACE)/nginx-ingress-configmap
        - --default-ssl-certificate=$(POD_NAMESPACE)/default-ssl-cert

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question