-
Notifications
You must be signed in to change notification settings - Fork 47
PMM-14287: Add PMM_IP environment variable to openshift-cluster-create job #3517
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
Conversation
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
- Modified deployPMM function to retrieve PMM service IP address - Added logic to get IP from monitoring-service LoadBalancer or ClusterIP - Export PMM_IP as environment variable in the pipeline - Display PMM IP address in post-creation output - Store PMM IP in cluster metadata for reference
- Display PMM IP in the Jenkins job description HTML - Fix incorrect parameter references (MASTER_NODES -> 3, WORKER_NODES -> WORKER_COUNT, etc.) - Fix password reference to use env.PMM_PASSWORD instead of env.PMM_ADMIN_PASSWORD
- Moved all OpenShift cluster management files from cloud/jenkins to pmm/openshift - Updated script paths in YAML files to reflect new location - Aligns with organizational structure changes from PR #3504
…epository - Changed branch from 'feature/openshift-shared-libraries' to 'master' - Updated repository URL from personal fork to official Percona-Lab repository
…sterIP The monitoring-service in PMM namespace is a ClusterIP service (internal only), not a LoadBalancer. The actual public access goes through the OpenShift ingress controller (router-default service in openshift-ingress namespace). This fix: - Gets the public IP from the ingress controller LoadBalancer - Resolves the hostname to IP address for external access - Removes the incorrect fallback to ClusterIP which returns internal IPs Testing confirmed: - Old approach returned 172.30.x.x (internal, not accessible) - New approach returns actual public IP (e.g., 3.129.202.84) - External tools can now connect to PMM using the correct IP
The previous logic was flawed - it would try hostname first and only fall back to IP if hostname wasn't available. But if a provider gives us a direct IP, we should just use it without DNS resolution. New logic: 1. First check if LoadBalancer provides direct IP (GCP, some bare metal) 2. If no IP, check for hostname (AWS, Azure) and resolve it 3. If neither, try to get external IP from worker node (on-prem setups) This ensures we get a working IP address across all cloud providers and deployment scenarios.
Since this is entirely AWS, remove unnecessary fallback logic: - Remove check for direct IP (AWS always provides hostname) - Remove worker node external IP fallback (not applicable to AWS) - Keep only the AWS ELB hostname resolution logic This makes the code cleaner and more maintainable by focusing only on the AWS use case that actually applies.
Closing in favor of PR #3519 (clean branch without cloud/ path in commit history) |
BupycHuk
approved these changes
Sep 1, 2025
- getent is available by default on Oracle Linux 9 Jenkins agents - nslookup requires bind-utils package which may not be installed - Added fallback to nslookup if getent fails for any reason - Tested with real AWS ELB hostnames and confirmed working This ensures DNS resolution works reliably on Jenkins agents without requiring additional packages.
yurkovychv
approved these changes
Sep 1, 2025
valmiranogueira
approved these changes
Sep 1, 2025
EvgeniyPatlan
approved these changes
Sep 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds PMM public IP as environment variable (
PMM_IP
) for downstream jobs.Changes:
PMM_IP
environment variableUsage:
${env.PMM_IP}
(returnsN/A
if unavailable)Jira: PMM-14287