This repository has been archived by the owner on Nov 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Autogenerating port names #38
Labels
Comments
@kadel is this necessary? |
yes! Port name is required by kubernetes once you specify more that on port |
@kadel TIL 👍 |
[bump] Encountered this while converting out - https://raw.githubusercontent.com/containscafeine/fabric8-analytics-data-model/master/local-setup/docker-compose.yaml |
picking this up |
you can still convert that, it's not a blocker, you just have to explicitly set port names |
@kadel yep, not a blocker, just bumped because I faced this :P |
concaf
added a commit
to concaf/kedge
that referenced
this issue
Jun 26, 2017
Before this commit, if a definition is passed with multiple ports in one service, then in the generated Kubernetes output, the port names are not populated, which when deployed to a Kubernetes cluster, throws an error. This commit fixes this, such that if multiple ports for one service are specified, then if the port names are not specified, they are auto generated and populated, in the format - "service_name-service_port" Note that, the auto generation and population only happens in case of multiple ports, and in the case when the port names are not already specified. e.g. - for the input - name: test containers: - image: nginx services: - name: nginx ports: - port: 8080 - port: 8081 the resulting output will contain Kubernetes service as - apiVersion: v1 kind: Service metadata: creationTimestamp: null labels: app: test name: nginx spec: ports: - name: nginx-8080 port: 8080 targetPort: 0 - name: nginx-8081 port: 8081 targetPort: 0 selector: app: test This commit also adds tests for this behavior. Fix kedgeproject#38
concaf
added a commit
to concaf/kedge
that referenced
this issue
Jun 27, 2017
Before this commit, if a definition is passed with multiple ports in one service, then in the generated Kubernetes output, the port names are not populated, which when deployed to a Kubernetes cluster, throws an error. This commit fixes this, such that if multiple ports for one service are specified, then if the port names are not specified, they are auto generated and populated, in the format - "service_name-service_port" Note that, the auto generation and population only happens in case of multiple ports, and in the case when the port names are not already specified. e.g. - for the input - name: test containers: - image: nginx services: - name: nginx ports: - port: 8080 - port: 8081 the resulting output will contain Kubernetes service as - apiVersion: v1 kind: Service metadata: creationTimestamp: null labels: app: test name: nginx spec: ports: - name: nginx-8080 port: 8080 targetPort: 0 - name: nginx-8081 port: 8081 targetPort: 0 selector: app: test This commit also adds tests for this behavior. Fix kedgeproject#38
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
if multiple ports are specified in a single service they have to be named. see https://kubernetes.io/docs/concepts/services-networking/service/#multi-port-services
We can make names optional and autogenerate them if no name is specified.
The text was updated successfully, but these errors were encountered: