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

change global-sidecar and global-sidecar-pilot template file #91

Merged
merged 1 commit into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions doc/en/lazy_load.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ spec:
limits:
cpu: 200m
memory: 200Mi
image:
repository: {{your_sidecar_repo}}
tag: {{your_sidecar_tag}}
pilot:
enable: true
resources:
Expand All @@ -75,7 +78,7 @@ spec:
cpu: 200m
memory: 200Mi
image:
repository: docker.io/slimeio/pilot
repository: {{your_pilot_repo}}
tag: {{your_pilot_tag}}
```

Expand Down Expand Up @@ -228,10 +231,13 @@ spec:
globalSidecar:
enable: true
type: cluster
image:
repository: {{your_sidecar_repo}}
tag: {{your_sidecar_tag}}
pilot:
enable: true
image:
repository: docker.io/slimeio/pilot
repository: {{your_pilot_repo}}
tag: {{your_pilot_tag}}
```

Expand Down
11 changes: 7 additions & 4 deletions doc/en/slime-boot.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ apiVersion: config.netease.com/v1alpha1
kind: SlimeBoot
metadata:
name: lazyload
namespace: slime #customize the namespace deployed slime
namespace: slime #customize the namespace deployed slime
spec:
namespace: slime #customize the namespace deployed slime, same with config.global.slimeNamespace
istioNamespace: istio-operator #customize the namespace deployed istio, same with config.global.istioNamespace
istioNamespace: istio-system #customize the namespace deployed istio, same with config.global.istioNamespace
healthProbePort: 9091 #same with the port contained by config.global.misc["aux-addr"]
image:
pullPolicy: Always
Expand All @@ -143,8 +143,8 @@ spec:
wormholePort:
- "9080"
global:
slimeNamespace: slime #customize the slime deployed namespace filled in sidecar, same with spec.namespace
istioNamespace: istio-operator #customize the istio deployed namespace filled in sidecar, same with spec.istioNamespace
slimeNamespace: slime #customize the slime deployed namespace filled in sidecar, same with spec.namespace
istioNamespace: istio-system #customize the istio deployed namespace filled in sidecar, same with spec.istioNamespace
log: #customize log level
logLevel: debug
klogLevel: 10
Expand Down Expand Up @@ -172,6 +172,9 @@ spec:
limits:
cpu: 200m
memory: 200Mi
image:
repository: istio/proxyv2
tag: 1.7.0
pilot:
enable: true
resources: #customize resources
Expand Down
12 changes: 9 additions & 3 deletions doc/zh/lazy_load.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ spec:
limits:
cpu: 200m
memory: 200Mi
image:
repository: {{your_sidecar_repo}}
tag: {{your_sidecar_tag}}
pilot:
enable: true
resources:
Expand All @@ -76,7 +79,7 @@ spec:
cpu: 200m
memory: 200Mi
image:
repository: docker.io/slimeio/pilot
repository: {{your_pilot_repo}}
tag: {{your_pilot_tag}}
```

Expand Down Expand Up @@ -231,10 +234,13 @@ spec:
globalSidecar:
enable: true
type: cluster
image:
repository: {{your_sidecar_repo}}
tag: {{your_sidecar_tag}}
pilot:
enable: true
image:
repository: docker.io/slimeio/pilot
repository: {{your_pilot_repo}}
tag: {{your_pilot_tag}}
```

Expand Down Expand Up @@ -319,7 +325,7 @@ metadata:

