Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

components: Add istio-operator #686

Merged
merged 5 commits into from
Aug 31, 2020
Merged

Conversation

surajssd
Copy link
Member

@surajssd surajssd commented Jun 30, 2020

Fixes #687


Usage

Install using lokoctl component apply experimental-istio-operator:

Then to test it on an app, clone this repo and goto configs/bookinfo dir and run following commands:

kubectl create ns bookinfo
kubectl label namespace bookinfo istio-injection=enabled
helm install bookinfo --namespace bookinfo .

TODOs

Test:

  • See if the pod installs correctly.
  • Check the metrics collected are available in Prometheus.
  • Decide on docs.

Other:

  • How do we qualify this component as experimental? (Although this is not a blocker for this PR).
  • Are there any other configs to expose to the user?
  • Add istio dashboards if any.

@surajssd surajssd force-pushed the surajssd/add-istio-operator branch 4 times, most recently from 10f6ddd to b7a02d0 Compare June 30, 2020 14:00
@surajssd surajssd marked this pull request as ready for review June 30, 2020 14:00
@ipochi
Copy link
Member

ipochi commented Jun 30, 2020

docs are going in a separate PR ?

@surajssd surajssd force-pushed the surajssd/add-istio-operator branch from b7a02d0 to d2f67d0 Compare July 1, 2020 06:56
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

In general LGTM, except the comment. Also e2e tests needs to be added.

pkg/components/util/helm.go Outdated Show resolved Hide resolved
@surajssd
Copy link
Member Author

We have decided to name this component experimental-istio-operator.

@surajssd surajssd force-pushed the surajssd/add-istio-operator branch 2 times, most recently from 7eb6986 to 0b575ff Compare July 21, 2020 07:30
@surajssd surajssd requested a review from johananl as a code owner July 21, 2020 07:30
@surajssd surajssd force-pushed the surajssd/add-istio-operator branch from 0b575ff to 7804932 Compare July 21, 2020 07:38
@surajssd surajssd requested a review from invidian July 21, 2020 07:39
@surajssd
Copy link
Member Author

cc: @invidian @ipochi @iaguis PTAL.

@invidian
Copy link
Member

@surajssd do you mind rebasing before I review (to get rid of fixup commits)?

@surajssd surajssd force-pushed the surajssd/add-istio-operator branch from 3c1fa21 to 0ff1ff5 Compare July 22, 2020 07:51
@surajssd
Copy link
Member Author

@invidian done :-)

@surajssd
Copy link
Member Author

@invidian PTAL.

Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

Overall things looks OK to me, however, I would re-organize and improve commit messages, as there is a lot of things going in regards to how we manage the namespaces for the components, which seems like something, which should be definitely described with the reasoning behind. It could even be done in separate pull request to simplify and separate the review comments.

