Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to set a custom hostname on DHCP lease request ? #614

Closed
shkuviak opened this issue Sep 15, 2023 · 1 comment
Closed

Is it possible to set a custom hostname on DHCP lease request ? #614

shkuviak opened this issue Sep 15, 2023 · 1 comment

Comments

@shkuviak
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I deployed kube-vip in my microk8s cluster using DHCP to assign IP provided by DHCP server to services.

It's working great.

Now I would like to access those IP via a hostname.

DHCP offers the possibility to send a client hostname when requesting an IP. Then, DHCP server registers the hostname in DNS server (Active Directory Infrastructure) to access the machine by domain name: my-hostname.my.custom.domain

I cannot find any way to specify a hostname to the DHCP client. Is this feature implemented ?

Describe the solution you'd like
I would like to specify a hostname for a specific LoadBalancer service to be able to access it via domain name resolution provided by my domain controller.

Example: while exposing a deployment:

kube expose deployment my-deployment --port 80 --target-port 8080 --type=LoadBalancer --name=my-service --load-balancer-ip=0.0.0.0 --hostname=my-deployment-hostname.my.custom.domain

Then, i'll be able to access the deployment via curl my-deployment-hostname.my.custom.domain

Additional context
my kube-vip deployment manifest:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  creationTimestamp: null
  labels:
    app.kubernetes.io/name: kube-vip-ds
    app.kubernetes.io/version: v0.6.2
  name: kube-vip-ds
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: kube-vip-ds
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/name: kube-vip-ds
        app.kubernetes.io/version: v0.6.2
    spec:
      containers:
      - args:
        - manager
        env:
        - name: vip_arp
          value: "true"
        - name: port
          value: "6443"
        - name: vip_interface
          value: enp0s31f6
        - name: vip_cidr
          value: "32"
        - name: svc_enable
          value: "true"
        - name: vip_leaderelection
          value: "true"
        - name: vip_leasename
          value: plndr-cp-lock
        - name: vip_leaseduration
          value: "5"
        - name: vip_renewdeadline
          value: "3"
        - name: vip_retryperiod
          value: "1"
        - name: address
          value: "my-custom-hostname.my.custom.domain" # -> Ignore it, I misunderstood this feature at the begining
        - name: prometheus_server
          value: :2112
        image: ghcr.io/kube-vip/kube-vip:v0.6.2
        imagePullPolicy: Always
        name: kube-vip
        resources: {}
        securityContext:
          capabilities:
            add:
            - NET_ADMIN
            - NET_RAW
      hostNetwork: true
      serviceAccountName: kube-vip
      tolerations:
      - effect: NoSchedule
        operator: Exists
      - effect: NoExecute
        operator: Exists
  updateStrategy: {}
@shkuviak
Copy link
Contributor Author

shkuviak commented Dec 2, 2023

Feature merged in master.
Closing

@shkuviak shkuviak closed this as completed Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant