Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Aug 26, 2024
1 parent ddf06f0 commit f3b23f6
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 16 deletions.
1 change: 1 addition & 0 deletions pkg/kwokctl/components/jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func BuildJaegerComponent(conf BuildJaegerComponentConfig) (component internalve
)
jaegerArgs = append(jaegerArgs,
"--query.http-server.host-port="+conf.BindAddress+":16686",
"--collector.otlp.grpc.host-port="+net.LocalAddress+":4317",
)
} else {
ports = append(
Expand Down
20 changes: 12 additions & 8 deletions pkg/kwokctl/runtime/compose/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,11 @@ func (c *Cluster) addKubeApiserver(ctx context.Context, env *env) (err error) {

kubeApiserverTracingConfigPath := ""
if conf.JaegerPort != 0 {
if conf.JaegerOtlpGrpcPort == 0 {
conf.JaegerOtlpGrpcPort = 4317
}
kubeApiserverTracingConfigData, err := k8s.BuildKubeApiserverTracingConfig(k8s.BuildKubeApiserverTracingConfigParam{
Endpoint: c.Name() + "-jaeger:4317",
Endpoint: c.Name() + "-jaeger:" + format.String(conf.JaegerOtlpGrpcPort),
})
if err != nil {
return fmt.Errorf("failed to generate kubeApiserverTracingConfig yaml: %w", err)
Expand Down Expand Up @@ -774,13 +777,14 @@ func (c *Cluster) addJaeger(ctx context.Context, env *env) (err error) {
}

jaegerComponent, err := components.BuildJaegerComponent(components.BuildJaegerComponentConfig{
Runtime: conf.Runtime,
Workdir: env.workdir,
Image: conf.JaegerImage,
Version: jaegerVersion,
BindAddress: net.PublicAddress,
Port: conf.JaegerPort,
Verbosity: env.verbosity,
Runtime: conf.Runtime,
Workdir: env.workdir,
Image: conf.JaegerImage,
Version: jaegerVersion,
BindAddress: net.PublicAddress,
Port: conf.JaegerPort,
OtlpGrpcPort: conf.JaegerOtlpGrpcPort,
Verbosity: env.verbosity,
})
if err != nil {
return err
Expand Down
15 changes: 8 additions & 7 deletions pkg/kwokctl/runtime/kind/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,13 +888,14 @@ func (c *Cluster) addJaeger(ctx context.Context, env *env) (err error) {
}

jaegerComponent, err := components.BuildJaegerComponent(components.BuildJaegerComponentConfig{
Runtime: conf.Runtime,
Workdir: env.workdir,
Image: conf.JaegerImage,
Version: jaegerVersion,
BindAddress: net.PublicAddress,
Port: 16686,
Verbosity: env.verbosity,
Runtime: conf.Runtime,
Workdir: env.workdir,
Image: conf.JaegerImage,
Version: jaegerVersion,
BindAddress: net.PublicAddress,
Port: 16686,
OtlpGrpcPort: 4317,
Verbosity: env.verbosity,
})
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions site/content/en/docs/generated/kwokctl.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ kwokctl [command] [flags]
* [kwokctl hack](kwokctl_hack.md) - [experimental] Hack [get, put, delete] resources in etcd without apiserver
* [kwokctl kubectl](kwokctl_kubectl.md) - kubectl in cluster
* [kwokctl logs](kwokctl_logs.md) - Logs one of [audit, etcd, kube-apiserver, kube-controller-manager, kube-scheduler, kwok-controller, dashboard, metrics-server, prometheus, jaeger]
* [kwokctl port-forward](kwokctl_port-forward.md) - Forward one local ports to a component
* [kwokctl scale](kwokctl_scale.md) - Scale a resource in cluster
* [kwokctl snapshot](kwokctl_snapshot.md) - Snapshot [save, restore, record, replay, export] one of cluster
* [kwokctl start](kwokctl_start.md) - Start one of [cluster]
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/docs/generated/kwokctl_logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Logs one of [audit, etcd, kube-apiserver, kube-controller-manager, kube-scheduler, kwok-controller, dashboard, metrics-server, prometheus, jaeger]

```
kwokctl logs [command] [flags]
kwokctl logs [component] [flags]
```

### Options
Expand Down
27 changes: 27 additions & 0 deletions site/content/en/docs/generated/kwokctl_port-forward.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## kwokctl port-forward

Forward one local ports to a component

```
kwokctl port-forward [component] [local-port]:[port-name] [flags]
```

### Options

```
-h, --help help for port-forward
```

### Options inherited from parent commands

```
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
```

### SEE ALSO

* [kwokctl](kwokctl.md) - kwokctl is a tool to streamline the creation and management of clusters, with nodes simulated by kwok

0 comments on commit f3b23f6

Please sign in to comment.