Skip to content
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
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ PKG := $(shell awk -F "\"" '/^ignored = / { print $$2 }' Gopkg.toml)
DEST := $(GOPATH)/src/$(GIT_HOST)/$(BASE_DIR)
SOURCES := $(shell find $(DEST) -name '*.go')

HAS_MERCURIAL := $(shell command -v hg;)
HAS_DEP := $(shell command -v dep;)
HAS_LINT := $(shell command -v golint;)
HAS_GOX := $(shell command -v gox;)
Expand Down Expand Up @@ -68,7 +67,7 @@ test: unit functional

check: depend fmt vet lint

unit: depend
unit: generate depend
go test -tags=unit $(shell go list ./...) $(TESTARGS)

functional:
Expand All @@ -87,7 +86,7 @@ endif
vet:
go vet ./...

cover: depend
cover: generate depend
go test -tags=unit $(shell go list ./...) -cover

docs:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,7 @@ your openstack Cluster API Kubernetes cluster.
```bash
rm -rf $HOME/.ssh/openstack_tmp*
```

### Trouble shooting

Please refer to [Trouble shooting documentation](docs/trouble_shooting.md) for further info.
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,50 @@ spec:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
cloudName:
description: The name of the cloud to use from the clouds secret
type: string
cloudsSecret:
description: The name of the secret containing the openstack credentials
type: object
disableServerTags:
description: 'Default: True. In case of server tag errors, set to False'
type: boolean
dnsNameservers:
description: DNSNameservers is the list of nameservers for OpenStack Subnet
being created.
items:
type: string
type: array
externalNetworkId:
description: ExternalNetworkID is the ID of an external OpenStack Network.
This is necessary to get public internet to the VMs.
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
managedSecurityGroups:
description: ManagedSecurityGroups defines that kubernetes manages the OpenStack
security groups for now, that means that we'll create two security groups,
one allowing SSH and API access from everywhere, and another one that
allows all traffic to/from machines belonging to that group. In the future,
we could make this more flexible.
type: boolean
metadata:
type: object
nodeCidr:
description: NodeCIDR is the OpenStack Subnet to be created. Cluster actuator
will create a network, a subnet with NodeCIDR, and a router connected
to this subnet. If you leave this empty, no network will be created.
type: string
tags:
description: Tags for all resources in cluster
items:
type: string
type: array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ spec:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
controlPlaneSecurityGroup:
description: 'ControlPlaneSecurityGroups contains all the information about
the OpenStack Security Group that needs to be applied to control plane
nodes. TODO: Maybe instead of two properties, we add a property to the
group?'
properties:
id:
type: string
Expand Down Expand Up @@ -63,6 +70,9 @@ spec:
- rules
type: object
globalSecurityGroup:
description: GlobalSecurityGroup contains all the information about the
OpenStack Security Group that needs to be applied to all nodes, both control
plane and worker nodes.
properties:
id:
type: string
Expand Down Expand Up @@ -109,10 +119,15 @@ spec:
- rules
type: object
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
network:
description: Network contains all information about the created OpenStack
Network. It includes Subnets and Router.
properties:
id:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,53 @@ spec:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
type: string
availabilityZone:
description: The availability zone from which to launch the server.
type: string
cloudName:
description: The name of the cloud to use from the clouds secret
type: string
cloudsSecret:
description: The name of the secret containing the openstack credentials
type: object
configDrive:
description: Config Drive support
type: boolean
flavor:
description: The flavor reference for the flavor for your server instance.
type: string
floatingIP:
description: The floatingIP which will be associated to the machine, only
used for master. The floatingIP should have been created and haven't been
associated.
type: string
image:
description: The name of the image to use for your server instance. If the
RootVolume is specified, this will be ignored and use rootVolume directly.
type: string
keyName:
description: The ssh key to inject in the instance
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
type: string
metadata:
type: object
networks:
description: A networks object. Required parameter when there are multiple
networks defined for the tenant. When you do not specify the networks
parameter, the server attaches to the only network created for the current
tenant.
items:
properties:
filter:
description: Filters for optional network query
properties:
adminStateUp:
type: boolean
Expand Down Expand Up @@ -76,11 +98,14 @@ spec:
type: string
type: object
fixedIp:
description: A fixed IPv4 address for the NIC.
type: string
subnets:
description: Subnet within a network to use
items:
properties:
filter:
description: Filters for optional network query
properties:
cidr:
type: string
Expand All @@ -93,6 +118,10 @@ spec:
ipVersion:
format: int64
type: integer
ipv6AddressMode:
type: string
ipv6RaMode:
type: string
limit:
format: int64
type: integer
Expand Down Expand Up @@ -122,14 +151,19 @@ spec:
type: string
type: object
uuid:
description: The UUID of the network. Required if you omit the
port attribute.
type: string
type: object
type: array
uuid:
description: The UUID of the network. Required if you omit the port
attribute.
type: string
type: object
type: array
rootVolume:
description: The volume metadata to boot from
properties:
deviceType:
type: string
Expand All @@ -144,9 +178,11 @@ spec:
- deviceType
type: object
securityGroups:
description: The names of the security groups to assign to the instance
items:
properties:
filter:
description: Filters used to query security groups in openstack
properties:
description:
type: string
Expand Down Expand Up @@ -177,22 +213,31 @@ spec:
type: string
type: object
name:
description: Security Group name
type: string
uuid:
description: Security Group UID
type: string
type: object
type: array
serverMetadata:
description: Metadata mapping. Allows you to create a map of key value pairs
to add to the server instance.
type: object
sshUserName:
description: The machine ssh username
type: string
tags:
description: Machine tags Requires Nova api 2.52 minimum!
items:
type: string
type: array
trunk:
description: Whether the server instance is created on a trunk port or not.
type: boolean
userDataSecret:
description: The name of the secret containing the user data (startup script
in most cases)
type: object
required:
- cloudsSecret
Expand Down
4 changes: 4 additions & 0 deletions config/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ metadata:
controller-tools.k8s.io: "1.0"
spec:
replicas: 1
selector:
matchLabels:
control-plane: controller-manager
controller-tools.k8s.io: "1.0"
template:
metadata:
labels:
Expand Down
1 change: 1 addition & 0 deletions config/rbac/rbac_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ rules:
- ""
resources:
- nodes
- events
verbs:
- get
- list
Expand Down
6 changes: 6 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,9 @@ Instead of tagging, you also have the option to add metadata to instances. This
securityGroups:
...
```

## Timeout settings
During some heavy workload cloud, the time for create and delete openstack instance might takes long time, by default it's 5 minute.
you can set:
`CLUSTER_API_OPENSTACK_INSTANCE_DELETE_TIMEOUT` for instance delete timeout value.
`CLUSTER_API_OPENSTACK_INSTANCE_CREATE_TIMEOUT` for instance create timeout value.
20 changes: 20 additions & 0 deletions docs/trouble_shooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Trouble shooting

This guide (based on minikube and others should be similar) explains general info on how to debug issues if cluster failed to create.

## Get log of clusterapi-controllers containers

1. Get openstack container name, the output depends on the system you are running.
the `minikube.kubeconfig` which is bootstrap cluster's kubeconfig by default locates at `cmd/clusterctl` folder.

```
# kubectl --kubeconfig minikube.kubeconfig get pods -n openstack-provider-system
NAMESPACE NAME READY STATUS RESTARTS AGE
openstack-provider-system clusterapi-controllers-xxxxxxxxx-xxxxx 1/1 Running 0 27m
```

2. Get log of clusterapi-controllers-xxxxxxxx-xxxxx

```
# kubectl --kubeconfig minikube.kubeconfig log clusterapi-controllers-xxxxxxxxx-xxxxx -n openstack-provider-system
```
4 changes: 4 additions & 0 deletions overlays-config/coreos/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
control-plane: controller-manager
controller-tools.k8s.io: "1.0"
spec:
selector:
matchLabels:
control-plane: controller-manager
controller-tools.k8s.io: "1.0"
template:
spec:
volumes:
Expand Down
4 changes: 4 additions & 0 deletions overlays-config/generic/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
control-plane: controller-manager
controller-tools.k8s.io: "1.0"
spec:
selector:
matchLabels:
control-plane: controller-manager
controller-tools.k8s.io: "1.0"
template:
spec:
volumes:
Expand Down
6 changes: 0 additions & 6 deletions pkg/apis/openstackproviderconfig/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,6 @@ type OpenstackClusterProviderStatus struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// CACertificate is a PEM encoded CA Certificate for the control plane nodes.
CACertificate []byte

// CAPrivateKey is a PEM encoded PKCS1 CA PrivateKey for the control plane nodes.
CAPrivateKey []byte

// Network contains all information about the created OpenStack Network.
// It includes Subnets and Router.
Network *Network `json:"network,omitempty"`
Expand Down
Loading