NOTES.txt 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. The ingress-nginx controller has been installed.
  2. {{- if contains "NodePort" .Values.controller.service.type }}
  3. Get the application URL by running these commands:
  4. {{- if (not (empty .Values.controller.service.nodePorts.http)) }}
  5. export HTTP_NODE_PORT={{ .Values.controller.service.nodePorts.http }}
  6. {{- else }}
  7. export HTTP_NODE_PORT=$(kubectl --namespace {{ .Release.Namespace }} get services -o jsonpath="{.spec.ports[0].nodePort}" {{ include "ingress-nginx.controller.fullname" . }})
  8. {{- end }}
  9. {{- if (not (empty .Values.controller.service.nodePorts.https)) }}
  10. export HTTPS_NODE_PORT={{ .Values.controller.service.nodePorts.https }}
  11. {{- else }}
  12. export HTTPS_NODE_PORT=$(kubectl --namespace {{ .Release.Namespace }} get services -o jsonpath="{.spec.ports[1].nodePort}" {{ include "ingress-nginx.controller.fullname" . }})
  13. {{- end }}
  14. export NODE_IP=$(kubectl --namespace {{ .Release.Namespace }} get nodes -o jsonpath="{.items[0].status.addresses[1].address}")
  15. echo "Visit http://$NODE_IP:$HTTP_NODE_PORT to access your application via HTTP."
  16. echo "Visit https://$NODE_IP:$HTTPS_NODE_PORT to access your application via HTTPS."
  17. {{- else if contains "LoadBalancer" .Values.controller.service.type }}
  18. It may take a few minutes for the LoadBalancer IP to be available.
  19. You can watch the status by running 'kubectl --namespace {{ .Release.Namespace }} get services -o wide -w {{ include "ingress-nginx.controller.fullname" . }}'
  20. {{- else if contains "ClusterIP" .Values.controller.service.type }}
  21. Get the application URL by running these commands:
  22. export POD_NAME=$(kubectl --namespace {{ .Release.Namespace }} get pods -o jsonpath="{.items[0].metadata.name}" -l "app={{ template "ingress-nginx.name" . }},component={{ .Values.controller.name }},release={{ .Release.Name }}")
  23. kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
  24. echo "Visit http://127.0.0.1:8080 to access your application."
  25. {{- end }}
  26. An example Ingress that makes use of the controller:
  27. {{- $isV1 := semverCompare ">=1" .Chart.AppVersion}}
  28. apiVersion: networking.k8s.io/v1
  29. kind: Ingress
  30. metadata:
  31. name: example
  32. namespace: foo
  33. {{- if eq $isV1 false }}
  34. annotations:
  35. kubernetes.io/ingress.class: {{ .Values.controller.ingressClass }}
  36. {{- end }}
  37. spec:
  38. {{- if $isV1 }}
  39. ingressClassName: {{ .Values.controller.ingressClassResource.name }}
  40. {{- end }}
  41. rules:
  42. - host: www.example.com
  43. http:
  44. paths:
  45. - pathType: Prefix
  46. backend:
  47. service:
  48. name: exampleService
  49. port:
  50. number: 80
  51. path: /
  52. # This section is only required if TLS is to be enabled for the Ingress
  53. tls:
  54. - hosts:
  55. - www.example.com
  56. secretName: example-tls
  57. If TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:
  58. apiVersion: v1
  59. kind: Secret
  60. metadata:
  61. name: example-tls
  62. namespace: foo
  63. data:
  64. tls.crt: <base64 encoded cert>
  65. tls.key: <base64 encoded key>
  66. type: kubernetes.io/tls
  67. {{- if .Values.controller.headers }}
  68. #################################################################################
  69. ###### WARNING: `controller.headers` has been deprecated! #####
  70. ###### It has been renamed to `controller.proxySetHeaders`. #####
  71. #################################################################################
  72. {{- end }}