@surajssd can we move changes related to Helm and other components into separate PR, as they are not related to istio-operator (though I'm aware that this PR, so istio-operator depends on those changes).

pkg/components/util/helm.go Outdated Show resolved Hide resolved
assets/components/istio-operator/Chart.yaml Outdated Show resolved Hide resolved
pkg/components/istio-operator/manifest.go Outdated Show resolved Hide resolved
ci/aks/aks-cluster.lokocfg.envsubst Show resolved Hide resolved

Table of all the arguments accepted by the component.

Example:
Copy link
Member

Choose a reason for hiding this comment

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

What does this Example mean here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. I am not sure what they mean. It is a remnant of the copy-paste of the skeleton from other components.

docs/configuration-reference/components/istio-operator.md Outdated Show resolved Hide resolved
@surajssd surajssd force-pushed the surajssd/add-istio-operator branch from 0ff1ff5 to 5363720 Compare July 22, 2020 17:06
@surajssd
Copy link
Member Author

Overall things looks OK to me, however, I would re-organize and improve commit messages, as there is a lot of things going in regards to how we manage the namespaces for the components, which seems like something, which should be definitely described with the reasoning behind. It could even be done in separate pull request to simplify and separate the review comments.

I think I can elaborate on the commits but creating a new PR will only prolong this work.

ipochi
ipochi previously requested changes Jul 23, 2020
Copy link
Member

@ipochi ipochi left a comment

Choose a reason for hiding this comment

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

Lovely work @surajssd 🎉

Generally LGTM.

Please take a look into creating a separate PR for allowing helm to create release namespace.

assets/components/istio-operator/Chart.yaml Outdated Show resolved Hide resolved
pkg/components/istio-operator/manifest.go Outdated Show resolved Hide resolved
pkg/components/util/helm.go Outdated Show resolved Hide resolved
docs/configuration-reference/components/istio-operator.md Outdated Show resolved Hide resolved
@ipochi
Copy link
Member

ipochi commented Jul 24, 2020

@surajssd On second thoughts, its better not use the helm feature install.CreateNamespace = true

All it does is create a namespace object on the fly and seeing that we have a use case where we patch the namespace with labels, it becomes a two step operation.

I would rather use the existing code to create/update the release namespace and not depend on helm for it.

@surajssd
Copy link
Member Author

@ipochi @invidian this is open for review again PTAL.

@invidian
Copy link
Member

https://yard.lokomotive-k8s.net/builds/26675

TestAllNamespacesHaveNameLabels: namespaces_labels_test.go:50: expected "istio-system", got: ""

Ugh, it seems the test needs to be modified...

Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

Just some nits, otherwise LGTM. The only missing bit is, that either the e2e test needs to be modified or we need to add a lokomotive name label to the istio namespace (the latter is definitely easier).

pkg/components/istio-operator/component.go Outdated Show resolved Hide resolved
test/monitoring/components_metrics_test.go Show resolved Hide resolved
@surajssd surajssd force-pushed the surajssd/add-istio-operator branch 5 times, most recently from 7e971a2 to 616e444 Compare August 24, 2020 14:54
@surajssd surajssd requested a review from invidian August 25, 2020 10:31
invidian
invidian previously approved these changes Aug 25, 2020
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

LGTM

test/components/kubernetes/namespaces_labels_test.go Outdated Show resolved Hide resolved
@surajssd surajssd force-pushed the surajssd/add-istio-operator branch 3 times, most recently from a7ba6c6 to 6763446 Compare August 27, 2020 07:05
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Adds ServiceMonitor configs for the control plane and istio-proxy
sidecars which is toggled by a variable `enable_monitoring`.

Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
- Adds e2e test to verify if pods are up and running.
- Adds test to verify if the metrics are scraped.

Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@knrt10 knrt10 left a comment

Choose a reason for hiding this comment

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

Nice, another component. Great work @surajssd

@knrt10 knrt10 dismissed ipochi’s stale review August 28, 2020 07:21

Re requesting review

@surajssd
Copy link
Member Author

surajssd commented Aug 28, 2020

Something is wrong with the istio release bundle, which is downloaded from https://github.com/istio/istio/releases/tag/1.7.0 :

$ ll
drwxr-x---@   - surajd 22 Aug  0:30 istio-1.7.0/
.rw-rw-r--@ 47M surajd 22 Aug  6:30 istio-1.7.0-linux-amd64.tar.gz

The image tag is latest ?

$ cat istio-1.7.0/manifests/charts/istio-operator/values.yaml 
hub: gcr.io/istio-testing
tag: latest

operatorNamespace: istio-operator

# Used to replace istioNamespace to support operator watch multiple namespaces.
watchedNamespaces: istio-system
waitForResourcesTimeout: 300s

# Used for helm2 to add the CRDs to templates.
enableCRDTemplates: false

# revision for the operator resources
revision: ""

# Operator resource defaults
operator:
  resources:
    limits:
      cpu: 200m
      memory: 256Mi
    requests:
      cpu: 50m
      memory: 128Mi

@invidian
Copy link
Member

invidian commented Aug 31, 2020

The image tag is latest ?

@surajssd this is for the operator image, but yeah, it's weird that they don't pin the version. Using "testing" image registry is weird too (gcr.io/istio-testing) 😄

I'll open an upstream issue about it, but I don't think this should block merging this PR.

EDIT: Created istio/istio#26920.

@sdake
Copy link

sdake commented Oct 16, 2020

@invidian looks like an interesting project. Please note in the pending Istio 1.8, there is a make target that generates a proper manifest using helm template for the operator:

make gen-kustomize : https://github.com/istio/istio/blob/master/Makefile.core.mk#L364-L365

The pending 1.8 manifest is in a lot better shape than what was shipped in Istio 1.6 👍 Although what you have should be fine.

Thanks for adopting Istio in your project and reporting the pinning defect.

Cheers,
-steve

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add istio component
5 participants