Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

A better way to define Service ports #19

Closed
concaf opened this issue Jun 14, 2017 · 10 comments
Closed

A better way to define Service ports #19

concaf opened this issue Jun 14, 2017 · 10 comments

Comments

@concaf
Copy link
Collaborator

concaf commented Jun 14, 2017

The way Kubernetes' ServiceSpec allows describing Ports is something like this -

services:
- name: wordpress
  type: LoadBalancer
  ports:
  - port: 8080
    targetPort: 80
    protocol: UDP

We can also provide an alternative shortcut way to do this by using a syntax like -

services:
- name: wordpress
  type: LoadBalancer
  ports:
  - 8080:80/udp
@pradeepto
Copy link
Member

Will this not make tooling difficult and perhaps induce string magic?

@kadel
Copy link
Member

kadel commented Jun 14, 2017

You are overwriting already existing 'ports'.
Shortcuts can't do that. We have to keep the original way of defining things untouched.

We can use a shortcut like this, but it has to be named differently. Something that is not already in ServiceSpec

@concaf
Copy link
Collaborator Author

concaf commented Jun 14, 2017

@pradeepto -

Will this not make tooling difficult and perhaps induce string magic?

Yes, the tooling will be difficult but that is an implementation detail that we can take care of.
Yes, this introduces string magic, but how else do we want to implement more intuitive shortcuts?

@kadel -

We can use a shortcut like this, but it has to be named differently. Something that is not already in ServiceSpec

Agree, we can have a different field name for this, we can carry the ...Ref convention here

services:
- name: wordpress
  type: LoadBalancer
  portsRef:
  - 8080:80/udp
  ports:
  - port: 8080
    targetPort: 80
    protocol: UDP

@pradeepto
Copy link
Member

Yes, the tooling will be difficult but that is an implementation detail that we can take care of.
Yes, this introduces string magic, but how else do we want to implement more intuitive shortcuts?

That is definitely not what we discussed in the meeting. To quote from the meeting logs that you yourself noted:

"We should make something that is easier to tool the entire thing"

Strong -1 to this idea.

@kadel
Copy link
Member

kadel commented Jun 14, 2017

ref should be used as a shortcut for Reference. In this case, we are not referencing anything, or am I missing something?

@kadel
Copy link
Member

kadel commented Jun 14, 2017

"We should make something that is easier to tool the entire thing"

Just be aware that it is quite common that "easy to tool" and "easy for humans" are opposite.

@concaf
Copy link
Collaborator Author

concaf commented Jun 14, 2017

@kadel -

ref should be used as a shortcut for Reference. In this case, we are not referencing anything, or am I missing something?

Yep, in OpenCompose we decided to use ref as something that will refer to the root level shared concepts, but here we can use it to refer to a concept.
I am fine with any other convention if ref does not look right, but I'd love to have a convention to define the shortcuts.

@concaf
Copy link
Collaborator Author

concaf commented Jun 14, 2017

@pradeepto - everything in #2 required string magic. Doing string magic is going to let us create shortcuts to add better UX to the spec. It's not about string magic, it's about better UX for the spec, which is the prime goal right now.

I'm fine with not doing string magic if there is a better way of implementing this, any suggestions?

@pradeepto
Copy link
Member

@containscafeine @kadel Whatever you guys decide, keep integrations (LSP bits etc) in the mind. If we can integrate with existing tooling (vscode, che) with less or no effort that is a HUGE win. Saves time and wins hearts. That is all I am saying.

@concaf concaf changed the title A better to define Service ports A better way to define Service ports Jun 14, 2017
@concaf
Copy link
Collaborator Author

concaf commented Jun 14, 2017

I don't think we need this for now, let's reconsider if and when a need arises

@concaf concaf closed this as completed Jun 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants