Skip to content

Commit

Permalink
climc: k8s component add monitor options
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi committed Apr 29, 2020
1 parent 9061846 commit 8df1559
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions pkg/mcclient/options/k8s/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,45 @@ func (o ClusterEnableComponentCephCSIOpt) Params() (*jsonutils.JSONDict, error)
return params, nil
}

type ClusterComponentMonitorStorage struct {
Enabled bool `help:"Enable this storage" json:"enabled"`
SizeMB int `help:"Persistent storage size MB" json:"sizeMB"`
ClassName string `help:"Storage class name" json:"storageClassName"`
}

type ClusterComponentMonitorGrafana struct {
AdminUser string `help:"Grafana admin user" default:"admin" json:"adminUser"`
AdminPassword string `help:"Grafana admin user password" json:"adminPassword"`
Storage ClusterComponentMonitorStorage `help:"Storage setting"`
}

type ClusterComponentMonitorLoki struct {
Storage ClusterComponentMonitorStorage `help:"Storage setting"`
}

type ClusterComponentMonitorPrometheus struct {
Storage ClusterComponentMonitorStorage `help:"Storage setting"`
}

type ClusterComponentMonitorPromtail struct {
}

type ClusterComponentMonitorSetting struct {
Grafana ClusterComponentMonitorGrafana `help:"Grafana setting" json:"grafana"`
Loki ClusterComponentMonitorLoki `help:"Loki setting" json:"loki"`
Prometheus ClusterComponentMonitorPrometheus `help:"Prometheus setting" json:"prometheus"`
Promtail ClusterComponentMonitorPromtail `help:"Promtail setting" json:"promtail"`
}

type ClusterEnableComponentMonitorOpt struct {
ClusterComponentOptions
ClusterComponentMonitorSetting
}

func (o ClusterEnableComponentMonitorOpt) Params() (*jsonutils.JSONDict, error) {
params := o.ClusterComponentOptions.Params("monitor")
setting := jsonutils.Marshal(o.ClusterComponentMonitorSetting)
params.Add(setting, "monitor")
return params, nil
}

Expand Down

0 comments on commit 8df1559

Please sign in to comment.