Skip to content

Commit e4f874e

Browse files
committed
k8s: update crd and it's example plus version updated
1 parent 57778fa commit e4f874e

20 files changed

+134
-63
lines changed

README.md

+63-8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<div align="center">
66

77
[![Go Report Card](https://goreportcard.com/badge/github.com/singchia/frontier)](https://goreportcard.com/report/github.com/singchia/frontier)
8+
[![Go Reference](https://pkg.go.dev/badge/badge/github.com/singchia/frontier.svg)](https://pkg.go.dev/github.com/singchia/frontier/api/dataplane/v1/service)
89
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
910

1011
</div>
@@ -888,7 +889,7 @@ exchange:
888889
### docker
889890
890891
```
891-
docker run -d --name frontier -p 30011:30011 -p 30012:30012 singchia/frontier:1.0.0
892+
docker run -d --name frontier -p 30011:30011 -p 30012:30012 singchia/frontier:1.1.0
892893
```
893894

894895

@@ -910,6 +911,12 @@ cd dist/helm
910911
helm install frontier ./ -f values.yaml
911912
```
912913

914+
你的微服务应该连接`service/frontier-servicebound-svc:40011`,你的边缘节点可以连接`:30012`所在的NodePort。
915+
916+
### operator
917+
918+
见下面集群部署章节
919+
913920
## 集群
914921

915922
### Frontier + Frontlas架构
@@ -1039,11 +1046,23 @@ service ClusterService {
10391046

10401047
```
10411048
git clone https://github.com/singchia/frontier.git
1042-
cd pkg/operator
1043-
make install && make deploy
1049+
cd dist/crd
1050+
kubectl apply -f install.yaml
1051+
```
1052+
1053+
查看CRD:
1054+
1055+
```
1056+
kubectl get crd frontierclusters.frontier.singchia.io
1057+
```
1058+
1059+
查看Operator:
1060+
1061+
```
1062+
kubectl get all -n frontier-system
10441063
```
10451064

1046-
**CR**
1065+
**FrontierCluster集群**
10471066

10481067
```yaml
10491068
apiVersion: frontier.singchia.io/v1alpha1
@@ -1056,7 +1075,7 @@ metadata:
10561075
spec:
10571076
frontier:
10581077
# 单实例Frontier
1059-
replicas: 1
1078+
replicas: 2
10601079
# 微服务侧端口
10611080
servicebound:
10621081
port: 30011
@@ -1069,17 +1088,49 @@ spec:
10691088
# 控制面端口
10701089
controlplane:
10711090
port: 40011
1072-
# 依赖的Redis配置
10731091
redis:
1092+
# 依赖的Redis配置
10741093
addrs:
10751094
- rfs-redisfailover:26379
10761095
password: your-password
10771096
masterName: mymaster
10781097
redisType: sentinel
10791098
```
10801099
1081-
1分钟,你即可拥有一个Frontier+Frontlas的集群
1100+
1分钟,你即可拥有一个2实例Frontier+1实例Frontlas的集群
10821101
1102+
通过一下来检查资源部署情况
1103+
1104+
> kubectl get all -l app=frontiercluster-frontier
1105+
> kubectl get all -l app=frontiercluster-frontlas
1106+
1107+
1108+
```
1109+
NAME READY STATUS RESTARTS AGE
1110+
pod/frontiercluster-frontier-57d565c89-dn6n8 1/1 Running 0 7m22s
1111+
pod/frontiercluster-frontier-57d565c89-nmwmt 1/1 Running 0 7m22s
1112+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
1113+
service/frontiercluster-edgebound-svc NodePort 10.233.23.174 <none> 30012:30012/TCP 8m7s
1114+
service/frontiercluster-servicebound-svc ClusterIP 10.233.29.156 <none> 30011/TCP 8m7s
1115+
NAME READY UP-TO-DATE AVAILABLE AGE
1116+
deployment.apps/frontiercluster-frontier 2/2 2 2 7m22s
1117+
NAME DESIRED CURRENT READY AGE
1118+
replicaset.apps/frontiercluster-frontier-57d565c89 2 2 2 7m22s
1119+
```
1120+
1121+
```
1122+
kubectl get all -l app=frontiercluster-frontlas
1123+
NAME READY STATUS RESTARTS AGE
1124+
pod/frontiercluster-frontlas-85c4fb6d9b-5clkh 1/1 Running 0 8m11s
1125+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
1126+
service/frontiercluster-frontlas-svc ClusterIP 10.233.0.23 <none> 40011/TCP,40012/TCP 8m11s
1127+
NAME READY UP-TO-DATE AVAILABLE AGE
1128+
deployment.apps/frontiercluster-frontlas 1/1 1 1 8m11s
1129+
NAME DESIRED CURRENT READY AGE
1130+
replicaset.apps/frontiercluster-frontlas-85c4fb6d9b 1 1 1 8m11s
1131+
```
1132+
1133+
你的微服务应该连接`service/frontiercluster-frontlas-svc:40011`,你的边缘节点可以连接`:30012`所在的NodePort。
10831134

10841135
## 开发
10851136

@@ -1107,4 +1158,8 @@ spec:
11071158

11081159
## 许可证
11091160

1110-
Released under the [Apache License 2.0](https://github.com/singchia/geminio/blob/main/LICENSE)
1161+
Released under the [Apache License 2.0](https://github.com/singchia/geminio/blob/main/LICENSE)
1162+
1163+
---
1164+
1165+
已经看到这里,点个Star⭐️是莫大的认可♥️

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
1.1.0

dist/compose/docker-compose.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ version: "3.7"
33
services:
44
frontier:
55
container_name: frontier
6-
image: singchia/frontier:1.0.0
6+
image: singchia/frontier:1.1.0
77
restart: always
8+
command: --config /usr/conf/frontier.yaml -v 1
89
ports:
910
- 30010:30010
1011
- 30011:30011
@@ -16,7 +17,7 @@ services:
1617
max-file: "5"
1718
frontlas:
1819
container_name: frontlas
19-
image: singchia/frontlas:1.0.0
20+
image: singchia/frontlas:1.1.0
2021
restart: always
2122
ports:
2223
- 40011:40011

dist/crd/frontier-cluster.yaml renamed to dist/crd/frontier-cluster_example.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ metadata:
77
name: frontiercluster
88
spec:
99
frontier:
10-
replicas: 1
10+
replicas: 2
1111
servicebound:
1212
port: 30011
1313
edgebound:
1414
port: 30012
15+
image: singchia/frontier:1.1.0
1516
frontlas:
1617
replicas: 1
1718
controlplane:
1819
port: 40011
20+
image: singchia/frontlas:1.1.0
1921
redis:
2022
addrs:
2123
- rfs-redisfailover:26379

dist/crd/iclm-service_example.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: iclm-service
5+
spec:
6+
selector:
7+
matchLabels:
8+
app: iclm-service
9+
replicas: 1
10+
template:
11+
metadata:
12+
labels:
13+
app: iclm-service
14+
spec:
15+
imagePullSecrets:
16+
- name: Always
17+
containers:
18+
- name: iclm-service
19+
image: singchia/iclm_service:1.0.0-dev
20+
imagePullPolicy: Always

dist/crd/install.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ spec:
109109
- mtls
110110
type: object
111111
type: object
112+
image:
113+
type: string
112114
nodeAffinity:
113115
description: Node affinity is a group of node affinity scheduling
114116
rules.
@@ -328,6 +330,8 @@ spec:
328330
for a service
329331
type: string
330332
type: object
333+
image:
334+
type: string
331335
nodeAffinity:
332336
description: Node affinity is a group of node affinity scheduling
333337
rules.
@@ -525,6 +529,8 @@ spec:
525529
type: array
526530
db:
527531
type: integer
532+
masterName:
533+
type: string
528534
password:
529535
type: string
530536
redisType:
@@ -859,7 +865,7 @@ spec:
859865
- --leader-elect
860866
command:
861867
- /manager
862-
image: singchia/frontiercluster-controller:1.0.0
868+
image: singchia/frontiercluster-controller:1.1.0
863869
imagePullPolicy: Always
864870
livenessProbe:
865871
httpGet:

dist/helm/configs/frontier/frontier.yaml

-38
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,14 @@ daemon:
77
enable: true
88
addr: 0.0.0.0:6060
99
cpu_profile_rate: 0
10-
controlplane:
11-
enable: false
12-
listen:
13-
network: tcp
14-
addr: 0.0.0.0:30010
1510
servicebound:
1611
listen:
1712
network: tcp
1813
addr: 0.0.0.0:30011
19-
tls:
20-
enable: false
21-
mtls: false
22-
ca_certs:
23-
- ca1.cert
24-
- ca2.cert
25-
certs:
26-
- cert: servicebound.cert
27-
key: servicebound.key
28-
insecure_skip_verify: false
2914
edgebound:
3015
listen:
3116
network: tcp
3217
addr: 0.0.0.0:30012
33-
tls:
34-
enable: false
35-
mtls: false
36-
ca_certs:
37-
- ca1.cert
38-
- ca2.cert
39-
certs:
40-
- cert: edgebound.cert
41-
key: edgebound.key
42-
insecure_skip_verify: false
43-
bypass:
44-
network: tcp
45-
addr: 192.168.1.10:8443
46-
tls:
47-
enable: true
48-
mtls: true
49-
ca_certs:
50-
- ca1.cert
51-
certs:
52-
- cert: frontier.cert
53-
key: frontier.key
54-
insecure_skip_verify: false
55-
bypass_enable: false
5618
edgeid_alloc_when_no_idservice_on: true
5719
dao:
5820
debug: false

dist/helm/templates/service_frontier.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: {{ include "frontier.fullname" . }}
4+
name: "frontier-servicebound-svc"
55
labels:
66
{{- include "frontier.labels" . | nindent 4 }}
77
spec:
@@ -19,7 +19,7 @@ spec:
1919
apiVersion: v1
2020
kind: Service
2121
metadata:
22-
name: {{ include "frontier.fullname" . }}
22+
name: "frontier-edgebound-svc"
2323
labels:
2424
{{- include "frontier.labels" . | nindent 4 }}
2525
spec:

dist/helm/values.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44
global:
5-
registry: hub.docker.com/singchia
5+
registry: singchia
66
pullPolicy: Always
77

88
imagePullSecrets: []
@@ -14,7 +14,7 @@ image:
1414
image: frontier
1515
pullPolicy: IfNotPresent
1616
# Overrides the image tag whose default is the chart appVersion.
17-
tag: 1.0.0
17+
tag: 1.1.0
1818

1919
replicaCount: 1
2020

@@ -47,7 +47,7 @@ service:
4747
type: ClusterIP
4848
targetPort: controlbound
4949
port: 30010
50-
- name: servicebound
50+
- name: frontier-edgebound-svc
5151
type: ClusterIP
5252
targetPort: servicebound
5353
port: 30011

pkg/frontier/edgebound/edge_manager.go

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ func newEdgeManager(conf *config.Configuration, repo apis.Repo, informer apis.Ed
8787
klog.Errorf("edge manager listen err: %s", err)
8888
return nil, err
8989
}
90+
klog.V(0).Infof("edgebound server listening on: %s", ln.Addr())
9091

9192
geminioLn := ln
9293
bypass := conf.Edgebound.BypassEnable

pkg/frontier/frontlas/frontlas.go

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ func NewInformer(conf *config.Configuration, tmr timer.Timer) (*Informer, error)
3333
if dial.Addrs == nil || len(dial.Addrs) == 0 {
3434
return nil, errors.New("illegal dial addrs")
3535
}
36+
if dial.Network == "" {
37+
dial.Network = "tcp"
38+
}
3639

3740
sbAddr, ebAddr, err := getAdvertisedAddrs(conf.Servicebound.Listen, conf.Edgebound.Listen, dial)
3841
// meta

pkg/frontier/servicebound/service_manager.go

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ func newServiceManager(conf *config.Configuration, repo apis.Repo, informer apis
8787
klog.Errorf("service manager listen err: %s", err)
8888
return nil, err
8989
}
90+
klog.V(0).Infof("servicebound server listening on: %s", ln.Addr())
9091
sm.ln = ln
9192
return sm, nil
9293
}

pkg/frontier/servicebound/service_onoff.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (sm *serviceManager) ConnOffline(d delegate.ConnDescriber) error {
130130
serviceID := d.ClientID()
131131
meta := string(d.Meta())
132132
addr := d.RemoteAddr()
133-
klog.V(2).Infof("service offline, serviceID: %d, service: %s, remote addr: %s", serviceID, meta, addr)
133+
klog.V(1).Infof("service offline, serviceID: %d, service: %s, remote addr: %s", serviceID, meta, addr)
134134
// offline the cache
135135
err := sm.offline(serviceID, addr)
136136
if err != nil {

pkg/frontlas/frontierbound/frontier_bound.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func NewFrontierManager(conf *config.Configuration, dao *repo.Dao, tmr timer.Tim
4646
klog.Errorf("frontier plane listen err: %s", err)
4747
return nil, err
4848
}
49-
klog.V(1).Infof("server listening on: %v", ln.Addr())
49+
klog.V(0).Infof("frontierbound server listening on: %v", ln.Addr())
5050

5151
fm.ln = ln
5252
return fm, nil

pkg/operator/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Image URL to use all building/pushing image targets
2-
IMG ?= singchia/frontiercluster-controller:1.0.0-dev
2+
IMG ?= singchia/frontiercluster-controller:1.1.0
33
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
44
ENVTEST_K8S_VERSION = 1.29.0
55

pkg/operator/api/v1alpha1/frontiercluster_types.go

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type Frontier struct {
6565
Replicas int `json:"replicas,omitempty"` // frontier replicas, default 1
6666
Servicebound Servicebound `json:"servicebound"`
6767
Edgebound Edgebound `json:"edgebound"`
68+
Image string `json:"image,omitempty"` // default singchia/frontier:1.1.0
6869
NodeAffinity corev1.NodeAffinity `json:"nodeAffinity,omitempty"`
6970
}
7071

@@ -95,6 +96,7 @@ type Frontlas struct {
9596
Replicas int `json:"replicas,omitempty"` // frontlas replicas, default 1
9697
ControlPlane ControlPlane `json:"controlplane,omitempty"`
9798
NodeAffinity corev1.NodeAffinity `json:"nodeAffinity,omitempty"`
99+
Image string `json:"image,omitempty"`
98100
Redis Redis `json:"redis"`
99101
}
100102

0 commit comments

Comments
 (0)