Skip to content

Instantly share code, notes, and snippets.

@jmrobles
Last active December 17, 2021 10:42
Show Gist options
  • Save jmrobles/909f8c3aa2f6614d58e81a81579d510d to your computer and use it in GitHub Desktop.
Save jmrobles/909f8c3aa2f6614d58e81a81579d510d to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
annotations:
load-balancer.hetzner.cloud/health-check-port: "<YOUR-INGRESS-HEALTH-PORT: i.e 31902>"
load-balancer.hetzner.cloud/name: "<YOUR-LB-NAME>"
spec:
clusterIP: <Internal-IP>
externalTrafficPolicy: Local
healthCheckNodePort: 30787
ports:
- name: http
nodePort: 31902
port: 80
protocol: TCP
targetPort: http
- name: https
nodePort: 30193
port: 443
protocol: TCP
targetPort: https
selector:
app.kubernetes.io/component: controller
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/name: ingress-nginx
sessionAffinity: None
type: LoadBalancer
@okaufmann
Copy link

okaufmann commented Mar 23, 2021

Hi, can you tell me, where to find a full version of the service definition of the default ingress controller?

I'm following your great article https://jmrobles.medium.com/how-to-setup-hetzner-load-balancer-on-a-kubernetes-cluster-2ce79ca4a27b but I can not reproduce the steps where to apply this annotations...

@wethinkagile
Copy link

I agree with @okaufmann it is unclear what ingress controller to use and why an ingress can use type LoadBalancer, I thought this was a service type?

@yoplait
Copy link

yoplait commented Dec 16, 2021

totally agree is great but .. for cover end to end approach will be great to see a full example with all the lines ... did you guys manage to find anything to do this? Cheers!

@jmrobles
Copy link
Author

I'm sorry guys, updated with the "full" version (minimum required for the service).

@yoplait
Copy link

yoplait commented Dec 17, 2021

Thanks for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment