Skip to content

feat: automated creation of Azure NAT Gateway#44

Merged
butler54 merged 1 commit intovalidatedpatterns:mainfrom
sabre1041:azure-nat-gateway
May 22, 2025
Merged

feat: automated creation of Azure NAT Gateway#44
butler54 merged 1 commit intovalidatedpatterns:mainfrom
sabre1041:azure-nat-gateway

Conversation

@sabre1041
Copy link
Copy Markdown
Collaborator

@sabre1041 sabre1041 commented May 15, 2025

Automation to create and associate an Azure NAT Gateway to the worker subnet to resolve #42

@sabre1041 sabre1041 force-pushed the azure-nat-gateway branch from e9720cc to 010cd72 Compare May 15, 2025 11:11
@sabre1041 sabre1041 marked this pull request as ready for review May 15, 2025 13:11
Comment on lines +12 to +19
- name: Get Azure credentials
kubernetes.core.k8s_info:
kind: Secret
namespace: openshift-cloud-controller-manager
name: azure-cloud-credentials
register: azure_credentials
retries: 20
delay: 5
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just make this a safe exit? if we are not on azure in the future a clean exit would be nice.

Copy link
Copy Markdown
Collaborator Author

@sabre1041 sabre1041 May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had been thinking about it, but we should holistically do it across the board

such as: https://github.com/sabre1041/coco-pattern/blob/main/ansible/configure-issuer.yaml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I agree. I'll raise an issue to chart the development of the feature as we discussed offline.

@butler54 butler54 self-requested a review May 15, 2025 13:49
@butler54 butler54 changed the title Automated creation of Azure NAT Gateway feat: Automated creation of Azure NAT Gateway May 19, 2025
@butler54 butler54 changed the title feat: Automated creation of Azure NAT Gateway feat: automated creation of Azure NAT Gateway May 20, 2025
Copy link
Copy Markdown
Collaborator

@butler54 butler54 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small change and we are good to go.

Comment thread ansible/azure-nat-gateway.yaml Outdated
ansible.builtin.set_fact:
azure_subscription_id: "{{ (azure_cloud_conf.resources[0]['data']['cloud.conf'] | from_json)['subscriptionId'] }}"
azure_tenant_id: "{{ (azure_cloud_conf.resources[0]['data']['cloud.conf'] | from_json)['tenantId'] }}"
azure_resource_group: "{{ (azure_cloud_conf.resources[0]['data']['cloud.conf'] | from_json)['resourceGroup'] }}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be vnetResourceGroup which is different to resourceGroup on ARO

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on PO azure it should be the same

Signed-off-by: Andrew Block <andy.block@gmail.com>
@sabre1041 sabre1041 force-pushed the azure-nat-gateway branch from 3735b60 to 6b6a2b9 Compare May 22, 2025 01:25
Copy link
Copy Markdown
Collaborator

@butler54 butler54 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@butler54 butler54 merged commit a902547 into validatedpatterns:main May 22, 2025
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate creation of NAT gateway for peerpods is required on Azure

2 participants