mirror of
https://github.com/rancher/rke.git
synced 2025-04-27 19:25:44 +00:00
Handle upgrade from metrics server 0.2.x to 0.3.x
This commit is contained in:
parent
496d1a46a5
commit
22dc19205f
@ -44,6 +44,7 @@ type MetricsServerOptions struct {
|
||||
RBACConfig string
|
||||
Options map[string]string
|
||||
MetricsServerImage string
|
||||
Version string
|
||||
}
|
||||
|
||||
type addonError struct {
|
||||
@ -204,10 +205,14 @@ func (c *Cluster) deployKubeDNS(ctx context.Context) error {
|
||||
|
||||
func (c *Cluster) deployMetricServer(ctx context.Context) error {
|
||||
log.Infof(ctx, "[addons] Setting up Metrics Server")
|
||||
s := strings.Split(c.SystemImages.MetricsServer, ":")
|
||||
versionTag := s[len(s)-1]
|
||||
|
||||
MetricsServerConfig := MetricsServerOptions{
|
||||
MetricsServerImage: c.SystemImages.MetricsServer,
|
||||
RBACConfig: c.Authorization.Mode,
|
||||
Options: c.Monitoring.Options,
|
||||
Version: getTagMajorVersion(versionTag),
|
||||
}
|
||||
metricsYaml, err := addons.GetMetricsServerManifest(MetricsServerConfig)
|
||||
if err != nil {
|
||||
|
@ -113,7 +113,13 @@ spec:
|
||||
imagePullPolicy: Always
|
||||
command:
|
||||
- /metrics-server
|
||||
{{- if eq .Version "v0.3" }}
|
||||
- --kubelet-insecure-tls
|
||||
- --kubelet-preferred-address-types=InternalIP
|
||||
- --logtostderr
|
||||
{{- else }}
|
||||
- --source=kubernetes.summary_api:https://kubernetes.default.svc?kubeletHttps=true&kubeletPort=10250&useServiceAccount=true&insecure=true
|
||||
{{- end }}
|
||||
{{ range $k,$v := .Options }}
|
||||
- --{{ $k }}={{ $v }}
|
||||
{{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user