Skip to content

Commit

Permalink
refactor:remove unuseful pb file definition (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun authored Jan 5, 2024
1 parent 8c40f28 commit 8ecfc22
Show file tree
Hide file tree
Showing 48 changed files with 315 additions and 42,567 deletions.
3 changes: 2 additions & 1 deletion cmd/polaris-controller/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ import (
type ProxyMetadata struct {
ServerAddress string `yaml:"serverAddress"`
ClusterName string `yaml:"clusterName"`
OpenDemand string `yaml:"openDemand"`
CAAddress string `yaml:"caAddress"`
}

// DefaultConfig controller 用到的配置
type DefaultConfig struct {
ProxyMetadata ProxyMetadata `yaml:"serviceSync"`
ProxyMetadata ProxyMetadata `yaml:"proxyMetadata"`
}

// SidecarInject sidecar 注入相关
Expand Down
2 changes: 0 additions & 2 deletions cmd/polaris-controller/app/options/polaris.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ type ConfigSync struct {
// polarisToKubernetes: 配置数据只能从 polaris 同步到 kubernetes
// both: 配置数据能从 kubernetes 同步到 polaris, 也能从 polaris 同步到 kubernetes, 但是不会出现循环同步
SyncDirection string `yaml:"syncDirection"`
// ConflictMode 同步冲突策略
ConflictMode string `yaml:"conflictMode"`
// Enable 开启同步
Enable bool `yaml:"enable"`
// IgnoreNamespaces 忽略同步的命名空间,默认不忽略
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes_v1.21/helm/templates/_params.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Define the cmd envs for the bootstrap init container.
value: 15010
- name: CLUSTER_NAME
value: {{ "{{" }}.ProxyConfig.ProxyMetadata.clusterName{{ "}}" }}
- name: OPEN_DEMAND
value: {{ "{{" }}.ProxyConfig.ProxyMetadata.opemDemand{{ "}}" }}
{{- end -}}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ data:
- stdout
errorOutputPaths:
- stderr
sync:
rotateOutputPath: logs/polaris-sync.log
errorRotateOutputPath: logs/polaris-sync-error.log
synccm:
rotateOutputPath: logs/polaris-synccm.log
errorRotateOutputPath: logs/polaris-synccm-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
Expand Down Expand Up @@ -68,10 +68,20 @@ data:
mode: "{{ .Values.sidecar.mesh }}"
# service sync
serviceSync:
mode: "all"
mode: {{ .Values.polaris.sync.service.mode }}
serverAddress: {{ .Values.polaris.server.address }}
# 北极星开启鉴权时需要配置
accessToken: {{ .Values.polaris.server.token }}
configSync:
enable: {{ .Values.polaris.sync.config.enable }}
serverAddress: {{ .Values.polaris.server.address }}
# 北极星开启鉴权时需要配置
accessToken: {{ .Values.polaris.server.token }}
allowDelete: {{ .Values.polaris.sync.config.allowDelete }}
# 配置同步方向: kubernetesToPolaris|polarisToKubernetes|both
syncDirection: {{ .Values.polaris.sync.config.direction }}
defaultGroup: {{ .Values.polaris.sync.config.groupName }}
defaultConfig:
proxyMetadata:
serverAddress: {{ .Values.polaris.server.address }}
serverAddress: {{ .Values.polaris.server.address }}
clusterName: "{{ .Values.cluster.name }}"
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ spec:
- hostPath:
path: /data/polaris-controller/log
type: "DirectoryOrCreate"
name: log
name: logs
9 changes: 9 additions & 0 deletions deploy/kubernetes_v1.21/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ polaris:
server:
address: #POLARIS_HOST#
token: #POLARIS_TOKEN#
sync:
service:
mode: all
config:
enable: true
direction: both
groupName: default
allowDelete: false


## polaris controller config
controller:
Expand Down
17 changes: 11 additions & 6 deletions deploy/kubernetes_v1.21/kubernetes/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: injector-mesh
name: polaris-controller-config
namespace: polaris-system
data:
mesh: |-
Expand All @@ -17,9 +17,9 @@ data:
- stdout
errorOutputPaths:
- stderr
sync:
rotateOutputPath: logs/polaris-sync.log
errorRotateOutputPath: logs/polaris-sync-error.log
synccm:
rotateOutputPath: logs/polaris-synccm.log
errorRotateOutputPath: logs/polaris-synccm-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
Expand Down Expand Up @@ -62,7 +62,7 @@ data:
errorOutputPaths:
- stderr
# k8s cluster name
clusterName: "default"
clusterName: "#CLUSTER_NAME#"
# polaris-sidecar 注入的默认启动模式, 可以配置 mesh 或者 dns
sidecarInject:
mode: "mesh"
Expand All @@ -78,6 +78,11 @@ data:
serverAddress: #POLARIS_HOST#
# 北极星开启鉴权时需要配置
accessToken: #POLARIS_TOKEN#
allowDelete: false
# 配置同步方向: kubernetesToPolaris|polarisToKubernetes|both
syncDirection: both
defaultGroup: "#CLUSTER_NAME#"
defaultConfig:
proxyMetadata:
serverAddress: #POLARIS_HOST#
serverAddress: #POLARIS_HOST#
clusterName: #CLUSTER_NAME#
2 changes: 2 additions & 0 deletions deploy/kubernetes_v1.21/kubernetes/injector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ data:
value: 15010
- name: CLUSTER_NAME
value: {{.ProxyConfig.ProxyMetadata.clusterName}}
- name: OPEN_DEMAND
value: {{.ProxyConfig.ProxyMetadata.opemDemand}}
volumeMounts:
- mountPath: /var/lib/data
name: envoy-bootstrap
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes_v1.21/kubernetes/polaris-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ spec:
path: values
- name: config-volume
configMap:
name: injector-mesh
name: polaris-controller-config
- hostPath:
path: /data/polaris-controller/logs
type: "DirectoryOrCreate"
Expand Down
2 changes: 2 additions & 0 deletions deploy/kubernetes_v1.22/helm/templates/_params.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Define the cmd envs for the bootstrap init container.
value: 15010
- name: CLUSTER_NAME
value: {{ "{{" }}.ProxyConfig.ProxyMetadata.clusterName{{ "}}" }}
- name: OPEN_DEMAND
value: {{ "{{" }}.ProxyConfig.ProxyMetadata.opemDemand{{ "}}" }}
{{- end -}}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ data:
- stdout
errorOutputPaths:
- stderr
sync:
rotateOutputPath: logs/polaris-sync.log
errorRotateOutputPath: logs/polaris-sync-error.log
synccm:
rotateOutputPath: logs/polaris-synccm.log
errorRotateOutputPath: logs/polaris-synccm-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
Expand Down Expand Up @@ -68,10 +68,20 @@ data:
mode: "{{ .Values.sidecar.mesh }}"
# service sync
serviceSync:
mode: "all"
mode: {{ .Values.polaris.sync.service.mode }}
serverAddress: {{ .Values.polaris.server.address }}
# 北极星开启鉴权时需要配置
accessToken: {{ .Values.polaris.server.token }}
configSync:
enable: {{ .Values.polaris.sync.config.enable }}
serverAddress: {{ .Values.polaris.server.address }}
# 北极星开启鉴权时需要配置
accessToken: {{ .Values.polaris.server.token }}
allowDelete: {{ .Values.polaris.sync.config.allowDelete }}
# 配置同步方向: kubernetesToPolaris|polarisToKubernetes|both
syncDirection: {{ .Values.polaris.sync.config.direction }}
defaultGroup: {{ .Values.polaris.sync.config.groupName }}
defaultConfig:
proxyMetadata:
serverAddress: {{ .Values.polaris.server.address }}
serverAddress: {{ .Values.polaris.server.address }}
clusterName: "{{ .Values.cluster.name }}"
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ spec:
- hostPath:
path: /data/polaris-controller/log
type: "DirectoryOrCreate"
name: log
name: logs
9 changes: 9 additions & 0 deletions deploy/kubernetes_v1.22/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ polaris:
server:
address: #POLARIS_HOST#
token: #POLARIS_TOKEN#
sync:
service:
mode: all
config:
enable: true
direction: both
groupName: default
allowDelete: false


## polaris controller config
controller:
Expand Down
21 changes: 16 additions & 5 deletions deploy/kubernetes_v1.22/kubernetes/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ data:
- stdout
errorOutputPaths:
- stderr
sync:
rotateOutputPath: logs/polaris-sync.log
errorRotateOutputPath: logs/polaris-sync-error.log
synccm:
rotateOutputPath: logs/polaris-synccm.log
errorRotateOutputPath: logs/polaris-synccm-error.log
rotationMaxSize: 100
rotationMaxBackups: 10
rotationMaxAge: 7
Expand Down Expand Up @@ -62,16 +62,27 @@ data:
errorOutputPaths:
- stderr
# k8s cluster name
clusterName: "default"
clusterName: "#CLUSTER_NAME#"
# polaris-sidecar 注入的默认启动模式, 可以配置 mesh 或者 dns
sidecarInject:
mode: "mesh"
# service sync
serviceSync:
enable: true
mode: "all"
serverAddress: #POLARIS_HOST#
# 北极星开启鉴权时需要配置
accessToken: #POLARIS_TOKEN#
configSync:
enable: true
serverAddress: #POLARIS_HOST#
# 北极星开启鉴权时需要配置
accessToken: #POLARIS_TOKEN#
allowDelete: false
# 配置同步方向: kubernetesToPolaris|polarisToKubernetes|both
syncDirection: both
defaultGroup: "#CLUSTER_NAME#"
defaultConfig:
proxyMetadata:
serverAddress: #POLARIS_HOST#
serverAddress: #POLARIS_HOST#
clusterName: #CLUSTER_NAME#
2 changes: 2 additions & 0 deletions deploy/kubernetes_v1.22/kubernetes/injector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ data:
value: 15010
- name: CLUSTER_NAME
value: {{.ProxyConfig.ProxyMetadata.clusterName}}
- name: OPEN_DEMAND
value: {{.ProxyConfig.ProxyMetadata.opemDemand}}
volumeMounts:
- mountPath: /var/lib/data
name: envoy-bootstrap
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes_v1.22/kubernetes/polaris-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ spec:
- hostPath:
path: /data/polaris-controller/log
type: "DirectoryOrCreate"
name: log
name: logs
5 changes: 3 additions & 2 deletions deploy/variables.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
POLARIS_HOST:polaris.polaris-system
CONTROLLER_VERSION:v1.7.0-beta
CONTROLLER_VERSION:##VERSION##
SIDECAR_VERSION:v1.5.0
POLARIS_TOKEN:nu/0WRA4EqSR1FagrjRj0fZwPXuGlMpX+zCuWu4uMqy8xr1vRjisSbA25aAC3mtU8MeeRsKhQiDAynUR09I=
ENVOY_VERSION:v1.26.2
ENVOY_VERSION:v1.26.2
CLUSTER_NAME:default
Loading

0 comments on commit 8ecfc22

Please sign in to comment.