Skip to content

Commit 8ecfc22

Browse files
authored
refactor:remove unuseful pb file definition (#160)
1 parent 8c40f28 commit 8ecfc22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+315
-42567
lines changed

cmd/polaris-controller/app/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ import (
2828
type ProxyMetadata struct {
2929
ServerAddress string `yaml:"serverAddress"`
3030
ClusterName string `yaml:"clusterName"`
31+
OpenDemand string `yaml:"openDemand"`
3132
CAAddress string `yaml:"caAddress"`
3233
}
3334

3435
// DefaultConfig controller 用到的配置
3536
type DefaultConfig struct {
36-
ProxyMetadata ProxyMetadata `yaml:"serviceSync"`
37+
ProxyMetadata ProxyMetadata `yaml:"proxyMetadata"`
3738
}
3839

3940
// SidecarInject sidecar 注入相关

cmd/polaris-controller/app/options/polaris.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ type ConfigSync struct {
5656
// polarisToKubernetes: 配置数据只能从 polaris 同步到 kubernetes
5757
// both: 配置数据能从 kubernetes 同步到 polaris, 也能从 polaris 同步到 kubernetes, 但是不会出现循环同步
5858
SyncDirection string `yaml:"syncDirection"`
59-
// ConflictMode 同步冲突策略
60-
ConflictMode string `yaml:"conflictMode"`
6159
// Enable 开启同步
6260
Enable bool `yaml:"enable"`
6361
// IgnoreNamespaces 忽略同步的命名空间,默认不忽略

deploy/kubernetes_v1.21/helm/templates/_params.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ Define the cmd envs for the bootstrap init container.
8989
value: 15010
9090
- name: CLUSTER_NAME
9191
value: {{ "{{" }}.ProxyConfig.ProxyMetadata.clusterName{{ "}}" }}
92+
- name: OPEN_DEMAND
93+
value: {{ "{{" }}.ProxyConfig.ProxyMetadata.opemDemand{{ "}}" }}
9294
{{- end -}}
9395

9496

deploy/kubernetes_v1.21/helm/templates/controller-configmap-mesh.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ data:
1717
- stdout
1818
errorOutputPaths:
1919
- stderr
20-
sync:
21-
rotateOutputPath: logs/polaris-sync.log
22-
errorRotateOutputPath: logs/polaris-sync-error.log
20+
synccm:
21+
rotateOutputPath: logs/polaris-synccm.log
22+
errorRotateOutputPath: logs/polaris-synccm-error.log
2323
rotationMaxSize: 100
2424
rotationMaxBackups: 10
2525
rotationMaxAge: 7
@@ -68,10 +68,20 @@ data:
6868
mode: "{{ .Values.sidecar.mesh }}"
6969
# service sync
7070
serviceSync:
71-
mode: "all"
71+
mode: {{ .Values.polaris.sync.service.mode }}
7272
serverAddress: {{ .Values.polaris.server.address }}
7373
# 北极星开启鉴权时需要配置
7474
accessToken: {{ .Values.polaris.server.token }}
75+
configSync:
76+
enable: {{ .Values.polaris.sync.config.enable }}
77+
serverAddress: {{ .Values.polaris.server.address }}
78+
# 北极星开启鉴权时需要配置
79+
accessToken: {{ .Values.polaris.server.token }}
80+
allowDelete: {{ .Values.polaris.sync.config.allowDelete }}
81+
# 配置同步方向: kubernetesToPolaris|polarisToKubernetes|both
82+
syncDirection: {{ .Values.polaris.sync.config.direction }}
83+
defaultGroup: {{ .Values.polaris.sync.config.groupName }}
7584
defaultConfig:
7685
proxyMetadata:
77-
serverAddress: {{ .Values.polaris.server.address }}
86+
serverAddress: {{ .Values.polaris.server.address }}
87+
clusterName: "{{ .Values.cluster.name }}"

deploy/kubernetes_v1.21/helm/templates/controller-statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ spec:
7676
- hostPath:
7777
path: /data/polaris-controller/log
7878
type: "DirectoryOrCreate"
79-
name: log
79+
name: logs

deploy/kubernetes_v1.21/helm/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ polaris:
3737
server:
3838
address: #POLARIS_HOST#
3939
token: #POLARIS_TOKEN#
40+
sync:
41+
service:
42+
mode: all
43+
config:
44+
enable: true
45+
direction: both
46+
groupName: default
47+
allowDelete: false
48+
4049

4150
## polaris controller config
4251
controller:

deploy/kubernetes_v1.21/kubernetes/configmap.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: ConfigMap
33
metadata:
4-
name: injector-mesh
4+
name: polaris-controller-config
55
namespace: polaris-system
66
data:
77
mesh: |-
@@ -17,9 +17,9 @@ data:
1717
- stdout
1818
errorOutputPaths:
1919
- stderr
20-
sync:
21-
rotateOutputPath: logs/polaris-sync.log
22-
errorRotateOutputPath: logs/polaris-sync-error.log
20+
synccm:
21+
rotateOutputPath: logs/polaris-synccm.log
22+
errorRotateOutputPath: logs/polaris-synccm-error.log
2323
rotationMaxSize: 100
2424
rotationMaxBackups: 10
2525
rotationMaxAge: 7
@@ -62,7 +62,7 @@ data:
6262
errorOutputPaths:
6363
- stderr
6464
# k8s cluster name
65-
clusterName: "default"
65+
clusterName: "#CLUSTER_NAME#"
6666
# polaris-sidecar 注入的默认启动模式, 可以配置 mesh 或者 dns
6767
sidecarInject:
6868
mode: "mesh"
@@ -78,6 +78,11 @@ data:
7878
serverAddress: #POLARIS_HOST#
7979
# 北极星开启鉴权时需要配置
8080
accessToken: #POLARIS_TOKEN#
81+
allowDelete: false
82+
# 配置同步方向: kubernetesToPolaris|polarisToKubernetes|both
83+
syncDirection: both
84+
defaultGroup: "#CLUSTER_NAME#"
8185
defaultConfig:
8286
proxyMetadata:
83-
serverAddress: #POLARIS_HOST#
87+
serverAddress: #POLARIS_HOST#
88+
clusterName: #CLUSTER_NAME#

deploy/kubernetes_v1.21/kubernetes/injector.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ data:
210210
value: 15010
211211
- name: CLUSTER_NAME
212212
value: {{.ProxyConfig.ProxyMetadata.clusterName}}
213+
- name: OPEN_DEMAND
214+
value: {{.ProxyConfig.ProxyMetadata.opemDemand}}
213215
volumeMounts:
214216
- mountPath: /var/lib/data
215217
name: envoy-bootstrap

deploy/kubernetes_v1.21/kubernetes/polaris-controller.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ spec:
7070
path: values
7171
- name: config-volume
7272
configMap:
73-
name: injector-mesh
73+
name: polaris-controller-config
7474
- hostPath:
7575
path: /data/polaris-controller/logs
7676
type: "DirectoryOrCreate"

deploy/kubernetes_v1.22/helm/templates/_params.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ Define the cmd envs for the bootstrap init container.
7777
value: 15010
7878
- name: CLUSTER_NAME
7979
value: {{ "{{" }}.ProxyConfig.ProxyMetadata.clusterName{{ "}}" }}
80+
- name: OPEN_DEMAND
81+
value: {{ "{{" }}.ProxyConfig.ProxyMetadata.opemDemand{{ "}}" }}
8082
{{- end -}}
8183

8284

deploy/kubernetes_v1.22/helm/templates/controller-configmap-mesh.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ data:
1717
- stdout
1818
errorOutputPaths:
1919
- stderr
20-
sync:
21-
rotateOutputPath: logs/polaris-sync.log
22-
errorRotateOutputPath: logs/polaris-sync-error.log
20+
synccm:
21+
rotateOutputPath: logs/polaris-synccm.log
22+
errorRotateOutputPath: logs/polaris-synccm-error.log
2323
rotationMaxSize: 100
2424
rotationMaxBackups: 10
2525
rotationMaxAge: 7
@@ -68,10 +68,20 @@ data:
6868
mode: "{{ .Values.sidecar.mesh }}"
6969
# service sync
7070
serviceSync:
71-
mode: "all"
71+
mode: {{ .Values.polaris.sync.service.mode }}
7272
serverAddress: {{ .Values.polaris.server.address }}
7373
# 北极星开启鉴权时需要配置
7474
accessToken: {{ .Values.polaris.server.token }}
75+
configSync:
76+
enable: {{ .Values.polaris.sync.config.enable }}
77+
serverAddress: {{ .Values.polaris.server.address }}
78+
# 北极星开启鉴权时需要配置
79+
accessToken: {{ .Values.polaris.server.token }}
80+
allowDelete: {{ .Values.polaris.sync.config.allowDelete }}
81+
# 配置同步方向: kubernetesToPolaris|polarisToKubernetes|both
82+
syncDirection: {{ .Values.polaris.sync.config.direction }}
83+
defaultGroup: {{ .Values.polaris.sync.config.groupName }}
7584
defaultConfig:
7685
proxyMetadata:
77-
serverAddress: {{ .Values.polaris.server.address }}
86+
serverAddress: {{ .Values.polaris.server.address }}
87+
clusterName: "{{ .Values.cluster.name }}"

deploy/kubernetes_v1.22/helm/templates/controller-statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ spec:
7676
- hostPath:
7777
path: /data/polaris-controller/log
7878
type: "DirectoryOrCreate"
79-
name: log
79+
name: logs

deploy/kubernetes_v1.22/helm/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ polaris:
3737
server:
3838
address: #POLARIS_HOST#
3939
token: #POLARIS_TOKEN#
40+
sync:
41+
service:
42+
mode: all
43+
config:
44+
enable: true
45+
direction: both
46+
groupName: default
47+
allowDelete: false
48+
4049

4150
## polaris controller config
4251
controller:

deploy/kubernetes_v1.22/kubernetes/configmap.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ data:
1717
- stdout
1818
errorOutputPaths:
1919
- stderr
20-
sync:
21-
rotateOutputPath: logs/polaris-sync.log
22-
errorRotateOutputPath: logs/polaris-sync-error.log
20+
synccm:
21+
rotateOutputPath: logs/polaris-synccm.log
22+
errorRotateOutputPath: logs/polaris-synccm-error.log
2323
rotationMaxSize: 100
2424
rotationMaxBackups: 10
2525
rotationMaxAge: 7
@@ -62,16 +62,27 @@ data:
6262
errorOutputPaths:
6363
- stderr
6464
# k8s cluster name
65-
clusterName: "default"
65+
clusterName: "#CLUSTER_NAME#"
6666
# polaris-sidecar 注入的默认启动模式, 可以配置 mesh 或者 dns
6767
sidecarInject:
6868
mode: "mesh"
6969
# service sync
7070
serviceSync:
71+
enable: true
7172
mode: "all"
7273
serverAddress: #POLARIS_HOST#
7374
# 北极星开启鉴权时需要配置
7475
accessToken: #POLARIS_TOKEN#
76+
configSync:
77+
enable: true
78+
serverAddress: #POLARIS_HOST#
79+
# 北极星开启鉴权时需要配置
80+
accessToken: #POLARIS_TOKEN#
81+
allowDelete: false
82+
# 配置同步方向: kubernetesToPolaris|polarisToKubernetes|both
83+
syncDirection: both
84+
defaultGroup: "#CLUSTER_NAME#"
7585
defaultConfig:
7686
proxyMetadata:
77-
serverAddress: #POLARIS_HOST#
87+
serverAddress: #POLARIS_HOST#
88+
clusterName: #CLUSTER_NAME#

deploy/kubernetes_v1.22/kubernetes/injector.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ data:
193193
value: 15010
194194
- name: CLUSTER_NAME
195195
value: {{.ProxyConfig.ProxyMetadata.clusterName}}
196+
- name: OPEN_DEMAND
197+
value: {{.ProxyConfig.ProxyMetadata.opemDemand}}
196198
volumeMounts:
197199
- mountPath: /var/lib/data
198200
name: envoy-bootstrap

deploy/kubernetes_v1.22/kubernetes/polaris-controller.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ spec:
130130
- hostPath:
131131
path: /data/polaris-controller/log
132132
type: "DirectoryOrCreate"
133-
name: log
133+
name: logs

deploy/variables.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
POLARIS_HOST:polaris.polaris-system
2-
CONTROLLER_VERSION:v1.7.0-beta
2+
CONTROLLER_VERSION:##VERSION##
33
SIDECAR_VERSION:v1.5.0
44
POLARIS_TOKEN:nu/0WRA4EqSR1FagrjRj0fZwPXuGlMpX+zCuWu4uMqy8xr1vRjisSbA25aAC3mtU8MeeRsKhQiDAynUR09I=
5-
ENVOY_VERSION:v1.26.2
5+
ENVOY_VERSION:v1.26.2
6+
CLUSTER_NAME:default

0 commit comments

Comments
 (0)