소스 검색

Fix OpenStack all-in-one cluster deployment

In order to do an all-in-one deployment, we must be able to set the
labels for all OpenShift roles on the node.

It also fixes the wildcard DNS configuration when there are no infra
nodes.
Tomas Sedovic 6 년 전
부모
커밋
a1a616dea2
3개의 변경된 파일49개의 추가작업 그리고 3개의 파일을 삭제
  1. 43 0
      playbooks/openstack/configuration.md
  2. 3 0
      roles/openshift_openstack/defaults/main.yml
  3. 3 3
      roles/openshift_openstack/templates/heat_stack.yaml.j2

+ 43 - 0
playbooks/openstack/configuration.md

@@ -14,6 +14,7 @@ Environment variables may also be used.
 * [OpenShift Configuration](#openshift-configuration)
 * [Stack Name Configuration](#stack-name-configuration)
 * [DNS Configuration](#dns-configuration)
+* [All-in-one Deployment Configuration](#all-in-one-deployment-configuration)
 * [Kuryr Networking Configuration](#kuryr-networking-configuration)
 * [Provider Network Configuration](#provider-network-configuration)
 * [Multi-Master Configuration](#multi-master-configuration)
@@ -270,6 +271,48 @@ These must point to the publicly-accessible IP addresses of your
 master and infra nodes or preferably to the load balancers.
 
 
+## All-in-one Deployment Configuration
+
+If you want to deploy OpenShift on a single node (e.g. for quick evaluation),
+you can do so with a few configuration changes.
+
+First, set the node counts and labels like so in
+`inventory/group_vars/all.yml`:
+
+```
+openshift_openstack_num_masters: 1
+openshift_openstack_num_infra: 0
+openshift_openstack_num_nodes: 0
+
+openshift_openstack_master_group_name: node-config-all-in-one
+```
+
+Next, define the `node-config-all-in-one` group in `OSEv3.yml`:
+
+```
+openshift_node_groups:
+- name: node-config-all-in-one
+  labels:
+  - 'node-role.kubernetes.io/master=true'
+  - 'node-role.kubernetes.io/infra=true'
+  - 'node-role.kubernetes.io/compute=true'
+```
+
+Then run the deployment playbooks as usual. At the end, you will have an
+OpenShift running on a single OpenStack VM.
+
+The options here define a new OpenShift node group that has the labels for all
+three roles: master, infra and compute. And we create a single node and assign
+this new group to it.
+
+It doesn't matter which node role you choose. You can do the equivalent by
+setting `openshift_openstack_num_infra: 1` and
+`openshift_openstack_infra_group_name: node-config-all-in-one` or
+`openshift_openstack_num_nodes: 1` and `openshift_openstack_compute_group_name:
+node-config-all-in-one`.
+
+
+
 ## Kuryr Networking Configuration
 
 Kuryr is an SDN that uses OpenStack Neutron. This prevents the double overlay

+ 3 - 0
roles/openshift_openstack/defaults/main.yml

@@ -97,6 +97,9 @@ openshift_openstack_node_volume_size: "{{ openshift_openstack_docker_volume_size
 openshift_openstack_etcd_volume_size: 2
 openshift_openstack_lb_volume_size: 5
 openshift_openstack_ephemeral_volumes: false
+openshift_openstack_master_group_name: node-config-master
+openshift_openstack_infra_group_name: node-config-infra
+openshift_openstack_compute_group_name: node-config-compute
 
 # User commands for cloud-init executed on all Nova servers provisioned
 openshift_openstack_provision_user_commands: []

+ 3 - 3
roles/openshift_openstack/templates/heat_stack.yaml.j2

@@ -650,7 +650,7 @@ resources:
                 k8s_type: masters
                 cluster_id: {{ openshift_openstack_full_dns_domain }}
           type:        master
-          openshift_node_group_name: node-config-master
+          openshift_node_group_name: {{ openshift_openstack_master_group_name }}
           image:       {{ openshift_openstack_master_image }}
           flavor:      {{ openshift_openstack_master_flavor }}
           key_name:    {{ openshift_openstack_keypair_name }}
@@ -739,7 +739,7 @@ resources:
                 cluster_id: {{ openshift_openstack_full_dns_domain }}
           type:        node
           subtype:     app
-          openshift_node_group_name: node-config-compute
+          openshift_node_group_name: {{ openshift_openstack_compute_group_name }}
           image:       {{ openshift_openstack_node_image }}
           flavor:      {{ openshift_openstack_node_flavor }}
           key_name:    {{ openshift_openstack_keypair_name }}
@@ -808,7 +808,7 @@ resources:
                 cluster_id: {{ openshift_openstack_full_dns_domain }}
           type:        node
           subtype:     infra
-          openshift_node_group_name: node-config-infra
+          openshift_node_group_name: {{ openshift_openstack_infra_group_name }}
           image:       {{ openshift_openstack_infra_image }}
           flavor:      {{ openshift_openstack_infra_flavor }}
           key_name:    {{ openshift_openstack_keypair_name }}