diff --git a/pkg/apis/config/v1alpha1/kwokctl_configuration_types.go b/pkg/apis/config/v1alpha1/kwokctl_configuration_types.go index 81a9700598..b97c52cdbb 100644 --- a/pkg/apis/config/v1alpha1/kwokctl_configuration_types.go +++ b/pkg/apis/config/v1alpha1/kwokctl_configuration_types.go @@ -120,6 +120,9 @@ type KwokctlConfigurationOptions struct { // DashboardVersion is the version of Kubernetes dashboard to use. DashboardVersion string `json:"dashboardVersion,omitempty"` + // DashboardMetricsScraperVersion is the version of Kubernetes dashboard metrics scraper to use. + DashboardMetricsScraperVersion string `json:"dashboardMetricsScraperVersion,omitempty"` + // PrometheusVersion is the version of Prometheus to use. // is the default value for env KWOK_PROMETHEUS_VERSION PrometheusVersion string `json:"prometheusVersion,omitempty"` @@ -224,6 +227,9 @@ type KwokctlConfigurationOptions struct { // DashboardImage is the image of dashboard. DashboardImage string `json:"dashboardImage,omitempty"` + // DashboardMetricsScraperImage is the image of dashboard metrics scraper. + DashboardMetricsScraperImage string `json:"dashboardMetricsScraperImage,omitempty"` + // PrometheusImage is the image of Prometheus. // is the default value for flag --prometheus-image and env KWOK_PROMETHEUS_IMAGE PrometheusImage string `json:"prometheusImage,omitempty"` diff --git a/pkg/apis/internalversion/kwokctl_configuration_types.go b/pkg/apis/internalversion/kwokctl_configuration_types.go index f1d3267812..9b5ad4dcc9 100644 --- a/pkg/apis/internalversion/kwokctl_configuration_types.go +++ b/pkg/apis/internalversion/kwokctl_configuration_types.go @@ -98,6 +98,9 @@ type KwokctlConfigurationOptions struct { // DashboardVersion is the version of Kubernetes dashboard to use. DashboardVersion string + // DashboardMetricsScraperVersion is the version of dashboard metrics scraper to use. + DashboardMetricsScraperVersion string + // PrometheusVersion is the version of Prometheus to use. PrometheusVersion string @@ -150,6 +153,9 @@ type KwokctlConfigurationOptions struct { // DashboardImage is the image of dashboard. DashboardImage string + // DashboardMetricsScraperImage is the image of dashboard metrics scraper. + DashboardMetricsScraperImage string + // PrometheusImage is the image of Prometheus. PrometheusImage string diff --git a/pkg/apis/internalversion/zz_generated.conversion.go b/pkg/apis/internalversion/zz_generated.conversion.go index 2ce5a0579e..931aefa5c5 100644 --- a/pkg/apis/internalversion/zz_generated.conversion.go +++ b/pkg/apis/internalversion/zz_generated.conversion.go @@ -1643,6 +1643,7 @@ func autoConvert_internalversion_KwokctlConfigurationOptions_To_v1alpha1_Kwokctl out.KubeVersion = in.KubeVersion out.EtcdVersion = in.EtcdVersion out.DashboardVersion = in.DashboardVersion + out.DashboardMetricsScraperVersion = in.DashboardMetricsScraperVersion out.PrometheusVersion = in.PrometheusVersion out.JaegerVersion = in.JaegerVersion out.MetricsServerVersion = in.MetricsServerVersion @@ -1670,6 +1671,7 @@ func autoConvert_internalversion_KwokctlConfigurationOptions_To_v1alpha1_Kwokctl out.KubeSchedulerImage = in.KubeSchedulerImage out.KwokControllerImage = in.KwokControllerImage out.DashboardImage = in.DashboardImage + out.DashboardMetricsScraperImage = in.DashboardMetricsScraperImage out.PrometheusImage = in.PrometheusImage out.JaegerImage = in.JaegerImage out.MetricsServerImage = in.MetricsServerImage @@ -1736,6 +1738,7 @@ func autoConvert_v1alpha1_KwokctlConfigurationOptions_To_internalversion_Kwokctl out.KubeVersion = in.KubeVersion out.EtcdVersion = in.EtcdVersion out.DashboardVersion = in.DashboardVersion + out.DashboardMetricsScraperVersion = in.DashboardMetricsScraperVersion out.PrometheusVersion = in.PrometheusVersion out.JaegerVersion = in.JaegerVersion out.MetricsServerVersion = in.MetricsServerVersion @@ -1770,6 +1773,7 @@ func autoConvert_v1alpha1_KwokctlConfigurationOptions_To_internalversion_Kwokctl out.KubeSchedulerImage = in.KubeSchedulerImage out.KwokControllerImage = in.KwokControllerImage out.DashboardImage = in.DashboardImage + out.DashboardMetricsScraperImage = in.DashboardMetricsScraperImage out.PrometheusImage = in.PrometheusImage out.JaegerImage = in.JaegerImage out.MetricsServerImage = in.MetricsServerImage diff --git a/pkg/config/vars.go b/pkg/config/vars.go index 4854a79661..485ae0cb4f 100644 --- a/pkg/config/vars.go +++ b/pkg/config/vars.go @@ -453,6 +453,16 @@ func setKwokctlDashboardConfig(conf *configv1alpha1.KwokctlConfigurationOptions) } conf.DashboardImage = envs.GetEnvWithPrefix("DASHBOARD_IMAGE", conf.DashboardImage) + if conf.DashboardMetricsScraperVersion == "" { + conf.DashboardMetricsScraperVersion = consts.DashboardMetricsScraperVersion + } + conf.DashboardMetricsScraperVersion = version.AddPrefixV(envs.GetEnvWithPrefix("DASHBOARD_METRICS_SCRAPER_VERSION", conf.DashboardMetricsScraperVersion)) + + if conf.DashboardMetricsScraperImage == "" { + conf.DashboardMetricsScraperImage = joinImageURI(conf.DashboardImagePrefix, "metrics-scraper", conf.DashboardMetricsScraperVersion) + } + conf.DashboardMetricsScraperImage = envs.GetEnvWithPrefix("DASHBOARD_METRICS_SCRAPER_IMAGE", conf.DashboardMetricsScraperImage) + // TODO: Add dashboard binary // if conf.DashboardBinaryPrefix == "" { // conf.DashboardBinaryPrefix = consts.DashboardBinaryPrefix + "/" + conf.DashboardVersion diff --git a/pkg/consts/consts.go b/pkg/consts/consts.go index 42b32792aa..9313d2e1a0 100644 --- a/pkg/consts/consts.go +++ b/pkg/consts/consts.go @@ -53,6 +53,8 @@ var ( DashboardBinaryPrefix = "" DashboardImagePrefix = "docker.io/kubernetesui" + DashboardMetricsScraperVersion = "1.0.9" + PrometheusVersion = "2.49.1" PrometheusBinaryPrefix = "https://github.com/prometheus/prometheus/releases/download" PrometheusImagePrefix = "docker.io/prom" @@ -81,13 +83,14 @@ const ( // The following components is provided. const ( - ComponentEtcd = "etcd" - ComponentKubeApiserver = "kube-apiserver" - ComponentKubeControllerManager = "kube-controller-manager" - ComponentKubeScheduler = "kube-scheduler" - ComponentKwokController = "kwok-controller" - ComponentDashboard = "dashboard" - ComponentPrometheus = "prometheus" - ComponentJaeger = "jaeger" - ComponentMetricsServer = "metrics-server" + ComponentEtcd = "etcd" + ComponentKubeApiserver = "kube-apiserver" + ComponentKubeControllerManager = "kube-controller-manager" + ComponentKubeScheduler = "kube-scheduler" + ComponentKwokController = "kwok-controller" + ComponentDashboard = "dashboard" + ComponentDashboardMetricsScraper = "dashboard-metrics-scraper" + ComponentPrometheus = "prometheus" + ComponentJaeger = "jaeger" + ComponentMetricsServer = "metrics-server" ) diff --git a/pkg/kwokctl/components/dashboard.go b/pkg/kwokctl/components/dashboard.go index 33f0e17249..ed428fc343 100644 --- a/pkg/kwokctl/components/dashboard.go +++ b/pkg/kwokctl/components/dashboard.go @@ -26,6 +26,7 @@ import ( // BuildDashboardComponentConfig is the configuration for building the dashboard component. type BuildDashboardComponentConfig struct { Runtime string + ProjectName string Binary string Image string Version version.Version @@ -35,6 +36,8 @@ type BuildDashboardComponentConfig struct { Banner string + EnableMetrics bool + CaCertPath string AdminCertPath string AdminKeyPath string @@ -50,8 +53,18 @@ func BuildDashboardComponent(conf BuildDashboardComponentConfig) (component inte "--enable-insecure-login", "--enable-skip-login", "--disable-settings-authorizer", - "--metrics-provider=none", } + if conf.EnableMetrics { + switch GetRuntimeMode(conf.Runtime) { + case RuntimeModeContainer: + dashboardArgs = append(dashboardArgs, "--sidecar-host="+conf.ProjectName+"-"+consts.ComponentDashboardMetricsScraper+":8000") + default: + dashboardArgs = append(dashboardArgs, "--sidecar-host=127.0.0.1:8000") + } + } else { + dashboardArgs = append(dashboardArgs, "--metrics-provider=none") + } + if conf.Banner != "" { dashboardArgs = append(dashboardArgs, "--system-banner="+conf.Banner) } @@ -62,7 +75,7 @@ func BuildDashboardComponent(conf BuildDashboardComponentConfig) (component inte if GetRuntimeMode(conf.Runtime) != RuntimeModeNative { dashboardArgs = append(dashboardArgs, "--kubeconfig=/root/.kube/config", - "--insecure-port=8000", + "--insecure-port=8080", ) volumes = append(volumes, internalversion.Volume{ @@ -89,7 +102,7 @@ func BuildDashboardComponent(conf BuildDashboardComponentConfig) (component inte ports = append(ports, internalversion.Port{ Name: "http", - Port: 8000, + Port: 8080, HostPort: conf.Port, Protocol: internalversion.ProtocolTCP, }, diff --git a/pkg/kwokctl/components/dashboard_metrics_scraper.go b/pkg/kwokctl/components/dashboard_metrics_scraper.go new file mode 100644 index 0000000000..774589d23c --- /dev/null +++ b/pkg/kwokctl/components/dashboard_metrics_scraper.go @@ -0,0 +1,94 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package components + +import ( + "sigs.k8s.io/kwok/pkg/apis/internalversion" + "sigs.k8s.io/kwok/pkg/consts" + "sigs.k8s.io/kwok/pkg/utils/version" +) + +// BuildDashboardMetricsScraperComponentConfig is the configuration for building the dashboard component. +type BuildDashboardMetricsScraperComponentConfig struct { + Runtime string + Binary string + Image string + Version version.Version + Workdir string + + CaCertPath string + AdminCertPath string + AdminKeyPath string + KubeconfigPath string +} + +// BuildDashboardMetricsScraperComponent builds the dashboard component. +func BuildDashboardMetricsScraperComponent(conf BuildDashboardMetricsScraperComponentConfig) (component internalversion.Component, err error) { + dashboardArgs := []string{ + "--db-file=/metrics.db", + } + + user := "" + var volumes []internalversion.Volume + var ports []internalversion.Port + if GetRuntimeMode(conf.Runtime) != RuntimeModeNative { + dashboardArgs = append(dashboardArgs, + "--kubeconfig=/root/.kube/config", + ) + volumes = append(volumes, + internalversion.Volume{ + HostPath: conf.KubeconfigPath, + MountPath: "/root/.kube/config", + ReadOnly: true, + }, + internalversion.Volume{ + HostPath: conf.CaCertPath, + MountPath: "/etc/kubernetes/pki/ca.crt", + ReadOnly: true, + }, + internalversion.Volume{ + HostPath: conf.AdminCertPath, + MountPath: "/etc/kubernetes/pki/admin.crt", + ReadOnly: true, + }, + internalversion.Volume{ + HostPath: conf.AdminKeyPath, + MountPath: "/etc/kubernetes/pki/admin.key", + ReadOnly: true, + }, + ) + user = "root" + } else { + dashboardArgs = append(dashboardArgs, + "--kubeconfig="+conf.KubeconfigPath, + ) + } + + component = internalversion.Component{ + Name: consts.ComponentDashboardMetricsScraper, + Image: conf.Image, + Links: []string{ + consts.ComponentMetricsServer, + }, + WorkDir: conf.Workdir, + Ports: ports, + Volumes: volumes, + Args: dashboardArgs, + User: user, + } + return component, nil +} diff --git a/pkg/kwokctl/runtime/compose/cluster.go b/pkg/kwokctl/runtime/compose/cluster.go index b5cd76f38b..adfabad2a5 100644 --- a/pkg/kwokctl/runtime/compose/cluster.go +++ b/pkg/kwokctl/runtime/compose/cluster.go @@ -707,6 +707,7 @@ func (c *Cluster) addDashboard(_ context.Context, env *env) (err error) { if conf.DashboardPort != 0 { dashboardComponent, err := components.BuildDashboardComponent(components.BuildDashboardComponentConfig{ Runtime: conf.Runtime, + ProjectName: c.Name(), Workdir: env.workdir, Image: conf.DashboardImage, BindAddress: net.PublicAddress, @@ -716,11 +717,28 @@ func (c *Cluster) addDashboard(_ context.Context, env *env) (err error) { AdminKeyPath: env.adminKeyPath, Port: conf.DashboardPort, Banner: fmt.Sprintf("Welcome to %s", c.Name()), + EnableMetrics: conf.EnableMetricsServer, }) if err != nil { return err } env.kwokctlConfig.Components = append(env.kwokctlConfig.Components, dashboardComponent) + + if conf.EnableMetricsServer { + dashboardMetricsScraperComponent, err := components.BuildDashboardMetricsScraperComponent(components.BuildDashboardMetricsScraperComponentConfig{ + Runtime: conf.Runtime, + Workdir: env.workdir, + Image: conf.DashboardMetricsScraperImage, + KubeconfigPath: env.inClusterOnHostKubeconfigPath, + CaCertPath: env.caCertPath, + AdminCertPath: env.adminCertPath, + AdminKeyPath: env.adminKeyPath, + }) + if err != nil { + return err + } + env.kwokctlConfig.Components = append(env.kwokctlConfig.Components, dashboardMetricsScraperComponent) + } } return nil } diff --git a/pkg/kwokctl/runtime/kind/cluster.go b/pkg/kwokctl/runtime/kind/cluster.go index 61de3da4d4..bfd263d6d2 100644 --- a/pkg/kwokctl/runtime/kind/cluster.go +++ b/pkg/kwokctl/runtime/kind/cluster.go @@ -582,8 +582,9 @@ func (c *Cluster) addDashboard(ctx context.Context, env *env) (err error) { CaCertPath: env.caCertPath, AdminCertPath: env.adminCertPath, AdminKeyPath: env.adminKeyPath, - Port: 8000, + Port: 8080, Banner: fmt.Sprintf("Welcome to %s", c.Name()), + EnableMetrics: conf.EnableMetricsServer, }) if err != nil { return fmt.Errorf("failed to build dashboard component: %w", err) @@ -600,6 +601,30 @@ func (c *Cluster) addDashboard(ctx context.Context, env *env) (err error) { return fmt.Errorf("failed to write: %w", err) } env.kwokctlConfig.Components = append(env.kwokctlConfig.Components, dashboardComponent) + + if conf.EnableMetricsServer { + dashboardMetricsScraperComponent, err := components.BuildDashboardMetricsScraperComponent(components.BuildDashboardMetricsScraperComponentConfig{ + Runtime: conf.Runtime, + Workdir: env.workdir, + Image: conf.DashboardMetricsScraperImage, + KubeconfigPath: env.inClusterOnHostKubeconfigPath, + CaCertPath: env.caCertPath, + AdminCertPath: env.adminCertPath, + AdminKeyPath: env.adminKeyPath, + }) + if err != nil { + return err + } + dashboardMetricsScraperPod, err := yaml.Marshal(components.ConvertToPod(dashboardMetricsScraperComponent)) + if err != nil { + return fmt.Errorf("failed to marshal dashboard metrics scraper pod: %w", err) + } + err = c.WriteFile(path.Join(c.GetWorkdirPath(runtime.ManifestsName), consts.ComponentDashboardMetricsScraper+".yaml"), dashboardMetricsScraperPod) + if err != nil { + return fmt.Errorf("failed to write: %w", err) + } + env.kwokctlConfig.Components = append(env.kwokctlConfig.Components, dashboardMetricsScraperComponent) + } } return nil } diff --git a/pkg/kwokctl/runtime/kind/kind.yaml.tpl b/pkg/kwokctl/runtime/kind/kind.yaml.tpl index 879c4f6f03..473d49b9e9 100644 --- a/pkg/kwokctl/runtime/kind/kind.yaml.tpl +++ b/pkg/kwokctl/runtime/kind/kind.yaml.tpl @@ -11,7 +11,7 @@ nodes: {{ if or .DashboardPort .PrometheusPort .KwokControllerPort .EtcdPort .JaegerPort}} extraPortMappings: {{ if .DashboardPort }} - - containerPort: 8000 + - containerPort: 8080 hostPort: {{ .DashboardPort }} protocol: TCP {{ end }} diff --git a/test/kwokctl/kwokctl_workable_test.sh b/test/kwokctl/kwokctl_workable_test.sh index b1ed3eb2f7..a38d6159a9 100755 --- a/test/kwokctl/kwokctl_workable_test.sh +++ b/test/kwokctl/kwokctl_workable_test.sh @@ -206,9 +206,9 @@ function main() { minor="${minor%.*}" if [[ $minor -lt 22 ]]; then - create_cluster "${name}" "${release}" -v=debug --enable-metrics-server --prometheus-port 9090 --controller-port 10247 --etcd-port=2400 --kube-scheduler-port=10250 --kube-controller-manager-port=10260 --dashboard-port 8000 + create_cluster "${name}" "${release}" -v=debug --enable-metrics-server --prometheus-port 9090 --controller-port 10247 --etcd-port=2400 --kube-scheduler-port=10250 --kube-controller-manager-port=10260 --dashboard-port=8080 else - create_cluster "${name}" "${release}" -v=debug --enable-metrics-server --prometheus-port 9090 --jaeger-port 16686 --controller-port 10247 --etcd-port=2400 --kube-scheduler-port=10250 --kube-controller-manager-port=10260 --dashboard-port 8000 + create_cluster "${name}" "${release}" -v=debug --enable-metrics-server --prometheus-port 9090 --jaeger-port 16686 --controller-port 10247 --etcd-port=2400 --kube-scheduler-port=10250 --kube-controller-manager-port=10260 --dashboard-port=8080 fi test_workable "${name}" || failed+=("workable_${name}") diff --git a/test/kwokctl/testdata/docker/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/docker/create_cluster_with_verbosity.txt index b6eb1b6f7c..206f917947 100644 --- a/test/kwokctl/testdata/docker/create_cluster_with_verbosity.txt +++ b/test/kwokctl/testdata/docker/create_cluster_with_verbosity.txt @@ -175,9 +175,10 @@ docker create --name=kwok--kube-apiserver --pull=never --entrypoin docker create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-controller-manager:v1.29.0 --node-monitor-period=10m0s --node-monitor-grace-period=1h0m0s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=4 docker create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//scheduler.yaml:/etc/kubernetes/scheduler.yaml:ro registry.k8s.io/kube-scheduler:v1.29.0 --config=/etc/kubernetes/scheduler.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 --v=4 docker create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=40 --v=DEBUG -docker create --name=kwok--dashboard --pull=never --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=8000:8000/tcp --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/dashboard:v2.7.0 --insecure-bind-address=0.0.0.0 --bind-address=127.0.0.1 --port=0 --enable-insecure-login --enable-skip-login --disable-settings-authorizer --metrics-provider=none --system-banner=Welcome to kwok- --kubeconfig=~/.kube/config --insecure-port=8000 +docker create --name=kwok--dashboard --pull=never --network=kwok- --link=kwok--kube-apiserver --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=8000:8080/tcp --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/dashboard:v2.7.0 --insecure-bind-address=0.0.0.0 --bind-address=127.0.0.1 --port=0 --enable-insecure-login --enable-skip-login --disable-settings-authorizer --sidecar-host=kwok--dashboard-metrics-scraper:8000 --system-banner=Welcome to kwok- --kubeconfig=~/.kube/config --insecure-port=8080 docker create --name=kwok--metrics-server --pull=never --entrypoint=/metrics-server --network=kwok- --user=root --link=kwok--kwok-controller --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/metrics-server/metrics-server:v0.7.0 --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --kubelet-use-node-status-port --kubelet-insecure-tls --metric-resolution=15s --bind-address=0.0.0.0 --secure-port=4443 --kubeconfig=~/.kube/config --authentication-kubeconfig=~/.kube/config --authorization-kubeconfig=~/.kube/config --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --v=4 docker create --name=kwok--prometheus --pull=never --entrypoint=prometheus --network=kwok- --link=kwok--etcd --link=kwok--kube-apiserver --link=kwok--kube-controller-manager --link=kwok--kube-scheduler --link=kwok--kwok-controller --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=9090:9090/tcp --volume=/workdir/clusters//prometheus.yaml:/etc/prometheus/prometheus.yaml:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/prom/prometheus:v2.49.1 --config.file=/etc/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug +docker create --name=kwok--dashboard-metrics-scraper --pull=never --network=kwok- --user=root --link=kwok--metrics-server --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/metrics-scraper:v1.0.9 --db-file=/metrics.db --kubeconfig=~/.kube/config # Add context kwok- to ~/.kube/config docker start kwok--etcd docker start kwok--jaeger @@ -188,4 +189,5 @@ docker start kwok--kwok-controller docker start kwok--dashboard docker start kwok--metrics-server docker start kwok--prometheus +docker start kwok--dashboard-metrics-scraper # Set up apiservice for metrics server diff --git a/test/kwokctl/testdata/kind-podman/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/kind-podman/create_cluster_with_verbosity.txt index 142de4fa4f..1c8dcf3094 100644 --- a/test/kwokctl/testdata/kind-podman/create_cluster_with_verbosity.txt +++ b/test/kwokctl/testdata/kind-podman/create_cluster_with_verbosity.txt @@ -27,7 +27,7 @@ networking: nodes: - role: control-plane extraPortMappings: - - containerPort: 8000 + - containerPort: 8080 hostPort: 8000 protocol: TCP - containerPort: 9090 @@ -206,16 +206,16 @@ spec: - --enable-insecure-login - --enable-skip-login - --disable-settings-authorizer - - --metrics-provider=none + - --sidecar-host=127.0.0.1:8000 - --system-banner=Welcome to kwok- - --kubeconfig=~/.kube/config - - --insecure-port=8000 + - --insecure-port=8080 image: docker.io/kubernetesui/dashboard:v2.7.0 imagePullPolicy: Never name: dashboard ports: - - containerPort: 8000 - hostPort: 8000 + - containerPort: 8080 + hostPort: 8080 name: http protocol: TCP resources: {} @@ -252,6 +252,55 @@ spec: name: volume-3 status: {} EOF +cat </workdir/clusters//manifests/dashboard-metrics-scraper.yaml +apiVersion: v1 +kind: Pod +metadata: + creationTimestamp: null + name: dashboard-metrics-scraper + namespace: kube-system +spec: + containers: + - args: + - --db-file=/metrics.db + - --kubeconfig=~/.kube/config + image: docker.io/kubernetesui/metrics-scraper:v1.0.9 + imagePullPolicy: Never + name: dashboard-metrics-scraper + resources: {} + volumeMounts: + - mountPath: ~/.kube/config + name: volume-0 + readOnly: true + - mountPath: /etc/kubernetes/pki/ca.crt + name: volume-1 + readOnly: true + - mountPath: /etc/kubernetes/pki/admin.crt + name: volume-2 + readOnly: true + - mountPath: /etc/kubernetes/pki/admin.key + name: volume-3 + readOnly: true + hostNetwork: true + restartPolicy: Always + securityContext: + runAsGroup: 0 + runAsUser: 0 + volumes: + - hostPath: + path: /etc/kubernetes/admin.conf + name: volume-0 + - hostPath: + path: /etc/kubernetes/pki/ca.crt + name: volume-1 + - hostPath: + path: /etc/kubernetes/pki/admin.crt + name: volume-2 + - hostPath: + path: /etc/kubernetes/pki/admin.key + name: volume-3 +status: {} +EOF cat </workdir/clusters//manifests/metrics-server.yaml apiVersion: v1 kind: Pod @@ -509,6 +558,7 @@ EOF podman pull docker.io/kindest/node:v1.29.0 podman pull localhost/kwok:test podman pull docker.io/kubernetesui/dashboard:v2.7.0 +podman pull docker.io/kubernetesui/metrics-scraper:v1.0.9 podman pull registry.k8s.io/metrics-server/metrics-server:v0.7.0 podman pull docker.io/prom/prometheus:v2.49.1 podman pull docker.io/jaegertracing/all-in-one:1.53.0 @@ -522,6 +572,10 @@ mkdir -p /workdir/cache/image-archive/docker.io/kubernetesui/dashboard podman save docker.io/kubernetesui/dashboard:v2.7.0 -o /workdir/cache/image-archive/docker.io/kubernetesui/dashboard/v2.7.0.tar KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/docker.io/kubernetesui/dashboard/v2.7.0.tar --name kwok- rm /workdir/cache/image-archive/docker.io/kubernetesui/dashboard/v2.7.0.tar +mkdir -p /workdir/cache/image-archive/docker.io/kubernetesui/metrics-scraper +podman save docker.io/kubernetesui/metrics-scraper:v1.0.9 -o /workdir/cache/image-archive/docker.io/kubernetesui/metrics-scraper/v1.0.9.tar +KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/docker.io/kubernetesui/metrics-scraper/v1.0.9.tar --name kwok- +rm /workdir/cache/image-archive/docker.io/kubernetesui/metrics-scraper/v1.0.9.tar mkdir -p /workdir/cache/image-archive/registry.k8s.io/metrics-server/metrics-server podman save registry.k8s.io/metrics-server/metrics-server:v0.7.0 -o /workdir/cache/image-archive/registry.k8s.io/metrics-server/metrics-server/v0.7.0.tar KIND_EXPERIMENTAL_PROVIDER=podman kind load image-archive /workdir/cache/image-archive/registry.k8s.io/metrics-server/metrics-server/v0.7.0.tar --name kwok- diff --git a/test/kwokctl/testdata/kind/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/kind/create_cluster_with_verbosity.txt index 0ed08e59de..17bab83bd6 100644 --- a/test/kwokctl/testdata/kind/create_cluster_with_verbosity.txt +++ b/test/kwokctl/testdata/kind/create_cluster_with_verbosity.txt @@ -27,7 +27,7 @@ networking: nodes: - role: control-plane extraPortMappings: - - containerPort: 8000 + - containerPort: 8080 hostPort: 8000 protocol: TCP - containerPort: 9090 @@ -206,16 +206,16 @@ spec: - --enable-insecure-login - --enable-skip-login - --disable-settings-authorizer - - --metrics-provider=none + - --sidecar-host=127.0.0.1:8000 - --system-banner=Welcome to kwok- - --kubeconfig=~/.kube/config - - --insecure-port=8000 + - --insecure-port=8080 image: docker.io/kubernetesui/dashboard:v2.7.0 imagePullPolicy: Never name: dashboard ports: - - containerPort: 8000 - hostPort: 8000 + - containerPort: 8080 + hostPort: 8080 name: http protocol: TCP resources: {} @@ -252,6 +252,55 @@ spec: name: volume-3 status: {} EOF +cat </workdir/clusters//manifests/dashboard-metrics-scraper.yaml +apiVersion: v1 +kind: Pod +metadata: + creationTimestamp: null + name: dashboard-metrics-scraper + namespace: kube-system +spec: + containers: + - args: + - --db-file=/metrics.db + - --kubeconfig=~/.kube/config + image: docker.io/kubernetesui/metrics-scraper:v1.0.9 + imagePullPolicy: Never + name: dashboard-metrics-scraper + resources: {} + volumeMounts: + - mountPath: ~/.kube/config + name: volume-0 + readOnly: true + - mountPath: /etc/kubernetes/pki/ca.crt + name: volume-1 + readOnly: true + - mountPath: /etc/kubernetes/pki/admin.crt + name: volume-2 + readOnly: true + - mountPath: /etc/kubernetes/pki/admin.key + name: volume-3 + readOnly: true + hostNetwork: true + restartPolicy: Always + securityContext: + runAsGroup: 0 + runAsUser: 0 + volumes: + - hostPath: + path: /etc/kubernetes/admin.conf + name: volume-0 + - hostPath: + path: /etc/kubernetes/pki/ca.crt + name: volume-1 + - hostPath: + path: /etc/kubernetes/pki/admin.crt + name: volume-2 + - hostPath: + path: /etc/kubernetes/pki/admin.key + name: volume-3 +status: {} +EOF cat </workdir/clusters//manifests/metrics-server.yaml apiVersion: v1 kind: Pod @@ -509,6 +558,7 @@ EOF docker pull docker.io/kindest/node:v1.29.0 docker pull localhost/kwok:test docker pull docker.io/kubernetesui/dashboard:v2.7.0 +docker pull docker.io/kubernetesui/metrics-scraper:v1.0.9 docker pull registry.k8s.io/metrics-server/metrics-server:v0.7.0 docker pull docker.io/prom/prometheus:v2.49.1 docker pull docker.io/jaegertracing/all-in-one:1.53.0 @@ -516,6 +566,7 @@ docker pull docker.io/jaegertracing/all-in-one:1.53.0 KIND_EXPERIMENTAL_PROVIDER=docker kind create cluster --config /workdir/clusters//kind.yaml --name kwok- --image docker.io/kindest/node:v1.29.0 --wait 29m KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image localhost/kwok:test --name kwok- KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image docker.io/kubernetesui/dashboard:v2.7.0 --name kwok- +KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image docker.io/kubernetesui/metrics-scraper:v1.0.9 --name kwok- KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image registry.k8s.io/metrics-server/metrics-server:v0.7.0 --name kwok- KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image docker.io/prom/prometheus:v2.49.1 --name kwok- KIND_EXPERIMENTAL_PROVIDER=docker kind load docker-image docker.io/jaegertracing/all-in-one:1.53.0 --name kwok- diff --git a/test/kwokctl/testdata/nerdctl/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/nerdctl/create_cluster_with_verbosity.txt index 1f8657ebd8..e391b79f7d 100644 --- a/test/kwokctl/testdata/nerdctl/create_cluster_with_verbosity.txt +++ b/test/kwokctl/testdata/nerdctl/create_cluster_with_verbosity.txt @@ -175,9 +175,10 @@ nerdctl create --name=kwok--kube-apiserver --pull=never --entrypoi nerdctl create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-controller-manager:v1.29.0 --node-monitor-period=10m0s --node-monitor-grace-period=1h0m0s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=4 nerdctl create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//scheduler.yaml:/etc/kubernetes/scheduler.yaml:ro registry.k8s.io/kube-scheduler:v1.29.0 --config=/etc/kubernetes/scheduler.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 --v=4 nerdctl create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=40 --v=DEBUG -nerdctl create --name=kwok--dashboard --pull=never --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=8000:8000/tcp --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/dashboard:v2.7.0 --insecure-bind-address=0.0.0.0 --bind-address=127.0.0.1 --port=0 --enable-insecure-login --enable-skip-login --disable-settings-authorizer --metrics-provider=none --system-banner=Welcome to kwok- --kubeconfig=~/.kube/config --insecure-port=8000 +nerdctl create --name=kwok--dashboard --pull=never --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=8000:8080/tcp --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/dashboard:v2.7.0 --insecure-bind-address=0.0.0.0 --bind-address=127.0.0.1 --port=0 --enable-insecure-login --enable-skip-login --disable-settings-authorizer --sidecar-host=kwok--dashboard-metrics-scraper:8000 --system-banner=Welcome to kwok- --kubeconfig=~/.kube/config --insecure-port=8080 nerdctl create --name=kwok--metrics-server --pull=never --entrypoint=/metrics-server --network=kwok- --user=root --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/metrics-server/metrics-server:v0.7.0 --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --kubelet-use-node-status-port --kubelet-insecure-tls --metric-resolution=15s --bind-address=0.0.0.0 --secure-port=4443 --kubeconfig=~/.kube/config --authentication-kubeconfig=~/.kube/config --authorization-kubeconfig=~/.kube/config --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --v=4 nerdctl create --name=kwok--prometheus --pull=never --entrypoint=prometheus --network=kwok- --restart=unless-stopped --label=com.docker.compose.project=kwok- --publish=9090:9090/tcp --volume=/workdir/clusters//prometheus.yaml:/etc/prometheus/prometheus.yaml:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/prom/prometheus:v2.49.1 --config.file=/etc/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug +nerdctl create --name=kwok--dashboard-metrics-scraper --pull=never --network=kwok- --user=root --restart=unless-stopped --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/metrics-scraper:v1.0.9 --db-file=/metrics.db --kubeconfig=~/.kube/config # Add context kwok- to ~/.kube/config nerdctl start kwok--etcd nerdctl start kwok--jaeger @@ -188,4 +189,5 @@ nerdctl start kwok--kwok-controller nerdctl start kwok--dashboard nerdctl start kwok--metrics-server nerdctl start kwok--prometheus +nerdctl start kwok--dashboard-metrics-scraper # Set up apiservice for metrics server diff --git a/test/kwokctl/testdata/podman/create_cluster_with_verbosity.txt b/test/kwokctl/testdata/podman/create_cluster_with_verbosity.txt index 0c28472fb8..f65a09b752 100644 --- a/test/kwokctl/testdata/podman/create_cluster_with_verbosity.txt +++ b/test/kwokctl/testdata/podman/create_cluster_with_verbosity.txt @@ -175,9 +175,10 @@ podman create --name=kwok--kube-apiserver --pull=never --entrypoin podman create --name=kwok--kube-controller-manager --pull=never --entrypoint=kube-controller-manager --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/kube-controller-manager:v1.29.0 --node-monitor-period=10m0s --node-monitor-grace-period=1h0m0s --kubeconfig=~/.kube/config --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10257 --root-ca-file=/etc/kubernetes/pki/ca.crt --service-account-private-key-file=/etc/kubernetes/pki/admin.key --kube-api-qps=5000 --kube-api-burst=10000 --v=4 podman create --name=kwok--kube-scheduler --pull=never --entrypoint=kube-scheduler --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//scheduler.yaml:/etc/kubernetes/scheduler.yaml:ro registry.k8s.io/kube-scheduler:v1.29.0 --config=/etc/kubernetes/scheduler.yaml --authorization-always-allow-paths=/healthz,/readyz,/livez,/metrics --bind-address=0.0.0.0 --secure-port=10259 --kube-api-qps=5000 --kube-api-burst=10000 --v=4 podman create --name=kwok--kwok-controller --pull=never --entrypoint=kwok --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro --volume=/workdir/clusters//kwok.yaml:~/.kwok/kwok.yaml:ro localhost/kwok:test --manage-all-nodes=true --kubeconfig=~/.kube/config --config=~/.kwok/kwok.yaml --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --node-ip= --node-name=kwok--kwok-controller --node-port=10247 --server-address=0.0.0.0:10247 --node-lease-duration-seconds=40 --v=DEBUG -podman create --name=kwok--dashboard --pull=never --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=8000:8000/tcp --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/dashboard:v2.7.0 --insecure-bind-address=0.0.0.0 --bind-address=127.0.0.1 --port=0 --enable-insecure-login --enable-skip-login --disable-settings-authorizer --metrics-provider=none --system-banner=Welcome to kwok- --kubeconfig=~/.kube/config --insecure-port=8000 +podman create --name=kwok--dashboard --pull=never --network=kwok- --requires=kwok--kube-apiserver --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=8000:8080/tcp --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/dashboard:v2.7.0 --insecure-bind-address=0.0.0.0 --bind-address=127.0.0.1 --port=0 --enable-insecure-login --enable-skip-login --disable-settings-authorizer --sidecar-host=kwok--dashboard-metrics-scraper:8000 --system-banner=Welcome to kwok- --kubeconfig=~/.kube/config --insecure-port=8080 podman create --name=kwok--metrics-server --pull=never --entrypoint=/metrics-server --network=kwok- --user=root --requires=kwok--kwok-controller --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro registry.k8s.io/metrics-server/metrics-server:v0.7.0 --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --kubelet-use-node-status-port --kubelet-insecure-tls --metric-resolution=15s --bind-address=0.0.0.0 --secure-port=4443 --kubeconfig=~/.kube/config --authentication-kubeconfig=~/.kube/config --authorization-kubeconfig=~/.kube/config --tls-cert-file=/etc/kubernetes/pki/admin.crt --tls-private-key-file=/etc/kubernetes/pki/admin.key --v=4 podman create --name=kwok--prometheus --pull=never --entrypoint=prometheus --network=kwok- --requires=kwok--etcd --requires=kwok--kube-apiserver --requires=kwok--kube-controller-manager --requires=kwok--kube-scheduler --requires=kwok--kwok-controller --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --publish=9090:9090/tcp --volume=/workdir/clusters//prometheus.yaml:/etc/prometheus/prometheus.yaml:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/prom/prometheus:v2.49.1 --config.file=/etc/prometheus/prometheus.yaml --web.listen-address=0.0.0.0:9090 --log.level=debug +podman create --name=kwok--dashboard-metrics-scraper --pull=never --network=kwok- --user=root --requires=kwok--metrics-server --restart=unless-stopped --label=io.podman.compose.project=kwok- --label=com.docker.compose.project=kwok- --volume=/workdir/clusters//kubeconfig:~/.kube/config:ro --volume=/workdir/clusters//pki/ca.crt:/etc/kubernetes/pki/ca.crt:ro --volume=/workdir/clusters//pki/admin.crt:/etc/kubernetes/pki/admin.crt:ro --volume=/workdir/clusters//pki/admin.key:/etc/kubernetes/pki/admin.key:ro docker.io/kubernetesui/metrics-scraper:v1.0.9 --db-file=/metrics.db --kubeconfig=~/.kube/config # Add context kwok- to ~/.kube/config podman start kwok--etcd podman start kwok--jaeger @@ -188,4 +189,5 @@ podman start kwok--kwok-controller podman start kwok--dashboard podman start kwok--metrics-server podman start kwok--prometheus +podman start kwok--dashboard-metrics-scraper # Set up apiservice for metrics server