Skip to content

Commit

Permalink
Add metrics-server addon
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Markus With committed Oct 8, 2020
1 parent 31c9a59 commit 75b2a87
Show file tree
Hide file tree
Showing 13 changed files with 876 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/metrics-server/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Kubernetes Metrics Server

**This addon is deprecated. Set `spec.metricsServer.enabled: true` instead**

## User guide

You can find the user guide in
Expand Down
10 changes: 10 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,16 @@ spec:
masterPublicName:
description: MasterPublicName is the external DNS name for the master nodes
type: string
metricsServer:
description: MetricsServerConfig determines the metrics server configuration.
properties:
enabled:
description: 'Enabled enables the metrics server. Default: false'
type: boolean
image:
description: 'Image is the docker container used. Default: the latest supported image for the specified kubernetes version.'
type: string
type: object
networkCIDR:
description: NetworkCIDR is the CIDR used for the AWS VPC / GCE Network, or otherwise allocated to k8s This is a real CIDR, not the internal k8s network On AWS, it maps to the VPC CIDR. It is not required on GCE.
type: string
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ type ClusterSpec struct {

// NodeTerminationHandlerConfig determines the cluster autoscaler configuration.
NodeTerminationHandler *NodeTerminationHandlerConfig `json:"nodeTerminationHandler,omitempty"`
// MetricsServerConfig determines the metrics server configuration.
MetricsServer *MetricsServerConfig `json:"metricsServer,omitempty"`

// Networking configuration
Networking *NetworkingSpec `json:"networking,omitempty"`
Expand Down
10 changes: 10 additions & 0 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,16 @@ type ClusterAutoscalerConfig struct {
Image *string `json:"image,omitempty"`
}

// MetricsServerConfig determines the metrics server configuration.
type MetricsServerConfig struct {
// Enabled enables the metrics server.
// Default: false
Enabled *bool `json:"enabled,omitempty"`
// Image is the docker container used.
// Default: the latest supported image for the specified kubernetes version.
Image *string `json:"image,omitempty"`
}

// HasAdmissionController checks if a specific admission controller is enabled
func (c *KubeAPIServerConfig) HasAdmissionController(name string) bool {
for _, x := range c.AdmissionControl {
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ type ClusterSpec struct {

// NodeTerminationHandlerConfig determines the cluster autoscaler configuration.
NodeTerminationHandler *NodeTerminationHandlerConfig `json:"nodeTerminationHandler,omitempty"`
// MetricsServerConfig determines the metrics server configuration.
MetricsServer *MetricsServerConfig `json:"metricsServer,omitempty"`

// Networking configuration
Networking *NetworkingSpec `json:"networking,omitempty"`
Expand Down
10 changes: 10 additions & 0 deletions pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,16 @@ type ClusterAutoscalerConfig struct {
Image *string `json:"image,omitempty"`
}

// MetricsServerConfig determines the metrics server configuration.
type MetricsServerConfig struct {
// Enabled enables the metrics server.
// Default: false
Enabled *bool `json:"enabled,omitempty"`
// Image is the docker container used.
// Default: the latest supported image for the specified kubernetes version.
Image *string `json:"image,omitempty"`
}

// HasAdmissionController checks if a specific admission controller is enabled
func (c *KubeAPIServerConfig) HasAdmissionController(name string) bool {
for _, x := range c.AdmissionControl {
Expand Down
50 changes: 50 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 75b2a87

Please sign in to comment.