Skip to content

Commit

Permalink
Merge pull request #7524 from zetaab/remove_insecure
Browse files Browse the repository at this point in the history
remove default insecure from openstack
  • Loading branch information
k8s-ci-robot authored Sep 6, 2019
2 parents 5501724 + daac327 commit 520b247
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 17 deletions.
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

0 comments on commit 520b247

Please sign in to comment.