Skip to content

Commit 614ad18

Browse files
author
Matt Pryor
committed
Add docs and set flag in test manifest
1 parent e2a33a4 commit 614ad18

File tree

2 files changed

+47
-14
lines changed

2 files changed

+47
-14
lines changed

docs/book/src/clusteropenstack/configuration.md

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
44

55
- [Required configuration](#required-configuration)
6-
- [OpenStack Version](#openstack-version)
6+
- [OpenStack version](#openstack-version)
77
- [Operating system image](#operating-system-image)
88
- [SSH key pair](#ssh-key-pair)
99
- [OpenStack credential](#openstack-credential)
@@ -19,6 +19,7 @@
1919
- [Multiple Networks](#multiple-networks)
2020
- [Subnet Filters](#subnet-filters)
2121
- [Ports](#ports)
22+
- [Security groups](#security-groups)
2223
- [Tagging](#tagging)
2324
- [Metadata](#metadata)
2425
- [Boot From Volume](#boot-from-volume)
@@ -77,19 +78,9 @@ openstack keypair create [--public-key <file> | --private-key <file>] <name>
7778

7879
The key pair name must be exposed as an environment variable `OPENSTACK_SSH_KEY_NAME`.
7980

80-
If you want to login to each machine by ssh, you can [access nodes through the bastion host via SSH](#accessing-nodes-through-the-bastion-host-via-ssh). Otherwise you have to configure security groups. If `spec.managedSecurityGroups` of `OpenStackCluster` set to true, two security groups will be created and added to the instances. One is `k8s-cluster-${NAMESPACE}-${CLUSTER_NAME}-secgroup-controlplane`, another is `k8s-cluster-${NAMESPACE}-${CLUSTER_NAME}-secgroup-worker`. These security group rules include the kubeadm's [Check required ports](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#check-required-ports) so that each node can not be logged in through ssh by default. Please add pre-existing security group allowing ssh port to OpenStackMachineTemplate spec. Here is an example:
81-
82-
```yaml
83-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
84-
kind: OpenStackMachineTemplate
85-
metadata:
86-
name: ${CLUSTER_NAME}-control-plane
87-
spec:
88-
template:
89-
spec:
90-
securityGroups:
91-
- name: allow-ssh
92-
```
81+
In order to access cluster nodes via SSH, you must either
82+
[access nodes through the bastion host](#accessing-nodes-through-the-bastion-host-via-ssh)
83+
or [configure custom security groups](#security-groups) with rules allowing ingress for port 22.
9384

9485
## OpenStack credential
9586

@@ -255,6 +246,47 @@ spec:
255246
...
256247
```
257248

249+
## Security groups
250+
251+
Security groups are used to determine which ports of the cluster nodes are accessible from where.
252+
253+
If `spec.managedSecurityGroups` of `OpenStackCluster` is set to `true`, two security groups named
254+
`k8s-cluster-${NAMESPACE}-${CLUSTER_NAME}-secgroup-controlplane` and
255+
`k8s-cluster-${NAMESPACE}-${CLUSTER_NAME}-secgroup-worker` will be created and added to the control
256+
plane and worker nodes respectively.
257+
258+
By default, these groups have rules that allow the following traffic:
259+
260+
* Control plane nodes
261+
* API server traffic from anywhere
262+
* Etcd traffic from other control plane nodes
263+
* Kubelet traffic from other cluster nodes
264+
* Calico CNI traffic from other cluster nodes
265+
* Worker nodes
266+
* Node port traffic from anywhere
267+
* Kubelet traffic from other cluster nodes
268+
* Calico CNI traffic from other cluster nodes
269+
270+
To use a CNI other than Calico, the flag `OpenStackCluster.spec.allowAllInClusterTraffic` can be
271+
set to `true`. With this flag set, the rules for the managed security groups permit all traffic
272+
between cluster nodes on all ports and protocols (API server and node port traffic is still
273+
permitted from anywhere, as with the default rules).
274+
275+
If this is not flexible enough, pre-existing security groups can be added to the
276+
spec of an `OpenStackMachineTemplate`, e.g.:
277+
278+
```yaml
279+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
280+
kind: OpenStackMachineTemplate
281+
metadata:
282+
name: ${CLUSTER_NAME}-control-plane
283+
spec:
284+
template:
285+
spec:
286+
securityGroups:
287+
- name: allow-ssh
288+
```
289+
258290
## Tagging
259291

260292
You have the ability to tag all resources created by the cluster in the `cluster.yaml` file. Here is an example how to configure tagging:

test/e2e/data/infrastructure-openstack/cluster-template-external-cloud-provider.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ spec:
3131
kind: Secret
3232
managedAPIServerLoadBalancer: true
3333
managedSecurityGroups: true
34+
allowAllInClusterTraffic: true
3435
nodeCidr: 10.6.0.0/24
3536
dnsNameservers:
3637
- ${OPENSTACK_DNS_NAMESERVERS}

0 commit comments

Comments
 (0)