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

Allow service setting externalName #339

Closed
lauer opened this issue Jul 26, 2024 · 5 comments · Fixed by #335
Closed

Allow service setting externalName #339

lauer opened this issue Jul 26, 2024 · 5 comments · Fixed by #335
Assignees
Labels
enhancement New feature or request

Comments

@lauer
Copy link

lauer commented Jul 26, 2024

Details

Add support for service type: ExternalName:

Example:

apiVersion: v1
kind: Service
metadata:
  name: my-service
  namespace: prod
spec:
  type: ExternalName
  externalName: my.database.example.com

Anything else you would like to add:

This is currently not possible, because of the externalName setting is not valid according to the common schema and would not be included in the template

Additional Information:

Documentation here: https://kubernetes.io/docs/concepts/services-networking/service/#externalname

@lauer lauer added the enhancement New feature or request label Jul 26, 2024
@lauer
Copy link
Author

lauer commented Jul 29, 2024

Thanks for the effort, is there a way to test this implementation in my helm chart? It does not looks like you build beta/unstable charts?

I also tried to add the template-service to my templates dir, but I was not able to fetch all variables from common template, which needs to be used in annotations and labels. Maybe you have an enable for that?

@bjw-s
Copy link
Owner

bjw-s commented Jul 29, 2024

I'm pushing out 3.3.0 right now and the required app-template (schema) updates after that, so you should be good to use that in a few minutes :)

@lauer
Copy link
Author

lauer commented Jul 30, 2024

You didn't write a test for this externalName setting. Are you sure it was neigh to add it to the json file?
Because the template generation does not include this.

service:
    main:
      primary: true
      ... snip ...
    api-backend:
      primary: false
      controller: app
      type: ExternalName
      externalName: httpbin.org
      ports: 
        http:
          port: 80

returns the following spec

spec:
  type: ExternalName
  ports:
    - port: 80
      targetPort: 80
      protocol: TCP
      name: http

so without the externalName. The schema check does not complain about the field.

@bjw-s
Copy link
Owner

bjw-s commented Jul 30, 2024

Wh00ps... I interpreted the bug report as if it was only the schema preventing it from working. Will push a fix later today Just pushed 3.3.1 which should fix the issue

@lauer
Copy link
Author

lauer commented Jul 30, 2024

Thanks, it works now! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants