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

feat(ingress) Experimental Native Ingress #316

Merged
merged 5 commits into from
Mar 30, 2017
Merged

Conversation

krisnova
Copy link
Contributor

@krisnova krisnova commented Feb 14, 2017

Preliminary work for disabling the router chart when using EXPERIMENTAL_NATIVE_INGRESS

Note: this will probably be refactored once we figure out #771

Requires deis/builder#495
Requires deis/workflow#732
Requires deis/controller#1243

@codecov-io
Copy link

codecov-io commented Feb 14, 2017

Codecov Report

Merging #316 into master will increase coverage by 3.78%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #316      +/-   ##
==========================================
+ Coverage   55.69%   59.48%   +3.78%     
==========================================
  Files           6        6              
  Lines         386      543     +157     
==========================================
+ Hits          215      323     +108     
- Misses        151      189      +38     
- Partials       20       31      +11
Impacted Files Coverage Δ
model/model.go 54.16% <0%> (+7.82%)
nginx/config.go 64.93% <0%> (+8.07%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d6f130...018e469. Read the comment docs.

@krancour
Copy link
Contributor

@kris-nova, I think I see a problem here...

.Values.global.experimental_native_ingress looks like a value from the "parent" Workflow chart, which merely depends upon this chart. I don't think this chart will ever see that value (i.e., it can't look "up"), which can certainly complicate the notion of conditionally installing or not installing the resources defined in this chart based on some config option in the parent chart.

Thinking through this more, I suspect what we really need to do is not touch the router chart at all, but conditionally include it or not include it in the Workflow chart. I'm wondering if that can actually be done... going to consult with the Helm team a bit.

.gitignore Outdated
@@ -4,3 +4,4 @@ rootfs/opt/router/sbin/router
rootfs/opt/router/sbin/router.*
vendor/
coverage.txt
.idea*
Copy link
Member

Choose a reason for hiding this comment

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

Hiding files under .idea isn't strictly related to the ingress changes, so ideally this would be in a separate PR.

@@ -76,3 +77,4 @@ spec:
port: 9090
initialDelaySeconds: 1
timeoutSeconds: 1
{{ end }}
Copy link
Member

Choose a reason for hiding this comment

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

These files should end with a newline to satisfy some tools.

Would it improve readability to finish with a comment like:

{{ end }}{{/* if not .Values.global.experimental_native_ingress */}}

I'm just asking--not sure myself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added, also added a newline back to the end.. dang emacs 😝

Adding logic to disable router

Non breaking change, as users must opt-in to the feature.
@krisnova krisnova changed the title [WIP] - Experimental Native Ingress Experimental Native Ingress Mar 2, 2017
krisnova added 2 commits March 6, 2017 10:30
Add newline and comment for huge if statmenet

Non breaking change, just semantic
Add newline and comment for huge if statmenet

Non breaking change, just semantic
.gitignore Outdated
@@ -1,4 +1,4 @@
rootfs/opt/router/sbin/router
rootfs/opt/router/sbin/router.*
vendor/
coverage.txt
coverage.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this removes the trailing newline in this file. Can we leave that be?

Remove trailing newline

Non breaking change, just semantic
@@ -1,3 +1,4 @@
{{- if not .Values.global.experimental_native_ingress }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I may have said something to this effect once before, but I don't think this works... .Values.global looks like a reference to the "top level" configuration in the Workflow chart. This chart can't "look up" into there because... well... imagine the scenario where this chart is installed standalone (i.e. without the rest of Workflow)... there wouldn't even be anything to look up to.

I think this repo probably does not require any changes to support the native ingress initiative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the global.experimental_native_engress value to the values.yaml for the router chart.. this should support a standalone installation of the router

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah. I am sorry for a bit of mis-understanding here. I'd forgotten that global was a special scope within Helm that allowed charts to "look up." I've now realized that...

I understand what you're trying to do here. Regardless of whether someone installs the router chart directly or installs the Workflow chart, which includes the router chart, a value for global.experimental_native_ingress should be available.

Although I understand what you're trying to do and agree it would work, I think there are a couple smells here... and I think there's a much cleaner alternative.

The smells:

The router chart now has the ability, when installed, depending on the value of global.experimental_native_ingress to actually not install any of its k8s resources. i.e. It is possible to effect a "no-op" install of the router. (Install this chart-- but dont!) This doesn't make sense unless considered in the broader context of re-use by the Workflow chart. That means the router chart has been designed with that specific re-use by the Workflow chart in mind. And that's a smell. Because, what really, does "experimental native ingress" mean to the router itself? Nothing, in fact.

As I've said before, I think the router requires no changes to support this experiment. (Neither Go nor chart changes are in order.) All that needs to be done is for the Workflow chart to conditionally include or not include the router chart. Until re-reading the Helm documentation this evening, I'd hoped, but hadn't known for sure that was possible... it is...

This section of the documentation shows two techniques that could be used to conditionally include or exclude the router chart in its entirety from a Workflow installation:

https://github.com/kubernetes/helm/blob/master/docs/charts.md#tags-and-condition-fields-in-requirementsyaml

Copy link
Member

@mboersma mboersma Mar 15, 2017

Choose a reason for hiding this comment

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

Point: @knova I think I misunderstood the context earlier. I see @krancour's point that this makes a change to the router's own chart that allows it to be disabled completely, which seems wrong in the context of the router chart standing alone. We do intend the individual component charts to be useful separate from Workflow itself if at all possible.

Counterpoint: changing to use the new tags and conditions in Helm requires Workflow to specify helm v2.2.1 or later, is my understanding. And other components such as minio are disabled in a similarly inelegant way already. It could be argued that using tags + conditions isn't in scope for this overall feature, and that we should instead make a coordinated effort to refactor all conditional components at once.

@krancour would you be amenable to allowing this smelly-but-consistent change into router if we follow up with a set of PRs that embrace Helm tags & conditions that remove the currently enclosing {{ if blocks from all relevant Workflow charts?

Copy link
Contributor

@krancour krancour Apr 3, 2017

Choose a reason for hiding this comment

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

@krancour would you be amenable to allowing this smelly-but-consistent change into router if we follow up with...

Sorry, @mboersma.., late to the game on this, but yes. 👍

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @krancour, no worries. We do intend to revert this change at some point in the future in favor of the cleaner tags & conditionals approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry my code smells

Adding global.experimental_native_ingress flag to values.yaml so this can be ran standalone

Non breaking change, just semantic
@krisnova krisnova closed this Mar 8, 2017
@krisnova krisnova changed the title Experimental Native Ingress feat(ingress) Experimental Native Ingress Mar 8, 2017
@krisnova krisnova reopened this Mar 14, 2017
@mboersma mboersma added this to the v2.13 milestone Mar 14, 2017
@krisnova
Copy link
Contributor Author

@mboersma @bacongobbler does anyone else see anything that needs attention on this one?

@bacongobbler
Copy link
Member

Nope! Looks like all of the templated objects from this chart is covered.

@mboersma
Copy link
Member

With the caveat that we intend to refactor this eventually (see deis/workflow#771), I'm ok with this change.

mboersma pushed a commit to mboersma/controller that referenced this pull request Mar 30, 2017
Adding ingress support to controller
Adding changes to chart to support feature
Adding ingress rules for controller API, and SSH on TCP 2222
Adding ingress support in general

Requires deis/workflow#732
Requires deis/builder#495
Requires deis/router#316

Technically a non breaking change, as the user must opt-in to the feature
@mboersma mboersma merged commit b8e207e into deis:master Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants