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

Support for config IP when genegrate pki certificate #636

Merged
merged 1 commit into from
Jun 12, 2023
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
3 changes: 3 additions & 0 deletions pkg/apis/config/v1alpha1/kwokctl_configuration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ type KwokctlConfigurationOptions struct {
// BindAddress is the address to bind to.
// +default="0.0.0.0"
BindAddress string `json:"bindAddress,omitempty"`

// KubeApiserverCertSANs sets extra Subject Alternative Names for the API Server signing cert.
KubeApiserverCertSANs []string `json:"kubeApiserverCertSANs,omitempty"`
}

// Component is a component of the cluster.
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/config/v1alpha1/zz_generated.deepcopy.go

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

3 changes: 3 additions & 0 deletions pkg/apis/internalversion/kwokctl_configuration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ type KwokctlConfigurationOptions struct {

// BindAddress is the address to bind to.
BindAddress string

// KubeApiserverCertSANs sets extra Subject Alternative Names for the API Server signing cert.
KubeApiserverCertSANs []string
}

// Component is a component of the cluster.
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/internalversion/zz_generated.conversion.go

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

5 changes: 5 additions & 0 deletions pkg/apis/internalversion/zz_generated.deepcopy.go

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

3 changes: 3 additions & 0 deletions pkg/kwokctl/runtime/binary/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ func (c *Cluster) setup(ctx context.Context) error {
} else {
sans = append(sans, ips...)
}
if len(conf.KubeApiserverCertSANs) != 0 {
sans = append(sans, conf.KubeApiserverCertSANs...)
}
err = pki.GeneratePki(pkiPath, sans...)
if err != nil {
return fmt.Errorf("failed to generate pki: %w", err)
Expand Down
3 changes: 3 additions & 0 deletions pkg/kwokctl/runtime/compose/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func (c *Cluster) setup(ctx context.Context) error {
} else {
sans = append(sans, ips...)
}
if len(conf.KubeApiserverCertSANs) != 0 {
sans = append(sans, conf.KubeApiserverCertSANs...)
}
err = pki.GeneratePki(pkiPath, sans...)
if err != nil {
return fmt.Errorf("failed to generate pki: %w", err)
Expand Down
11 changes: 11 additions & 0 deletions site/content/en/docs/generated/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -2428,6 +2428,17 @@ string
<p>BindAddress is the address to bind to.</p>
</td>
</tr>
<tr>
<td>
<code>kubeApiserverCertSANs</code>
<em>
[]string
</em>
</td>
<td>
<p>KubeApiserverCertSANs sets extra Subject Alternative Names for the API Server signing cert.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="config.kwok.x-k8s.io/v1alpha1.Port">
Expand Down