Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minimal cert-manager addon #10318

Merged
merged 2 commits into from
Dec 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,20 @@ spec:

Read more about cluster autoscaler in the [official documentation](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler).

## Cert-manager
{{ kops_feature_table(kops_added_default='1.20', k8s_min='1.16') }}

Cert-manager handles x509 certificates for your cluster.

```yaml
spec:
certManager:
enabled: true
```

**Warning: cert-manager only supports one installation per cluster. If you are already running cert-manager, you need to remove this installation prior to enabling this addon. As long as you are using v1 versions of the cert-manager resources, it is safe to remove existing installs and replace it with this addon**

Read more about cert-managre in the [official documentation](https://cert-manager.io/docs/)

#### Metrics server
{{ kops_feature_table(kops_added_default='1.19') }}
Expand Down
11 changes: 9 additions & 2 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ spec:
rbac:
type: object
type: object
certManager:
description: CertManager determines the metrics server configuration.
properties:
enabled:
description: 'Enabled enables the cert manager. Default: false'
type: boolean
type: object
channel:
description: The Channel we are following
type: string
Expand Down Expand Up @@ -2143,7 +2150,7 @@ spec:
description: MasterPublicName is the external DNS name for the master nodes
type: string
metricsServer:
description: MetricsServerConfig determines the metrics server configuration.
description: MetricsServer determines the metrics server configuration.
properties:
enabled:
description: 'Enabled enables the metrics server. Default: false'
Expand Down Expand Up @@ -2749,7 +2756,7 @@ spec:
type: string
type: array
nodeTerminationHandler:
description: NodeTerminationHandlerConfig determines the cluster autoscaler configuration.
description: NodeTerminationHandler determines the cluster autoscaler configuration.
properties:
enableScheduledEventDraining:
description: 'EnableScheduledEventDraining makes node termination handler drain nodes before the maintenance window starts for an EC2 instance scheduled event. Default: false'
Expand Down
6 changes: 4 additions & 2 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,12 @@ type ClusterSpec struct {
CloudConfig *CloudConfiguration `json:"cloudConfig,omitempty"`
ExternalDNS *ExternalDNSConfig `json:"externalDns,omitempty"`

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

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

// CertManagerConfig determines the cert manager configuration.
type CertManagerConfig struct {
// Enabled enables the cert manager.
// Default: false
Enabled *bool `json:"enabled,omitempty"`
}

// HasAdmissionController checks if a specific admission controller is enabled
func (c *KubeAPIServerConfig) HasAdmissionController(name string) bool {
for _, x := range c.AdmissionControl {
Expand Down
6 changes: 4 additions & 2 deletions pkg/apis/kops/v1alpha2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ type ClusterSpec struct {
CloudConfig *CloudConfiguration `json:"cloudConfig,omitempty"`
ExternalDNS *ExternalDNSConfig `json:"externalDns,omitempty"`

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

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

// CertManagerConfig determines the cert manager configuration.
type CertManagerConfig struct {
// Enabled enables the cert manager.
// Default: false
Enabled *bool `json:"enabled,omitempty"`
}

// HasAdmissionController checks if a specific admission controller is enabled
func (c *KubeAPIServerConfig) HasAdmissionController(name string) bool {
for _, x := range c.AdmissionControl {
Expand Down
48 changes: 48 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.

26 changes: 26 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.

26 changes: 26 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