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

When running as a container in Kubernetes, the tentacle container cannot be configured in listening mode #355

Open
coryreid opened this issue Feb 11, 2022 · 1 comment

Comments

@coryreid
Copy link

Tentacle offers four options for hostname configuration during registration:

  • PublicIP
  • FQDN
  • ComputerName
  • Custom (Paired with CustomPublicHostName)

However, when standing up a listening worker in AKS, these all fail. PublicIP resolves to the Azure IP address (52.x.x.x), which isn't registerable within the cluster. The FQDN/ComputerName options utilize the hostname, which maps to the container name in the pod. However, these aren't routable through https:// from the Octopus server. Finally, Custom would work if it were possible to know the cluster IP at registration time, which isn't currently possible.

Running hostname -i on the container provides the internal cluster IP, which can be used to successfully register and route tasks to a listening tentacle. Being able to choose that internal IP would make listening tentacles function in Kubernetes in a similar fashion to other Octopus server registration workflows.

@lpodolak
Copy link

lpodolak commented Mar 6, 2024

I know it's been 2 years after the original post, but I managed to configure tentacle in listening mode in K8S. The key is to use the "Custom" PublicHostNameConfiguration and specify pod's IP as the value for CustomPublicHostName, like below

- name: PublicHostNameConfiguration
  value: Custom
- name: CustomPublicHostName
  valueFrom:
    fieldRef:
      apiVersion: v1
      fieldPath: status.podIP

Another useful tip is to have tentacle automatically unregistering from Octopus Server once the pod is killed:

lifecycle:
  preStop: # Deregister tentacle from the server when pod is killed (e.g. during deployments)
    exec:
      command: ["sh", "-c", "tentacle deregister-worker --server=$ServerUrl --apiKey=$ServerApiKey"]

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

2 participants