-
Notifications
You must be signed in to change notification settings - Fork 64
Support manifest on riff system install #691
Conversation
cmd/commands/system.go
Outdated
components to be installed. The manifest file contents should be of the following form: | ||
|
||
version: 0.1 | ||
istio-crds: https://path/to/istio-crds.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be an underscore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Well spotted!
docs/riff_system_install.md
Outdated
Use the '--manifest' flag to specify the path of a manifest file which provides the URLs of the YAML files to be applied. | ||
The manifest file contents should be of the following form: | ||
|
||
version: 0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the format here is different than what I see in the cmd/commands/system.go
file.
I kind of like the grouping here, so if we could have the following:
istio:
- https://path/to/istio.yaml
knative:
- https://path/to/knative-build.yaml
- https://path/to/knative-serving.yaml
- https://path/to/knative-eventing.yaml
- https://path/to/stub-clusterbus.yaml
namespace:
- https://path/to/riff-buildtemplate.yaml
then we would have more flexibility in including one, two ore more files for each group
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was considering a grouping along those lines, especially since @scothis suggested it in the issue. However, there is some special processing which doesn't lend itself to this approach.
For istio, there is a 5 second delay between installing the CRDs and installing the other istio resources. Apart from the obvious race involved when deploying to a very sluggish system, I was trying not to break the current behaviour. I guess I could introduce a 5 second delay between all the items in the istio group, but that feels like a bit of a hack.
Similarly, there is a change applied to the serving YAML if and only if --node-port
is specified. I am a bit nervous about applying this change to all the YAML files in the knative
group because we can't tell what YAML files users will add to each group and whether such a global change would be correct or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current Istio config is a hack to work around a bug that has been fixed. There are still potential issues when applying the new istio yaml, but that can be solved by a retry on failure. A retry is not a bad idea for any applied yaml.
The NodePort/LoadBalancer swap should be "relatively" safe, we can make the match more selective if there are false positives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we know when to retry? we don't really know what's in the yaml files, or which namespaces they target except for the istio install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we know when to retry?
When the command you're running exits with a non-zero code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 5 second delay between istio YAMLs may be necessary if someone uses a manifest to install istio earlier than v1.0.1. I'd prefer to defer retries to a separate issue to avoid scope creep in this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll open a separate issue for retry. #704
pkg/core/manifest.go
Outdated
// Manifest defines the location of YAML files for system components. | ||
type Manifest struct { | ||
Version string | ||
IstioCRDs string `yaml:"istio_crds"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention in yaml is camelCase, but I like Thomas' suggestion better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'll fix this for now regardless of whether we adopt the grouping suggestion.
70f0129
to
2fd166b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few nits, otherwise lgtm
@@ -0,0 +1,8 @@ | |||
version: 0.1 | |||
istio: | |||
- istio-crds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is this really valid, or just good enough pass the basic validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect it's valid, but the intention was that it was just enough to test the manifest parsing.
pkg/core/system.go
Outdated
@@ -236,7 +253,7 @@ func resolveReleaseURLs(filename string) (url.URL, error) { | |||
if u.Scheme == "http" || u.Scheme == "https" { | |||
return *u, nil | |||
} | |||
return *u, fmt.Errorf("filename must be file, http or https, got %s", u.Scheme) | |||
return *u, fmt.Errorf("filename must be file, http or https, got %s", u.Scheme) // TODO: support file scheme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we don't support file, remove it from the error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
pkg/core/system.go
Outdated
@@ -31,7 +31,8 @@ import ( | |||
) | |||
|
|||
const ( | |||
istioNamespace = "istio-system" | |||
istioNamespace = "istio-system" | |||
// NOTE: KEEP THE FOLLOWING IN STEP WITH manifest.yaml IN THE ROOT OF THIS REPOSITORY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is important, add a test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, beats codegen. Thanks.
@@ -0,0 +1 @@ | |||
. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Fixes #648