おうちKubernetes に Ingress-Nginx Controllerをインストール

概要

上記おうちKubernetesクラスターにて、下記の通り、Metallbがデプロイできました。

Metallb が動きましたので、この状態で Ingress-Nginx Controller をインストールしてみます。

Ingress-Nginx Controllerのインストール (helmを使用)

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx --create-namespace -n ingress-system

事例

$ helm install ingress-nginx ingress-nginx/ingress-nginx --create-namespace -n ingress-system
NAME: ingress-nginx
LAST DEPLOYED: Sun Jul 14 22:13:39 2024
NAMESPACE: ingress-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
The ingress-nginx controller has been installed.
It may take a few minutes for the load balancer IP to be available.
You can watch the status by running 'kubectl get service --namespace ingress-system ingress-nginx-controller --output wide --watch'

An example Ingress that makes use of the controller:
  apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    name: example
    namespace: foo
  spec:
    ingressClassName: nginx
    rules:
      - host: www.example.com
        http:
          paths:
            - pathType: Prefix
              backend:
                service:
                  name: exampleService
                  port:
                    number: 80
              path: /
    # This section is only required if TLS is to be enabled for the Ingress
    tls:
      - hosts:
        - www.example.com
        secretName: example-tls

If TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:

  apiVersion: v1
  kind: Secret
  metadata:
    name: example-tls
    namespace: foo
  data:
    tls.crt: <base64 encoded cert>
    tls.key: <base64 encoded key>
  type: kubernetes.io/tls

EXTERNAL-IP が払い出されていますので上手く行っていると思われます。

$ kubectl get service --namespace ingress-system ingress-nginx-controller --output wide --watch
NAME                       TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                      AGE    SELECTOR
ingress-nginx-controller   LoadBalancer   10.110.78.190   192.168.10.62   80:31330/TCP,443:32369/TCP   2m6s   app.kubernetes.io/component=controller,app.kubernetes.io/instance=ingress-nginx,app.kubernetes.io/name=ingress-nginx
Copied title and URL