lazyload/fence默认会将envoy无法匹配路由(缺省)的流量兜底发送到global sidecar,应对短暂服务数据缺失的问题,这是“懒加载”所必然面对的。 该方案因为技术细节上的局限性,对于目标(如域名)是集群外的流量,无法正常处理,详见 [[Configuration Lazy Loading]: Failed to access external service #3](https://github.com/slime-io/slime/issues/3)。

基于这个背景,设计了本特性,同时也能用于更灵活的业务场景。 大致思路是通过域名匹配的方式讲不同的缺省流量分派到不同的目标做正确处理
基于这个背景,设计了本特性,同时也能用于更灵活的业务场景。 大致思路是通过域名匹配的方式将不同的缺省流量分派到不同的目标做正确处理



Expand Down
7 changes: 5 additions & 2 deletions doc/zh/slime-boot.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ metadata:
namespace: slime
spec:
namespace: slime #自定义slime部署的namespace,和config.global.slimeNamespace一致
istioNamespace: istio-operator #自定义istio部署的namespace,和config.global.istioNamespace一致
istioNamespace: istio-system #自定义istio部署的namespace,和config.global.istioNamespace一致
healthProbePort: 9091 #和config.global.misc["aux-addr"]包含的端口值一致
image:
pullPolicy: Always
Expand All @@ -143,7 +143,7 @@ spec:
- "9080"
global:
slimeNamespace: slime #自定义sidecar默认配置中部署slime的namespace,与spec.namespace保持一致
istioNamespace: istio-operator #自定义sidecar默认配置中部署istio的namespace,与spec.istioNamespace保持一致
istioNamespace: istio-system #自定义sidecar默认配置中部署istio的namespace,与spec.istioNamespace保持一致
log: #自定义log级别
logLevel: debug
klogLevel: 10
Expand Down Expand Up @@ -171,6 +171,9 @@ spec:
limits:
cpu: 200m
memory: 200Mi
image:
repository: istio/proxyv2
tag: 1.7.0
pilot:
enable: true
resources: #自定义resources
Expand Down
3 changes: 3 additions & 0 deletions install/samples/lazyload/slimeboot_lazyload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ spec:
limits:
cpu: 200m
memory: 200Mi
image:
repository: istio/proxyv2
tag: 1.7.0
pilot:
enable: true
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ spec:
globalSidecar:
enable: true
type: cluster
image:
repository: istio/proxyv2
tag: 1.7.0
pilot:
enable: true
image:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ spec:
nsf.skiff.netease.com/app: qz-ingress
nsf.skiff.netease.com/isIngress: "true"
spec:
{{- with $.Values.component.globalSidecar.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -126,7 +130,11 @@ spec:
value: NONE
- name: ISTIO_METAJSON_ANNOTATIONS
value: '{"sidecar.istio.io/statsInclusionPrefixes": "listener,cluster.outbound,cluster_manager,listener_manager,http_mixer_filter,tcp_mixer_filter,server,cluster.xds-grpc"}'
image: istio/proxyv2:1.7.0
{{- if $.Values.component.globalSidecar.image.tag }}
image: "{{ $.Values.component.globalSidecar.image.repository }}:{{ $.Values.component.globalSidecar.image.tag}}"
{{- else }}
image: "{{ $.Values.component.globalSidecar.image.repository }}"
{{- end }}
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ spec:
nsf.skiff.netease.com/app: qz-ingress
nsf.skiff.netease.com/isIngress: "true"
spec:
{{- with $.Values.component.globalSidecar.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -127,7 +131,11 @@ spec:
value: NONE
- name: ISTIO_METAJSON_ANNOTATIONS
value: '{"sidecar.istio.io/statsInclusionPrefixes": "listener,cluster.outbound,cluster_manager,listener_manager,http_mixer_filter,tcp_mixer_filter,server,cluster.xds-grpc"}'
image: istio/proxyv2:1.7.0
{{- if $.Values.component.globalSidecar.image.tag }}
image: "{{ $.Values.component.globalSidecar.image.repository }}:{{ $.Values.component.globalSidecar.image.tag}}"
{{- else }}
image: "{{ $.Values.component.globalSidecar.image.repository }}"
{{- end }}
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
Expand Down
4 changes: 4 additions & 0 deletions slime-boot/helm-charts/slimeboot/templates/pilot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ spec:
app: pilot
istio: pilot
spec:
{{- with $.Values.component.pilot.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down
33 changes: 24 additions & 9 deletions slime-modules/lazyload/test/e2e/lazyload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"os"
"path/filepath"
commonutils "slime.io/slime/slime-framework/test/e2e/common"
"slime.io/slime/slime-framework/test/e2e/framework"
e2epod "slime.io/slime/slime-framework/test/e2e/framework/pod"
"slime.io/slime/slime-framework/test/e2e/framework/testfiles"
Expand All @@ -15,13 +15,17 @@ import (
)

var (
testResourceToDelete []*TestResource
nsSlime = "mesh-operator"
nsApps = "example-apps"
test = "test/e2e/testdata/install"
slimebootName = "slime-boot"
istiodLabelKey = "istio.io/rev"
istiodLabelV = "1-10-2"
testResourceToDelete []*TestResource
nsSlime = "mesh-operator"
nsApps = "example-apps"
test = "test/e2e/testdata/install"
slimebootName = "slime-boot"
istiodLabelKey = "istio.io/rev"
istiodLabelV = "1-10-2"
slimebootTag = "v0.2.3-a3f72fe"
lazyloadTag = "v0.2.6-d808438"
globalSidecarTag = "1.7.0"
globalSidecarPilotTag = "globalPilot-7.0-v0.0.3-833f1bd5c1"
)

type TestResource struct {
Expand Down Expand Up @@ -65,6 +69,7 @@ func createSlimeBoot(f *framework.Framework) {
testResourceToDelete = append(testResourceToDelete, &TestResource{Namespace: "", Contents: crdYaml})
}()
deploySlimeBootYaml := readFile(test, "init/deployment_slime-boot.yaml")
deploySlimeBootYaml = strings.ReplaceAll(deploySlimeBootYaml, "{{slimebootTag}}", substituteValue("slimeBootTag", slimebootTag))
framework.RunKubectlOrDieInput(nsSlime, deploySlimeBootYaml, "create", "-f", "-")
defer func() {
testResourceToDelete = append(testResourceToDelete, &TestResource{Namespace: nsSlime, Contents: deploySlimeBootYaml})
Expand Down Expand Up @@ -99,6 +104,9 @@ func createSlimeModuleLazyload(f *framework.Framework) {

// create slimeboot/lazyload
slimebootLazyloadYaml := readFile(test, "samples/lazyload/slimeboot_lazyload.yaml")
slimebootLazyloadYaml = strings.ReplaceAll(slimebootLazyloadYaml, "{{lazyloadTag}}", substituteValue("lazyloadTag", lazyloadTag))
slimebootLazyloadYaml = strings.ReplaceAll(slimebootLazyloadYaml, "{{globalSidecarTag}}", substituteValue("globalSidecarTag", globalSidecarTag))
slimebootLazyloadYaml = strings.ReplaceAll(slimebootLazyloadYaml, "{{globalSidecarPilotTag}}", substituteValue("globalSidecarPilotTag", globalSidecarPilotTag))
framework.RunKubectlOrDieInput(nsSlime, slimebootLazyloadYaml, "create", "-f", "-")
defer func() {
testResourceToDelete = append(testResourceToDelete, &TestResource{Namespace: nsSlime, Contents: slimebootLazyloadYaml})
Expand Down Expand Up @@ -332,13 +340,20 @@ func verifyAccessLogs(f *framework.Framework) {
ginkgo.By("access log verified successfully")
}

func substituteValue(value, defaultValue string) string {
if os.Getenv(value) != "" {
return os.Getenv(value)
}
return defaultValue
}

func readFile(test, file string) string {
from := filepath.Join(test, file)
data, err := testfiles.Read(from)
if err != nil {
framework.ExpectNoError(err, "failed to read file %s/%s", test, file)
}
return commonutils.SubstituteImageName(string(data))
return string(data)
}

func deleteTestResource() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
containers:
- name: slime-boot
# Replace this with the built image name
image: docker.io/slimeio/slime-boot:v0.2.2
image: docker.io/slimeio/slime-boot:{{slimebootTag}}
imagePullPolicy: Always
env:
- name: WATCH_NAMESPACE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
image:
pullPolicy: Always
repository: docker.io/slimeio/slime-lazyload
tag: v0.2.2
tag: {{lazyloadTag}}
module:
- name: lazyload
enable: true
Expand All @@ -34,17 +34,20 @@ spec:
cpu: 200m
memory: 200Mi
limits:
cpu: 200m
cpu: 400m
memory: 200Mi
image:
repository: istio/proxyv2
tag: {{globalSidecarTag}}
pilot:
enable: true
resources:
requests:
cpu: 200m
memory: 200Mi
limits:
cpu: 200m
memory: 200Mi
cpu: 400m
memory: 800Mi
image:
repository: docker.io/slimeio/pilot
tag: globalPilot-7.0-v0.0.3-833f1bd5c1
tag: {{globalSidecarPilotTag}}