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

Add headless service type label #979

Merged
merged 1 commit into from
Apr 16, 2018

Conversation

hangyan
Copy link
Contributor

@hangyan hangyan commented Apr 2, 2018

Also remove the relation between restart and service create

@hangyan hangyan requested review from cdrage and surajnarwade April 2, 2018 13:48
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 2, 2018
@hangyan
Copy link
Contributor Author

hangyan commented Apr 2, 2018

close #851

@hangyan
Copy link
Contributor Author

hangyan commented Apr 8, 2018

@cdrage @kadel Help me review this if you guys have time.

Copy link
Member

@cdrage cdrage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's my review!

| kompose.service.expose | true / hostname |
| kompose.service.expose.tls-secret | secret name |
| kompose.volume.size | kubernetes supported volume size |

**Note**: `kompose.service.type` label should be defined with `ports` only, otherwise `kompose` will fail.
**Note**: `kompose.service.type` label should be defined with `ports` only(except for headless service), otherwise `kompose` will fail.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add spacing between only and (except)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!, thanks!

@@ -33,6 +33,9 @@ const (
LabelServiceExpose = "kompose.service.expose"
// LabelServiceExposeTLSSecret provides the name of the TLS secret to use with the Kubernetes ingress controller
LabelServiceExposeTLSSecret = "kompose.service.expose.tls-secret"

// ServiceTypeHeadless...
ServiceTypeHeadless = "Headless"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most other variables are lowercase, should we use headless instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a special case. Since kubernetes api does not have a "Headless' type, it has api.ServiceTypeClusterIP=ClusterIP.... This is var is only for internal use, others are custom labels that will show in the compose file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense.. This LGTM then!

if service.ExposeService != "" {
objects = append(objects, o.initRoute(name, service, svc.Spec.Ports[0].Port))
}
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use an else if here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks!

@hangyan hangyan force-pushed the restart-and-service branch 2 times, most recently from c9d0c17 to 7bc512a Compare April 14, 2018 08:09
Also remove the relation between restart and service create
@hangyan hangyan force-pushed the restart-and-service branch from 20ba920 to f3412a7 Compare April 14, 2018 16:24
@cdrage
Copy link
Member

cdrage commented Apr 16, 2018

LGTM! 👍

@cdrage cdrage merged commit 5fc22fd into kubernetes:master Apr 16, 2018
@hangyan hangyan deleted the restart-and-service branch December 27, 2019 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants