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

Plugin: passing labels to envoyfilter #162

Merged
merged 2 commits into from
Jul 17, 2022
Merged

Conversation

believening
Copy link
Contributor

@believening believening commented Jul 7, 2022

some scenarios require pass-through of resource metadata, especially for labels, which can be used to indicate that multiple instances of different types of resources belong to the same group.

this pr provide an environment variable interface SLIME_PASS_LBL_REG to configure the labels that need to be passed through, using the regular syntax of the golang standard library to match the labels.

example:

# deploy plugin by slime-boot
apiVersion: config.netease.com/v1alpha1
kind: SlimeBoot
metadata:
  name: plugin
  namespace: mesh-operator
spec:
  module:
    - name: plugin
      enable: true
  env:
    - name: SLIME_PASS_LBL_REG
      value: "^need-pass"
// ...

and create a envoyplugin with labels:

apiVersion: microservice.slime.io/v1alpha1
kind: EnvoyPlugin
metadata:
  labels:
    need-pass/a: "passA"
    need-pass/b: "passB"
    not-need-pass/c: "not_passC"
  name: test
spec:
// ...

then, a envoufilter would be created:

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  labels:
    need-pass/a: passA
    need-pass/b: passB
  name: test
// ...

@cywang1905 cywang1905 changed the title plugin: passing labels to envoyfilter Plugin: passing labels to envoyfilter Jul 12, 2022
Signed-off-by: believening <kang_417@yeah.net>
Signed-off-by: believening <kang_417@yeah.net>
@believening believening requested review from YonkaFang and removed request for YonkaFang July 14, 2022 14:03
@YonkaFang YonkaFang merged commit 08f3de6 into slime-io:master Jul 17, 2022
@believening believening deleted the pass branch July 21, 2022 06:28
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.

3 participants