Skip to content

Commit dcb6a8d

Browse files
authored
Merge branch 'apache:master' into master
2 parents 73434ff + cd5e75e commit dcb6a8d

90 files changed

Lines changed: 1151 additions & 2479 deletions

File tree

Some content is hidden

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

dubboctl/cmd/create.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ import (
3333
type createArgs struct {
3434
// dirname specifies the name of the custom-created directory.
3535
dirname string
36-
// language specifies different SDK languages.
36+
// language specifies different sdk languages.
3737
language string
38+
// template specifies repository or default common.
3839
template string
3940
}
4041

@@ -102,12 +103,16 @@ func sdkGenerateCmd(cmd *cobra.Command, clientFactory ClientFactory) *cobra.Comm
102103

103104
type createConfig struct {
104105
// Path Absolute to function source
105-
Path string
106-
Runtime string
106+
Path string
107+
// Runtime
108+
Runtime string
109+
// Template
107110
Template string
108-
// Repo URI (overrides builtin and installed)
109-
Repo string
110-
DirName string
111+
// Repo Uri (overrides builtin and installed)
112+
Repo string
113+
// DirName Defines a custom creation directory name。
114+
DirName string
115+
// Initialized
111116
Initialized bool
112117
}
113118

dubboctl/cmd/image.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ import (
3535
)
3636

3737
type imageArgs struct {
38+
// dockerfile Defines the required Dockerfile files.
3839
dockerfile bool
39-
builder bool
40-
output string
41-
destroy bool
40+
// builder Defines the path used by the builder.
41+
builder bool
42+
// output Defines the generated dubbo deploy yaml file.
43+
output string
44+
// destroy Defines the deletion of deploy yaml file.
45+
destroy bool
4246
}
4347

4448
func addHubFlags(cmd *cobra.Command, iArgs *imageArgs) {
@@ -48,7 +52,7 @@ func addHubFlags(cmd *cobra.Command, iArgs *imageArgs) {
4852

4953
func addDeployFlags(cmd *cobra.Command, iArgs *imageArgs) {
5054
cmd.PersistentFlags().StringVarP(&iArgs.output, "output", "o", "dubbo-deploy.yaml", "The output generates k8s yaml file")
51-
cmd.PersistentFlags().BoolVarP(&iArgs.destroy, "delete", "d", false, "delete k8s yaml file")
55+
cmd.PersistentFlags().BoolVarP(&iArgs.destroy, "delete", "d", false, "deletion k8s yaml file")
5256
}
5357

5458
func ImageCmd(ctx cli.Context, cmd *cobra.Command, clientFactory ClientFactory) *cobra.Command {
@@ -64,9 +68,12 @@ func ImageCmd(ctx cli.Context, cmd *cobra.Command, clientFactory ClientFactory)
6468
}
6569

6670
type hubConfig struct {
71+
// Dockerfile Defines the required files.
6772
Dockerfile bool
68-
Builder bool
69-
Image string
73+
// Builder Defines the path used by the builder.
74+
Builder bool
75+
// Image information required by image.
76+
Image string
7077
// BuilderImage is the image (name or mapping) to use for building. Usually
7178
// set automatically.
7279
BuilderImage string

dubboctl/cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NewClientFactory(options ...sdk.Option) (*sdk.Client, func()) {
4848
var (
4949
t = newTransport(false)
5050
c = newCredentialsProvider(util.Dir(), t)
51-
d = newDubboDeployer()
51+
d = newDeployer()
5252
o = []sdk.Option{
5353
sdk.WithRepositoriesPath(util.RepositoriesPath()),
5454
sdk.WithBuilder(pack.NewBuilder()),
@@ -77,7 +77,7 @@ func newCredentialsProvider(configPath string, t http.RoundTripper) pusher.Crede
7777
return credentials.NewCredentialsProvider(configPath, options...)
7878
}
7979

80-
func newDubboDeployer() sdk.Deployer {
80+
func newDeployer() sdk.Deployer {
8181
var options []deployer.DeployerOption
8282

8383
return deployer.NewDeployer(options...)

dubboctl/pkg/cli/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ func (i *instance) CLIClientWithRevision(rev string) (kube.CLIClient, error) {
7171

7272
func newKubeClientWithRevision(kubeconfig, context, revision string, impersonationConfig rest.ImpersonationConfig) (kube.CLIClient, error) {
7373
drc, err := kube.DefaultRestConfig(kubeconfig, context, func(config *rest.Config) {
74-
config.QPS = 55
75-
config.Burst = 95
74+
config.QPS = 50
75+
config.Burst = 100
7676
config.Impersonate = impersonationConfig
7777
})
7878

dubboctl/pkg/hub/builder/pack/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var (
5252

5353
type Builder struct {
5454
name string
55-
outBuff bytes.Buffer
55+
outBuffer bytes.Buffer
5656
logger logging.Logger
5757
impl Impl
5858
withTimestamp bool
@@ -136,7 +136,7 @@ func (b *Builder) Build(ctx context.Context, dc *dubbo.DubboConfig) (err error)
136136
} else {
137137
err = fmt.Errorf("failed to build the application: %w", err)
138138
fmt.Fprintln(color.Stderr(), "")
139-
_, _ = io.Copy(color.Stderr(), &b.outBuff)
139+
_, _ = io.Copy(color.Stderr(), &b.outBuffer)
140140
fmt.Fprintln(color.Stderr(), "")
141141
}
142142
}

dubboctl/pkg/hub/deployer/deploy.tpl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ spec:
2121
ports:
2222
- containerPort: {{.Port}}
2323
name: dubbo
24-
readinessProbe:
25-
tcpSocket:
26-
port: {{.Port}}
27-
initialDelaySeconds: 5
28-
periodSeconds: 10
29-
livenessProbe:
30-
tcpSocket:
31-
port: {{.Port}}
32-
initialDelaySeconds: 15
33-
periodSeconds: 20
3424
resources:
3525
requests:
3626
cpu: 100m

dubboctl/pkg/hub/pusher/pusher.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,24 @@ type Credentials struct {
5151

5252
type CredentialsProvider func(ctx context.Context, image string) (Credentials, error)
5353

54-
type PusherDockerClientFactory func() (PusherDockerClient, error)
54+
type DockerClientFactory func() (DockerClient, error)
5555

5656
type Pusher struct {
5757
credentialsProvider CredentialsProvider
5858
transport http.RoundTripper
59-
dockerClientFactory PusherDockerClientFactory
59+
dockerClientFactory DockerClientFactory
6060
}
6161

6262
type authConfig struct {
63-
Username string `json:"username,omitempty"`
64-
Password string `json:"password,omitempty"`
65-
Auth string `json:"auth,omitempty"`
66-
Email string `json:"email,omitempty"`
67-
ServerAddress string `json:"serveraddress,omitempty"`
68-
IdentityToken string `json:"identitytoken,omitempty"`
69-
RegistryToken string `json:"registrytoken,omitempty"`
63+
Username string `json:"username,omitempty"`
64+
Password string `json:"password,omitempty"`
7065
}
7166

7267
func NewPusher(opts ...Opt) *Pusher {
7368
result := &Pusher{
7469
credentialsProvider: EmptyCredentialsProvider,
7570
transport: http.DefaultTransport,
76-
dockerClientFactory: func() (PusherDockerClient, error) {
71+
dockerClientFactory: func() (DockerClient, error) {
7772
c, _, err := hub.NewClient(client.DefaultDockerHost)
7873
return c, err
7974
},
@@ -236,7 +231,7 @@ func (n *Pusher) push(ctx context.Context, dc *dubbo.DubboConfig, credentials Cr
236231
return hash.String(), nil
237232
}
238233

239-
type PusherDockerClient interface {
234+
type DockerClient interface {
240235
daemon.Client
241236
ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error)
242237
Close() error

manifests/addons/gen.sh

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -24,58 +24,16 @@ set -eux
2424
# script set up the plain text rendered
2525

2626
KUBERNETES=${WORKDIR}/../kubernetes
27-
DASHBOARDS=${WORKDIR}
2827
mkdir -p "${KUBERNETES}"
29-
kubectl delete ns dubbo-system && kubectl create ns dubbo-system
30-
31-
32-
# Set up zookeeper
33-
helm template zookeeper zookeeper \
34-
--namespace dubbo-system \
35-
--version 11.1.6 \
36-
--repo https://charts.bitnami.com/bitnami \
37-
-f "${WORKDIR}/values-zookeeper.yaml" \
38-
> "${KUBERNETES}/zookeeper.yaml"
39-
28+
kubectl create ns dubbo-system
29+
if [ $? -ne 0 ];then
30+
kubectl delete ns dubbo-system ; kubectl create ns dubbo-system
31+
fi
4032

4133
# Set up prometheus
4234
helm template prometheus prometheus \
4335
--namespace dubbo-system \
44-
--version 20.0.2 \
36+
--version 27.5.1 \
4537
--repo https://prometheus-community.github.io/helm-charts \
46-
-f "${WORKDIR}/values-prometheus.yaml" \
47-
> "${KUBERNETES}/prometheus.yaml"
48-
49-
50-
# Set up grafana
51-
{
52-
helm template grafana grafana \
53-
--namespace dubbo-system \
54-
--version 6.52.4 \
55-
--repo https://grafana.github.io/helm-charts \
56-
-f "${WORKDIR}/values-grafana.yaml" \
57-
58-
echo -e "\n---\n"
59-
60-
kubectl create configmap -n dubbo-system admin-extra-dashboards \
61-
--dry-run=client -oyaml \
62-
--from-file=extra-dashboard.json="${DASHBOARDS}/dashboards/external-dashboard.json"
63-
} > "${KUBERNETES}/grafana.yaml"
64-
65-
66-
# Set up skywalking
67-
helm template skywalking skywalking \
68-
--namespace dubbo-system \
69-
--version 4.3.0 \
70-
--repo https://apache.jfrog.io/artifactory/skywalking-helm \
71-
-f "${WORKDIR}/values-skywalking.yaml" \
72-
> "${KUBERNETES}/skywalking.yaml"
73-
74-
75-
# Set up zipkin
76-
helm template zipkin zipkin \
77-
--namespace dubbo-system \
78-
--version 0.1.2 \
79-
--repo https://zipkin.io/zipkin-helm \
80-
-f "${WORKDIR}/values-zipkin.yaml" \
81-
> "${KUBERNETES}/zipkin.yaml"
38+
-f "${WD}/values-prometheus.yaml" \
39+
> "${ADDONS}/prometheus.yaml"

manifests/addons/values-grafana.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

manifests/addons/values-prometheus.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,32 @@
1515

1616
alertmanager:
1717
enabled: false
18+
1819
prometheus-pushgateway:
1920
enabled: false
21+
2022
kube-state-metrics:
2123
enabled: false
24+
2225
prometheus-node-exporter:
2326
enabled: false
27+
2428
server:
2529
persistentVolume:
2630
enabled: false
2731
service:
2832
servicePort: 9090
33+
readinessProbeInitialDelay: 0
34+
2935
global:
3036
scrape_interval: 15s
37+
38+
image:
39+
repository: prom/prometheus
40+
41+
securityContext: null
42+
43+
configmapReload:
44+
prometheus:
45+
image:
46+
repository: ghcr.io/prometheus-operator/prometheus-config-reloader

0 commit comments

Comments
 (0)