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

fix k8s overlays for addons #22104

Merged
merged 5 commits into from
Mar 18, 2020
Merged

Conversation

richardwxn
Copy link
Contributor

@richardwxn richardwxn commented Mar 11, 2020

fix #21995

  1. update the k8s overlay logic for addonComponents.
  2. update kiali charts to include the service type and annotation options

Notes: the reordering of some fields in the test output is caused by the json merge generates different order with original yaml

@richardwxn richardwxn requested a review from a team as a code owner March 11, 2020 21:51
@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Mar 11, 2020
@istio-testing istio-testing added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 11, 2020
Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

I thought this is what the overlays were for?

@richardwxn richardwxn changed the title add service to kiali charts fix k8s overlays for addons Mar 12, 2020
@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Mar 12, 2020
@istio-testing istio-testing added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR needs to be rebased before being merged size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 13, 2020

var found bool
var m interface{}
if componentName == name.AddonComponentName {
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be better to do this inside renderFeatureComponentPathTemplate as a special case template. this kind of fixup if going to be hard to read and maintain.

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 can create a helper function for this, would that be better? The reason is that we are not just changing the templates but there is also some logic changed required(due to the limitation of the tpath code we discussed offline)

@@ -3,10 +3,15 @@ kind: Service
metadata:
name: kiali
namespace: {{ .Release.Namespace }}
annotations:
Copy link
Contributor

Choose a reason for hiding this comment

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

per john's comment this strikes me as the wrong approach - we should not be adding things that are in IOP to values.yaml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I think for now we should keep it consistent with other templates, which means that we should have it before we fully remove helm support.

Copy link
Contributor

Choose a reason for hiding this comment

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

we are quite likely to move the kiali chart out of the repo shortly so this is not likely to be a lasting change. does this pr work without this change? if not we will have to tackle this problem sooner or later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

without this, user can still do overlay via IOP API, they just cannot use the helm values pass through, but we actually can do that for other addons. I think we'd better to remove all of them at once to keep it consistent later

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Mar 15, 2020
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Mar 15, 2020
@richardwxn
Copy link
Contributor Author

@ostromart PTAL again

kiali:
enabled: true
k8s:
serviceAnnotations:
Copy link
Contributor

Choose a reason for hiding this comment

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

could you please also add something like resources here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok done

// getK8SSpecFromIOP is helper function to get k8s spec from IOP using path
// 1. if component is not an addonComponent, get the spec directly from IOP
// 2. otherwise convert the path and the root to point it to the entry of addonComponents map.
// e.x: path "Components.AddonComponents.K8S.ReplicaCount" and root "Spec" ->
Copy link
Contributor

Choose a reason for hiding this comment

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

very hard to follow this example, could you rewrite in terms of API inputs and outputs?

@istio-testing istio-testing merged commit 84423da into istio:master Mar 18, 2020
@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #22104 failed to apply on top of branch "release-1.5":

Using index info to reconstruct a base tree...
A	operator/cmd/mesh/testdata/manifest-generate/output/ingressgateway_k8s_settings.golden.yaml
M	operator/pkg/apis/istio/v1alpha1/values_types.proto
Falling back to patching base and 3-way merge...
Auto-merging operator/pkg/apis/istio/v1alpha1/values_types.proto
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/ingressgateway_k8s_settings.yaml
Applying: fix overlay for k8s
.git/rebase-apply/patch:14342: trailing whitespace.
    
.git/rebase-apply/patch:14350: trailing whitespace.
      
.git/rebase-apply/patch:14395: trailing whitespace.
    
.git/rebase-apply/patch:14402: trailing whitespace.
    
.git/rebase-apply/patch:14447: trailing whitespace.
    
warning: 5 lines add whitespace errors.
Using index info to reconstruct a base tree...
A	operator/cmd/mesh/testdata/manifest-generate/output/all_on.golden-show-in-gh-pull-request.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/component_hub_tag.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/flag_output_set_values.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/flag_set_values.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/gateways_override_default.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/helm_values_enablement.golden.yaml
A	operator/cmd/mesh/testdata/manifest-generate/output/prometheus.golden.yaml
M	operator/pkg/apis/istio/v1alpha1/v1alpha1.pb.html
M	operator/pkg/apis/istio/v1alpha1/values_types.pb.go
M	operator/pkg/apis/istio/v1alpha1/values_types.proto
A	operator/pkg/component/component.go
M	operator/pkg/translate/translate.go
M	operator/pkg/vfs/assets.gen.go
Falling back to patching base and 3-way merge...
Auto-merging operator/pkg/vfs/assets.gen.go
Auto-merging operator/pkg/translate/translate.go
Auto-merging operator/pkg/component/component/component.go
Auto-merging operator/pkg/apis/istio/v1alpha1/values_types.proto
Auto-merging operator/pkg/apis/istio/v1alpha1/values_types.pb.go
CONFLICT (content): Merge conflict in operator/pkg/apis/istio/v1alpha1/values_types.pb.go
Auto-merging operator/pkg/apis/istio/v1alpha1/v1alpha1.pb.html
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/prometheus.yaml
CONFLICT (content): Merge conflict in operator/cmd/mesh/testdata/manifest-generate/output/prometheus.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/helm_values_enablement.yaml
CONFLICT (content): Merge conflict in operator/cmd/mesh/testdata/manifest-generate/output/helm_values_enablement.yaml
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/gateways_override_default.yaml
CONFLICT (content): Merge conflict in operator/cmd/mesh/testdata/manifest-generate/output/gateways_override_default.yaml
CONFLICT (modify/delete): operator/cmd/mesh/testdata/manifest-generate/output/flag_set_values.golden.yaml deleted in HEAD and modified in fix overlay for k8s. Version fix overlay for k8s of operator/cmd/mesh/testdata/manifest-generate/output/flag_set_values.golden.yaml left in tree.
CONFLICT (modify/delete): operator/cmd/mesh/testdata/manifest-generate/output/flag_output_set_values.golden.yaml deleted in HEAD and modified in fix overlay for k8s. Version fix overlay for k8s of operator/cmd/mesh/testdata/manifest-generate/output/flag_output_set_values.golden.yaml left in tree.
CONFLICT (modify/delete): operator/cmd/mesh/testdata/manifest-generate/output/component_hub_tag.golden.yaml deleted in HEAD and modified in fix overlay for k8s. Version fix overlay for k8s of operator/cmd/mesh/testdata/manifest-generate/output/component_hub_tag.golden.yaml left in tree.
Auto-merging operator/cmd/mesh/testdata/manifest-generate/output/all_on.yaml
CONFLICT (content): Merge conflict in operator/cmd/mesh/testdata/manifest-generate/output/all_on.yaml
error: Failed to merge in the changes.
Patch failed at 0002 fix overlay for k8s

richardwxn added a commit to richardwxn/istio that referenced this pull request Mar 19, 2020
* add service to kiali charts

* fix overlay for k8s

* address comment

* address comment and rebase

* address comment
istio-testing pushed a commit that referenced this pull request Mar 19, 2020
* add service to kiali charts

* fix overlay for k8s

* address comment

* address comment and rebase

* address comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ServiceSpec is missing possibility to set annotations
5 participants