OpenShift 4 MachineSet management to implement custom machinesets such as to create dedicated compute and infra nodes.
This Ansible role will query the cluster for the default worker machinesets provisioned by the installer and then manage custom machinesets based on the discovered worker configuration information.
As OpenShift 4 is a fast moving target this Ansible role may become obsolete at any time. In particular we hope that the standard OpenShift installer or a standard OpenShift 4 operator will manage custom machinesets such as to render this Ansible role redundant.
Example creating machinesets based on default worker machinesets:
- hosts: localhost
connection: local
gather_facts: no
roles:
- role: openshift_machineset_config
vars:
openshift_machineset_config_disable_default_worker_machinesets: true
openshift_machineset_config_groups:
- name: compute
autoscale: true
role: compute
total_replicas_min: 3
total_replicas_max: 30
aws_instance_type: m4.large
aws_root_volume_size: 80
- name: infra
role: infra
total_replicas: 2
aws_instance_type: m4.large
Example creating machinesets from scratch:
---
- hosts: localhost
connection: local
gather_facts: no
roles:
- role: openshift_machineset_config
vars:
openshift_machineset_config_cloud_provider: aws
openshift_machineset_config_cluster_infra_id: cluster-65b3-gvfpv
openshift_machineset_config_aws_iam_instance_profile_id: cluster-65b3-gvfpv-worker-profile
openshift_machineset_config_aws_security_group_search_key: tag:Name
openshift_machineset_config_aws_security_group_search_value: cluster-65b3-gvfpv-worker-sg
openshift_machineset_config_aws_availability_zones:
- name: us-east-2a
subnet_search_key: tag:Name
subnet_search_value: cluster-65b3-gvfpv-private-us-east-2a
- name: us-east-2b
subnet_search_key: tag:Name
subnet_search_value: cluster-65b3-gvfpv-private-us-east-2b
- name: us-east-2c
subnet_search_key: tag:Name
subnet_search_value: cluster-65b3-gvfpv-private-us-east-2c
openshift_machineset_config_groups:
- name: compute
aws_instance_type: m4.large
aws_root_volume_size: 80
autoscale: true
role: compute
total_replicas_min: 1
total_replicas_max: 30
- name: infra
aws_instance_type: m4.large
role: infra
total_replicas: 1
ansible-galaxy install \
https://github.com/redhat-gpte-devopsautomation/ansible-role-openshift_machineset_config/archive/master.tar.gz#/openshift_machineset_config
Variable | Default | Description |
---|---|---|
|
(detect from default worker machinesets) |
Cloud provider, currently only "aws" is supported. |
|
(detect from default worker machinesets) |
Infrastructure tag and label used to identify cluster. |
|
|
Domain used for custom group label. |
|
|
Label applied to machinesets to identify machinesets managed by this role. |
|
|
Listed of machineset groups, described below. |
|
|
Boolean to indicate if default worker machinesets should be scaled to zero. |
|
|
Value for spec section of ClusterAutoscaler definition, applied if any machineset enables autoscaling. |
Variable | Default | Description |
---|---|---|
|
None |
JSON output of |
|
(detect from default worker machinesets) |
Availability zones for worker machinesets |
|
(detect from default worker machinesets) |
AWS IAM instance profile ID |
|
|
Default AWS instance type. |
|
|
AWS root volume size default in GB |
|
(detect from default worker machinesets) |
Key used to find security group |
|
(detect from default worker machinesets) |
Value used to find security group |
|
Cluster infra id label |
Tags applied to AWS ec2 instances |
openshift_machineset_config_groups
item values
Variable | Default | Description |
---|---|---|
|
(required) |
Name for machineset config group |
|
(optional) |
Value used for default machine and node labels |
|
|
Total number of machineset replicas for non-autoscaling machinesets |
|
|
Boolean to indicate if machineautoscaler should be configured for machinesets |
|
|
Total minimum number of machineset replicas for non-autoscaling machinesets |
|
|
Total maximum number of machineset replicas for non-autoscaling machinesets |
|
|
Default AWS instance type |
|
|
Default root EBS storage disk size |