-
Notifications
You must be signed in to change notification settings - Fork 151
Allow running ironic API, conductor and exporter separately #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #!/usr/bin/bash | ||
|
|
||
| # Get environment settings and update ironic.conf | ||
| PROVISIONING_INTERFACE=${PROVISIONING_INTERFACE:-"provisioning"} | ||
| IRONIC_IP=$(ip -4 address show dev "$PROVISIONING_INTERFACE" | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -n 1) | ||
| HTTP_PORT=${HTTP_PORT:-"80"} | ||
| MARIADB_PASSWORD=${MARIADB_PASSWORD:-"change_me"} | ||
| NUMPROC=$(cat /proc/cpuinfo | grep "^processor" | wc -l) | ||
| NUMWORKERS=$(( NUMPROC < 12 ? NUMPROC : 12 )) | ||
|
|
||
| cp /etc/ironic/ironic.conf /etc/ironic/ironic.conf_orig | ||
|
|
||
| crudini --set /etc/ironic/ironic.conf DEFAULT auth_strategy noauth | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT my_ip "$IRONIC_IP" | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT debug true | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT default_network_interface noop | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT enabled_boot_interfaces pxe,ipxe,fake | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT enabled_power_interfaces ipmitool,idrac,fake | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT enabled_management_interfaces ipmitool,idrac,fake | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT enabled_hardware_types ipmi,idrac,fake-hardware | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT enabled_vendor_interfaces ipmitool,no-vendor,idrac,fake | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT enabled_deploy_interfaces direct,fake | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT default_boot_interface ipxe | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT default_deploy_interface direct | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT enabled_inspect_interfaces inspector,idrac,fake | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT default_inspect_interface inspector | ||
| crudini --set /etc/ironic/ironic.conf DEFAULT rpc_transport json-rpc | ||
| crudini --set /etc/ironic/ironic.conf conductor enable_mdns True | ||
| crudini --set /etc/ironic/ironic.conf conductor send_sensor_data true | ||
| crudini --set /etc/ironic/ironic.conf oslo_messaging_notifications driver prometheus_exporter | ||
| crudini --set /etc/ironic/ironic.conf oslo_messaging_notifications transport_url fake:// | ||
| crudini --set /etc/ironic/ironic.conf oslo_messaging_notifications location /shared/ironic_prometheus_exporter | ||
| crudini --set /etc/ironic/ironic.conf dhcp dhcp_provider none | ||
| crudini --set /etc/ironic/ironic.conf conductor automated_clean true | ||
| crudini --set /etc/ironic/ironic.conf conductor api_url http://${IRONIC_IP}:6385 | ||
| crudini --set /etc/ironic/ironic.conf database connection mysql+pymysql://ironic:${MARIADB_PASSWORD}@localhost/ironic?charset=utf8 | ||
| crudini --set /etc/ironic/ironic.conf deploy http_url http://${IRONIC_IP}:${HTTP_PORT} | ||
| crudini --set /etc/ironic/ironic.conf deploy http_root /shared/html/ | ||
| crudini --set /etc/ironic/ironic.conf deploy default_boot_option local | ||
| crudini --set /etc/ironic/ironic.conf deploy erase_devices_priority 0 | ||
| crudini --set /etc/ironic/ironic.conf deploy erase_devices_metadata_priority 10 | ||
| crudini --set /etc/ironic/ironic.conf inspector endpoint_override http://${IRONIC_IP}:5050 | ||
| crudini --set /etc/ironic/ironic.conf pxe ipxe_enabled true | ||
| crudini --set /etc/ironic/ironic.conf pxe tftp_root /shared/tftpboot | ||
| crudini --set /etc/ironic/ironic.conf pxe tftp_master_path /shared/tftpboot | ||
| crudini --set /etc/ironic/ironic.conf pxe instance_master_path /shared/html/master_images | ||
| crudini --set /etc/ironic/ironic.conf pxe images_path /shared/html/tmp | ||
| crudini --set /etc/ironic/ironic.conf pxe pxe_config_template \$pybasedir/drivers/modules/ipxe_config.template | ||
| crudini --set /etc/ironic/ironic.conf pxe uefi_pxe_config_template \$pybasedir/drivers/modules/ipxe_config.template | ||
| crudini --set /etc/ironic/ironic.conf agent deploy_logs_collect always | ||
| crudini --set /etc/ironic/ironic.conf agent deploy_logs_local_path /shared/log/ironic/deploy | ||
| crudini --set /etc/ironic/ironic.conf api api_workers "$NUMWORKERS" | ||
|
|
||
| mkdir -p /shared/html | ||
| mkdir -p /shared/ironic_prometheus_exporter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/usr/bin/bash | ||
|
|
||
| . /bin/configure-ironic.sh | ||
|
|
||
| # Allow access to Ironic | ||
| if ! iptables -C INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT > /dev/null 2>&1; then | ||
| iptables -I INPUT -i "$PROVISIONING_INTERFACE" -p tcp -m tcp --dport 6385 -j ACCEPT | ||
| fi | ||
|
|
||
| ironic-dbsync --config-file /etc/ironic/ironic.conf upgrade | ||
|
|
||
| exec /usr/bin/ironic-api --config-file /etc/ironic/ironic.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/usr/bin/bash | ||
|
|
||
| . /bin/configure-ironic.sh | ||
|
|
||
| # Allow access to mDNS | ||
| if ! iptables -C INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT > /dev/null 2>&1; then | ||
| iptables -I INPUT -i $PROVISIONING_INTERFACE -p udp --dport 5353 -j ACCEPT | ||
| fi | ||
| if ! iptables -C OUTPUT -p udp --dport 5353 -j ACCEPT > /dev/null 2>&1; then | ||
| iptables -I OUTPUT -p udp --dport 5353 -j ACCEPT | ||
| fi | ||
|
|
||
| # Ramdisk logs | ||
| mkdir -p /shared/log/ironic/deploy | ||
|
|
||
| ironic-dbsync --config-file /etc/ironic/ironic.conf upgrade | ||
|
|
||
| exec /usr/bin/ironic-conductor --config-file /etc/ironic/ironic.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/usr/bin/bash | ||
|
|
||
| . /bin/configure-ironic.sh | ||
|
|
||
| # TODO(dtantsur): merge these two scripts when/if we no longer support | ||
| # all-in-one container | ||
| /bin/runexporterapp | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not quite clear to me what this means, is this referring to when we use a different image for ironic-prometheus-exporter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point I'd prefer to avoid adding any new images - we already have two critical tasks (machine-api-opearator integration of the baremetal operator, and cluster hosted ironic) blocked on getting forks of the existing images into openshift, adding any more right at this moment is likely to further delay things, which we really, really do need to avoid :)
That said we can start planning for new images to be used in future, but just not right now when those critical tasks are still pending.