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

remove default insecure from openstack #7524

Merged
merged 1 commit into from
Sep 6, 2019
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
14 changes: 14 additions & 0 deletions docs/tutorial/openstack.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,17 @@ kops create cluster \
```

The biggest problem currently when installing without loadbalancer is that kubectl requests outside cluster is always going to first master. External loadbalancer is one option which can solve this issue.

# Using with self-signed certificates in OpenStack

Kops can be configured to use insecure mode towards OpenStack. However, this is **NOT** recommended as OpenStack cloudprovider in kubernetes does not support it.
If you use insecure flag in kops - it might be that the cluster does not work correctly.

```
spec:
...
cloudConfig:
openstack:
insecureSkipVerify: true
...
```
9 changes: 5 additions & 4 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,11 @@ type OpenstackRouter struct {

// OpenstackConfiguration defines cloud config elements for the openstack cloud provider
type OpenstackConfiguration struct {
Loadbalancer *OpenstackLoadbalancerConfig `json:"loadbalancer,omitempty"`
Monitor *OpenstackMonitor `json:"monitor,omitempty"`
Router *OpenstackRouter `json:"router,omitempty"`
BlockStorage *OpenstackBlockStorageConfig `json:"blockStorage,omitempty"`
Loadbalancer *OpenstackLoadbalancerConfig `json:"loadbalancer,omitempty"`
Monitor *OpenstackMonitor `json:"monitor,omitempty"`
Router *OpenstackRouter `json:"router,omitempty"`
BlockStorage *OpenstackBlockStorageConfig `json:"blockStorage,omitempty"`
InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
}

// CloudConfiguration defines the cloud provider configuration
Expand Down
9 changes: 5 additions & 4 deletions pkg/apis/kops/v1alpha1/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,11 @@ type OpenstackRouter struct {

// OpenstackConfiguration defines cloud config elements for the openstack cloud provider
type OpenstackConfiguration struct {
Loadbalancer *OpenstackLoadbalancerConfig `json:"loadbalancer,omitempty"`
Monitor *OpenstackMonitor `json:"monitor,omitempty"`
Router *OpenstackRouter `json:"router,omitempty"`
BlockStorage *OpenstackBlockStorageConfig `json:"blockStorage,omitempty"`
Loadbalancer *OpenstackLoadbalancerConfig `json:"loadbalancer,omitempty"`
Monitor *OpenstackMonitor `json:"monitor,omitempty"`
Router *OpenstackRouter `json:"router,omitempty"`
BlockStorage *OpenstackBlockStorageConfig `json:"blockStorage,omitempty"`
InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
}

// CloudConfiguration defines the cloud provider configuration
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha1/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/kops/v1alpha1/zz_generated.deepcopy.go

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

9 changes: 5 additions & 4 deletions pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,11 @@ type OpenstackRouter struct {

// OpenstackConfiguration defines cloud config elements for the openstack cloud provider
type OpenstackConfiguration struct {
Loadbalancer *OpenstackLoadbalancerConfig `json:"loadbalancer,omitempty"`
Monitor *OpenstackMonitor `json:"monitor,omitempty"`
Router *OpenstackRouter `json:"router,omitempty"`
BlockStorage *OpenstackBlockStorageConfig `json:"blockStorage,omitempty"`
Loadbalancer *OpenstackLoadbalancerConfig `json:"loadbalancer,omitempty"`
Monitor *OpenstackMonitor `json:"monitor,omitempty"`
Router *OpenstackRouter `json:"router,omitempty"`
BlockStorage *OpenstackBlockStorageConfig `json:"blockStorage,omitempty"`
InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
}

// CloudConfiguration defines the cloud provider configuration
Expand Down
2 changes: 2 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.

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

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

12 changes: 7 additions & 5 deletions upup/pkg/fi/cloudup/openstack/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,13 @@ func NewOpenstackCloud(tags map[string]string, spec *kops.ClusterSpec) (Openstac
return nil, fmt.Errorf("error finding openstack region: %v", err)
}

tlsconfig := &tls.Config{}
tlsconfig.InsecureSkipVerify = true
transport := &http.Transport{TLSClientConfig: tlsconfig}
provider.HTTPClient = http.Client{
Transport: transport,
if spec != nil && spec.CloudConfig != nil && spec.CloudConfig.Openstack != nil && spec.CloudConfig.Openstack.InsecureSkipVerify != nil {
tlsconfig := &tls.Config{}
tlsconfig.InsecureSkipVerify = fi.BoolValue(spec.CloudConfig.Openstack.InsecureSkipVerify)
transport := &http.Transport{TLSClientConfig: tlsconfig}
provider.HTTPClient = http.Client{
Transport: transport,
}
}

klog.V(2).Info("authenticating to keystone")
Expand Down