Chapter 8. Troubleshooting
8.1. Review your cluster notifications Copy linkLink copied to clipboard!
Use cluster notifications to help you resolve cluster problems. Cluster notifications are messages about the status, health, or performance of your cluster. Red Hat Site Reliability Engineering (SRE) uses these notifications to communicate about the health and problem resolution of your clusters.
8.1.1. View cluster notifications using the Hybrid Cloud Console Copy linkLink copied to clipboard!
Cluster notifications give important information about the health of your cluster. You can view notifications sent to your cluster in the Cluster history tab on the Red Hat Hybrid Cloud Console.
Prerequisites
- You have logged in to the Hybrid Cloud Console.
Procedure
- Navigate to the Clusters page of the Hybrid Cloud Console.
- Click the name of your cluster to go to the cluster details page.
Click the Cluster history tab.
Cluster notifications appear under the Cluster history heading.
Optional: Filter for relevant cluster notifications.
Use the filter controls to hide cluster notifications that are not relevant to you, so that you can focus on your area of expertise or on resolving a critical issue. You can filter notifications based on text in the notification description, severity level, notification type, when you received the notification, and the system or person that triggered the notification.
8.2. Troubleshooting Red Hat OpenShift Service on AWS cluster installations Copy linkLink copied to clipboard!
Troubleshoot the installation of Red Hat OpenShift Service on AWS clusters by completing the following instructions.
8.2.1. Installation troubleshooting Copy linkLink copied to clipboard!
This procedure describes how to troubleshoot installation issues for Red Hat OpenShift Service on AWS clusters.
Procedure
Inspect install or uninstall logs:
To display install logs, run the following command, replacing
<cluster_name>with the name of your cluster:$ rosa logs install --cluster=<cluster_name>To watch the logs, include the
--watchflag:$ rosa logs install --cluster=<cluster_name> --watchTo display uninstall logs, run the following command, replacing
<cluster_name>with the name of your cluster:$ rosa logs uninstall --cluster=<cluster_name>To watch the logs, include the
--watchflag:$ rosa logs uninstall --cluster=<cluster_name> --watch
Verify your AWS account and quota:
Run the following command to verify you have the available quota on your AWS account:
$ rosa verify quotaAWS quotas change based on region. Be sure you are verifying your quota for the correct AWS region. If you need to increase your quota, go to your AWS console, and request a quota increase for the service that failed.
AWS notification emails:
When creating a cluster, the Red Hat OpenShift Service on AWS service creates small instances in all supported regions. This check ensures the AWS account being used can deploy to each supported region.
For AWS accounts that are not using all supported regions, AWS might send one or more emails confirming that "Your Request For Accessing AWS Resources Has Been Validated." Typically the sender of this email is aws-verification@amazon.com.
This is expected behavior as the Red Hat OpenShift Service on AWS service is validating your AWS account configuration.
8.2.2. Verify installation of Red Hat OpenShift Service on AWS clusters Copy linkLink copied to clipboard!
If the Red Hat OpenShift Service on AWS cluster is in the installing state for over 30 minutes and has not become ready, ensure the AWS account environment is prepared for the required cluster configurations. If the AWS account environment is prepared for the required cluster configurations correctly, try to delete and re-create the cluster. If the problem persists, contact support.
Procedure
- Verify the AWS account environment is prepared for the required cluster configurations.
- If the AWS account environment is prepared correctly, try to delete and re-create the cluster.
- If the problem persists, contact support.
8.2.3. Troubleshoot Red Hat OpenShift Service on AWS installation error codes Copy linkLink copied to clipboard!
The following table lists Red Hat OpenShift Service on AWS installation error codes and what you can do to troubleshoot these errors.
| Error code | Description | Resolution |
|---|---|---|
| OCM3999 | Unknown error. | Check the cluster installation logs for more details, or delete this cluster and retry cluster installation. If this issue persists, contact Red Hat support. See Additional resources for more information. |
| OCM5001 | Red Hat OpenShift Service on AWS cluster provision has failed. | Check the cluster installation logs for more details, or delete this cluster and retry cluster installation. If this issue persists, contact Red Hat support. See Additional resources for more information. |
| OCM5002 | The maximum resource tag size of 25 has been exceeded. | Check the cluster information to determine if you can remove any unnecessary tags you have specified and retry cluster installation. |
| OCM5003 | Unable to establish an AWS client to provision the cluster. | You must create several role resources on your AWS account to create and manage a Red Hat OpenShift Service on AWS cluster. Ensure that your provided AWS credentials are correct and retry cluster installation. For more information about Red Hat OpenShift Service on AWS IAM role resources, see ROSA IAM role resources in the Additional resources section. |
| OCM5004 | Unable to establish a cross-account AWS client to provision the cluster. | You must create several role resources on your AWS account to create and manage a Red Hat OpenShift Service on AWS cluster. Ensure that your provided AWS credentials are correct and retry cluster installation. For more information about Red Hat OpenShift Service on AWS IAM role resources, see ROSA IAM role resources in the Additional resources section. |
| OCM5005 | Failed to retrieve AWS subnets defined for the cluster. | Review the provided subnet IDs and retry cluster installation. |
| OCM5006 | You must configure at least one private AWS subnet for the cluster. | Review the provided subnet IDs and retry cluster installation. |
| OCM5007 | Unable to create AWS STS prerequisites for the cluster. | Verify that account and operator roles have been created and are correct. For more information, see AWS STS and ROSA with HCP explained in the Additional resources section. |
| OCM5008 | The provided cluster flavour is incorrect. | Verify that the provided name or ID is correct when you are using the flavour parameter and retry cluster creation. |
| OCM5009 | The cluster version could not be found. | Ensure that the configured version ID matches a valid Red Hat OpenShift Service on AWS version. |
| OCM5010 | Failed to tag subnets for the cluster. | Confirm that the AWS permissions and the subnet configurations are correct. You must tag at least one private subnet and, if applicable, one public subnet. |
| OCM5011 | Cluster installation has failed due to unavailable capacity in the selected region. | Try your cluster installation in another region or retry cluster installation. |
8.2.4. Troubleshoot access to Red Hat Hybrid Cloud Console Copy linkLink copied to clipboard!
In Red Hat OpenShift Service on AWS clusters, the Red Hat OpenShift Service on AWS OAuth server is hosted in the Red Hat service’s AWS account while the web console service is published by using the cluster’s default ingress controller in the cluster’s AWS account. If you can log in to your cluster by using the OpenShift CLI (oc) but cannot access the Red Hat OpenShift Service on AWS web console, verify the following criteria are met:
Procedure
- Verify the console workloads are running.
- Verify the default ingress controller’s load balancer is active.
- Verify you are accessing the console from a machine that has network connectivity to the cluster’s VPC network.
8.2.5. Verify access to Red Hat OpenShift Service on AWS web console for Red Hat OpenShift Service on AWS cluster in ready state Copy linkLink copied to clipboard!
Red Hat OpenShift Service on AWS clusters return a ready status when the control plane hosted in the Red Hat OpenShift Service on AWS service account becomes ready. Cluster console workloads are deployed on the cluster’s worker nodes. The Red Hat OpenShift Service on AWS web console will not be available and accessible until the worker nodes have joined the cluster and console workloads are running.
Procedure
If your Red Hat OpenShift Service on AWS cluster is ready but you are unable to access the Red Hat OpenShift Service on AWS web console for the cluster, wait for the worker nodes to join the cluster and retry accessing the console.
You can either log in to the Red Hat OpenShift Service on AWS cluster or use the
rosa describe machinepoolcommand in therosaCLI watch the nodes.
8.2.6. Verify access to Red Hat Hybrid Cloud Console for private Red Hat OpenShift Service on AWS clusters Copy linkLink copied to clipboard!
The console of the private cluster is private by default. During cluster installation, the default Ingress Controller managed by OpenShift’s Ingress Operator is configured with an internal AWS Network Load Balancer (NLB).
Procedure
-
If your private Red Hat OpenShift Service on AWS cluster shows a
readystatus but you cannot access the Red Hat OpenShift Service on AWS web console for the cluster, try accessing the cluster console from either within the cluster VPC or from a network that is connected to the VPC.
8.3. Troubleshooting networking Copy linkLink copied to clipboard!
Troubleshoot networking errors by completing the following instructions.
8.3.1. Connectivity issues on clusters with private network load balancers Copy linkLink copied to clipboard!
Private AWS NLBs preserve client IP addresses, which can drop connections when the source and destination are on the same host. Workloads on the same node as router pods might not reach the private NLB fronting the ingress controller.
Red Hat OpenShift Service on AWS clusters created with version 4 deploy AWS Network Load Balancers (NLB) by default for the default ingress controller. See the AWS documentation about how to Troubleshoot your Network Load Balancer.
Procedure
- To mitigate this impact, reschedule your workloads onto nodes separate from those where the router pods run. Or, rely on the internal pod and service networks for accessing other workloads co-located within the same cluster.
8.4. Verifying node health Copy linkLink copied to clipboard!
You can verify and troubleshoot node-related issues by reviewing the status, resource usage, and configuration of a node.
8.4.1. Review node status, resource usage, and configuration Copy linkLink copied to clipboard!
Review cluster node health status, resource consumption statistics, and node logs. Additionally, query kubelet status on individual nodes.
Prerequisites
-
You have access to the cluster as a user with the
dedicated-adminrole. -
You have installed the OpenShift CLI (
oc).
Procedure
List the name, status, and role for all nodes in the cluster:
$ oc get nodesSummarize CPU and memory usage for each node within the cluster:
$ oc adm top nodesSummarize CPU and memory usage for a specific node:
$ oc adm top node my-node
8.5. Troubleshoot Red Hat build of Karpenter configuration and operational issues Copy linkLink copied to clipboard!
Understanding common failure categories for the Red Hat build of Karpenter helps you quickly identify the root cause and restore automatic scaling capabilities. Use the following table to identify which procedure addresses your symptom:
| Symptom | Procedure |
|---|---|
| Karpenter Custom Resource Definitions (CRDs) are not visible after enabling the Red Hat build of Karpenter | |
|
EC2NodeClass shows | |
|
CloudTrail shows | Resolve AWS Identity and Access Management (IAM) permissions for AWS resource tagging |
8.5.1. Prerequisites Copy linkLink copied to clipboard!
- You have enabled the Red Hat build of Karpenter on your Red Hat OpenShift Service on AWS cluster.
-
You have
cluster-adminprivileges. -
You have installed the
ocCLI and authenticated to your cluster. -
You have installed the
rosaCLI and authenticated. -
You have installed the
jqcommand-line JSON processor. -
You have installed and configured the
awsCLI.
8.5.2. About Red Hat build of Karpenter troubleshooting Copy linkLink copied to clipboard!
The Red Hat build of Karpenter uses the Karpenter controller to provide automated node provisioning in OpenShift clusters. When the Red Hat build of Karpenter fails to provision nodes or reports configuration errors, you can diagnose and resolve issues by examining Karpenter resource status, AWS infrastructure tags, and AWS Identity and Access Management (IAM) permissions.
Red Hat build of Karpenter troubleshooting addresses the main failure categories:
- Controller deployment issues
- Karpenter Custom Resource Definitions (CRDs) do not appear after enabling the Red Hat build of Karpenter, preventing you from creating or managing Karpenter resources.
- AWS resource discovery failures
- The EC2NodeClass resource cannot discover AWS subnets or security groups because required discovery tags are missing or incorrect.
- IAM permission issues
- The control plane Operator does not have the authorization to create tags on AWS resources, preventing Karpenter from properly configuring security groups.
8.5.2.1. General diagnostic workflow Copy linkLink copied to clipboard!
Follow this workflow to diagnose and resolve Red Hat build of Karpenter issues:
- Identify the symptom by checking which Karpenter resources are missing or not ready.
-
Gather diagnostic data using
occommands to inspect custom resource status and AWS CLI commands to verify infrastructure configuration. - Analyze the root cause by comparing observed resource state with expected configuration.
- Apply the resolution by adding missing tags, updating IAM policies, or verifying capabilities.
- Verify the fix by confirming that Karpenter resources reach ready status and automatic scaling functions correctly.
8.5.2.2. When to escalate to Red Hat Support Copy linkLink copied to clipboard!
Escalate to Red Hat Support in these situations:
- Karpenter CRDs do not appear after 5 minutes and the Karpenter controller pod is not running.
- EC2NodeClass remains not ready after adding all required discovery tags and waiting 60 seconds.
- IAM policies are correctly attached but CloudTrail continues showing authorization errors.
When escalating, provide:
- Cluster ID
-
Output of
rosa describe cluster -c $CLUSTER_ID -o json -
Output of
oc get ec2nodeclass/default -o json -
Output of
oc get pods -n kube-system - CloudTrail event details for authorization errors
8.5.3. Karpenter resource readiness conditions Copy linkLink copied to clipboard!
The EC2NodeClass resource reports readiness through status conditions that indicate whether Karpenter successfully discovered and validated AWS resources. Each condition reports a boolean status and explains why the condition is true or false. Understanding these conditions helps you identify which AWS resources require configuration changes.
| Condition | Status values | Meaning |
|---|---|---|
|
|
|
The Amazon Machine Images (AMI) selector matched available AMIs in the AWS region. If |
|
|
|
The subnet selector matched private subnets with the required Karpenter discovery tag. If |
|
|
|
The security group selector matched security groups with the required Karpenter discovery tag. If |
|
|
|
The IAM instance profile exists and is accessible to Karpenter. If |
|
|
|
The EC2NodeClass specification passed validation. If |
|
|
|
Overall readiness status. This condition is |
8.5.3.1. Common failure messages Copy linkLink copied to clipboard!
When EC2NodeClass conditions report False status, the message field provides details about the failure:
SubnetSelectordid not match any Subnets-
No subnets in your VPC have the required
karpenter.sh/discoverytag. Add the tag to all private subnets where Karpenter should provision nodes. SecurityGroupSelectordid not match anySecurityGroups-
No security groups have the required
karpenter.sh/discoverytag. Add the tag to the default security group and any additional security groups Karpenter should use. UnhealthyDependents-
The
Readycondition shows this message when one or more dependent conditions areFalse. The message lists which specific conditions are not ready, for example:SecurityGroupsReady=False, SubnetsReady=False.
8.5.3.2. Query EC2NodeClass condition status Copy linkLink copied to clipboard!
Use the oc command-line interface to inspect EC2NodeClass status conditions and identify which AWS resources require configuration changes.
Procedure
To view the full condition status for an EC2NodeClass, run:
$ oc get ec2nodeclass/default -o json | jq .status.conditionsThe output displays all condition types with their status, reason, and explanatory message.
Optional: To view only the overall
Readycondition, run:$ oc get ec2nodeclass/default -o json | jq '.status.conditions[] | select(.type=="Ready")'The output shows the
Readycondition type, status, reason, and message explaining why the condition is in that state.
Verification
-
Review the output to identify which conditions show
"status": "False". -
Check the
messagefield for each failed condition to determine what AWS resources need configuration changes.
8.5.4. Verify Karpenter CRDs are installed Copy linkLink copied to clipboard!
After enabling the Red Hat build of Karpenter on a Red Hat OpenShift Service on AWS cluster, the Karpenter controller automatically creates Custom Resource Definitions (CRDs) in your cluster. If Karpenter CRDs do not appear within several minutes, you can check the controller deployment status.
Procedure
Check for Karpenter CRDs:
$ oc get crd | grep karpenterExample output
ec2nodeclasses.karpenter.k8s.aws nodeclaims.karpenter.sh nodepools.karpenter.sh openshiftec2nodeclasses.karpenter.hypershift.openshift.io- If CRDs are not present, wait 5 minutes for the Karpenter controller to create them. The controller deployment can take several minutes to complete after enabling the Red Hat build of Karpenter.
After 5 minutes, if CRDs are still not present, check whether the Karpenter controller pod is running:
$ oc get pods -n kube-system | grep karpenterThe output should show a Karpenter controller pod in
Runningstatus.If the controller pod is not running or CRDs are still missing after 5 minutes, escalate to Red Hat Support. Provide the following diagnostic information:
- Your cluster ID
-
Output of
rosa describe cluster -c $CLUSTER_ID -o json -
Output of
oc get pods -n kube-system
8.5.5. Resolve EC2NodeClass not ready status Copy linkLink copied to clipboard!
Karpenter discovers AWS subnets and security groups by searching for resources tagged with a cluster-specific discovery tag. When the EC2NodeClass resource reports SubnetsReady or SecurityGroupsReady conditions as False, you need to add the required discovery tag to your AWS Virtual Private Cloud (VPC) resources.
Procedure
Check the EC2NodeClass status:
$ oc get ec2nodeclass/default -o json | jq .status.conditionsThis command displays all status conditions for the default EC2NodeClass.
Identify which conditions are not ready by looking for entries with
"status": "False".Common failures are
SubnetsReadyandSecurityGroupsReady.-
If
SubnetsReadyshowsFalsewith the message "SubnetSelector did not match any Subnets", private subnets in your VPC are missing the required discovery tag. Continue to the next step. -
If
SecurityGroupsReadyshowsFalsewith message "SecurityGroupSelector did not match any SecurityGroups", security groups are missing the required discovery tag. The same resolution process applies for both subnets and security groups. Get the Karpenter discovery tag value from the EC2NodeClass specification:
$ oc get ec2nodeclass/default -o json | jq -r '.spec.subnetSelectorTerms[0].tags["karpenter.sh/discovery"]'Example output
<discovery_tag_value>This cluster-specific value must be added as a tag to AWS resources.
List private subnets in your cluster VPC:
$ aws ec2 describe-subnets --filters "Name=vpc-id,Values=<vpc_id>" \ --query 'Subnets[?MapPublicIpOnLaunch==`false`].[SubnetId,Tags]' --output tableReplace
<vpc_id>with your cluster’s VPC ID.For each private subnet, verify whether the Karpenter discovery tag is present:
$ aws ec2 describe-subnets --subnet-ids <subnet_id> \ --query 'Subnets[0].Tags[?Key==`karpenter.sh/discovery`].Value' --output textReplace
<subnet_id>with the subnet ID to check.If the discovery tag is missing, add it to the subnet:
$ aws ec2 create-tags --resources <subnet_id> \ --tags Key=karpenter.sh/discovery,Value=<discovery_tag_value>Replace
<subnet_id>with the subnet ID and<discovery_tag_value>with the value from step 5.- Repeat steps 7 and 8 for all private subnets in your VPC.
Verify that the default security group has the discovery tag:
$ aws ec2 describe-security-groups --group-ids <default_sg_id> \ --query 'SecurityGroups[0].Tags[?Key==`karpenter.sh/discovery`].Value' --output textReplace
<default_sg_id>with your cluster’s default security group ID.If the discovery tag is missing from the security group, add it:
$ aws ec2 create-tags --resources <default_sg_id> \ --tags Key=karpenter.sh/discovery,Value=<discovery_tag_value>Replace
<default_sg_id>with the security group ID and<discovery_tag_value>with the value from step 5.- Wait 30 to 60 seconds for Karpenter to re-scan AWS resources.
Verify that the EC2NodeClass Ready condition is now
True:$ oc get ec2nodeclass/default -o json | jq '.status.conditions[] | select(.type=="Ready")'The output should show
"status": "True".-
If the Ready condition is still
False, check for other condition failures in the output and repeat the appropriate steps.
Verification
The EC2NodeClass Ready condition reports
Truestatus:$ oc get ec2nodeclass/default -o json | jq '.status.conditions[] | select(.type=="Ready")'The SubnetsReady and SecurityGroupsReady conditions report
Truestatus:$ oc get ec2nodeclass/default -o json | jq '.status.conditions[] | select(.type=="SubnetsReady" or .type=="SecurityGroupsReady")'All required AWS resources have the correct
karpenter.sh/discoverytag:$ aws ec2 describe-subnets --subnet-ids <subnet_id> \ --query 'Subnets[0].Tags[?Key==`karpenter.sh/discovery`].Value' --output text
Troubleshooting
- If adding tags fails with authorization errors
- You need to update IAM permissions for the control plane operator. See "Resolve IAM permissions for AWS resource tagging".
- If the EC2NodeClass remains not ready after adding tags
- Verify that the tag value exactly matches the value in the EC2NodeClass specification. Tag values are case-sensitive and must match character-for-character.
8.5.6. Resolve IAM permissions for AWS resource tagging Copy linkLink copied to clipboard!
The Karpenter controller requires permission to create tags on AWS security groups. When the control plane operator IAM role lacks the ec2:CreateTags permission, Karpenter cannot automatically tag security groups with the discovery tag.
Procedure
Identify the IAM role used by the control plane operator:
$ aws iam list-roles | grep kube-system-control-plane-operatorThe role name follows the pattern
<cluster_prefix>-kube-system-control-plane-operator.Optional: Verify the authorization error in AWS CloudTrail:
- Navigate to the AWS CloudTrail console.
Search for events matching these criteria:
-
Event name:
CreateTags -
Error code:
Client.UnauthorizedOperation -
User identity: Contains
control-plane-operator
If you find matching events, the error message confirms that the IAM role lacks
ec2:CreateTagspermission.-
Event name:
Create an IAM policy document that allows creating tags:
$ cat > /tmp/create-tags-policy.json << 'POLICY_EOF' { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowCreateTags", "Effect": "Allow", "Action": [ "ec2:CreateTags" ], "Resource": "*" } ] } POLICY_EOFAttach the policy to the control plane operator IAM role:
$ aws iam put-role-policy \ --role-name <cluster_prefix>-kube-system-control-plane-operator \ --policy-name KarpenterCreateTags \ --policy-document file:///tmp/create-tags-policy.jsonReplace
<cluster_prefix>with your cluster’s prefix from step 1.Verify that the policy is attached to the role:
$ aws iam get-role-policy \ --role-name <cluster_prefix>-kube-system-control-plane-operator \ --policy-name KarpenterCreateTagsThe output shows the policy document you attached.
Verification
The IAM policy is successfully attached to the control plane operator role:
$ aws iam get-role-policy \ --role-name <cluster_prefix>-kube-system-control-plane-operator \ --policy-name KarpenterCreateTagsThis command returns the policy document without errors.
-
AWS CloudTrail no longer shows
Client.UnauthorizedOperationerrors for CreateTags operations performed by the control plane operator. -
If your EC2NodeClass previously showed
SecurityGroupsReady = False, you can now manually add the Karpenter discovery tag to the default security group. After you add the tag, the authorization error will not recur because the IAM role now has the required permissions.
8.6. Troubleshooting Operator issues Copy linkLink copied to clipboard!
A cluster administrator can do the following to resolve Operator issues: verify Operator subscription status, check Operator pod health, and gather Operator logs.
Operators are a method of packaging, deploying, and managing an Red Hat OpenShift Service on AWS application. They act like an extension of the software vendor’s engineering team, watching over an Red Hat OpenShift Service on AWS environment and using its current state to make decisions in real time. Operators are designed to handle upgrades seamlessly, react to failures automatically, and not take shortcuts, such as skipping a software backup process to save time.
Red Hat OpenShift Service on AWS 4 includes a default set of Operators that are required for proper functioning of the cluster. These default Operators are managed by the Cluster Version Operator (CVO).
As a cluster administrator, you can install application Operators from the software catalog using the Red Hat OpenShift Service on AWS web console or the CLI. You can then subscribe the Operator to one or more namespaces to make it available for developers on your cluster. Application Operators are managed by Operator Lifecycle Manager (OLM).
If you experience Operator issues, verify Operator subscription status. Check Operator pod health across the cluster and gather Operator logs for diagnosis.
8.6.1. Operator subscription condition types Copy linkLink copied to clipboard!
Subscriptions can report the following condition types:
| Condition | Description |
|---|---|
|
| Some or all of the catalog sources to be used in resolution are unhealthy. |
|
| An install plan for a subscription is missing. |
|
| An install plan for a subscription is pending installation. |
|
| An install plan for a subscription has failed. |
|
| The dependency resolution for a subscription has failed. |
Default Red Hat OpenShift Service on AWS cluster Operators are managed by the Cluster Version Operator (CVO) and they do not have a Subscription object. Application Operators are managed by Operator Lifecycle Manager (OLM) and they have a Subscription object.
8.6.2. View Operator subscription status by using the CLI Copy linkLink copied to clipboard!
You can view Operator subscription status by using the CLI.
Prerequisites
-
You have access to the cluster as a user with the
dedicated-adminrole. -
You have installed the OpenShift CLI (
oc).
Procedure
List Operator subscriptions:
$ oc get subs -n <operator_namespace>Use the
oc describecommand to inspect aSubscriptionresource:$ oc describe sub <subscription_name> -n <operator_namespace>In the command output, find the
Conditionssection for the status of Operator subscription condition types. In the following example, theCatalogSourcesUnhealthycondition type has a status offalsebecause all available catalog sources are healthy:Example output
Name: cluster-logging Namespace: openshift-logging Labels: operators.coreos.com/cluster-logging.openshift-logging= Annotations: <none> API Version: operators.coreos.com/v1alpha1 Kind: Subscription # ... Conditions: Last Transition Time: 2019-07-29T13:42:57Z Message: all available catalogsources are healthy Reason: AllCatalogSourcesHealthy Status: False Type: CatalogSourcesUnhealthy # ...NoteDefault Red Hat OpenShift Service on AWS cluster Operators are managed by the Cluster Version Operator (CVO) and they do not have a
Subscriptionobject. Application Operators are managed by Operator Lifecycle Manager (OLM) and they have aSubscriptionobject.
8.6.3. View Operator catalog source status by using the CLI Copy linkLink copied to clipboard!
You can view the status of an Operator catalog source by using the CLI.
Prerequisites
-
You have access to the cluster as a user with the
dedicated-adminrole. -
You have installed the OpenShift CLI (
oc).
Procedure
List the catalog sources in a namespace. For example, you can check the
openshift-marketplacenamespace, which is used for cluster-wide catalog sources:$ oc get catalogsources -n openshift-marketplaceExample output
NAME DISPLAY TYPE PUBLISHER AGE certified-operators Certified Operators grpc Red Hat 55m community-operators Community Operators grpc Red Hat 55m example-catalog Example Catalog grpc Example Org 2m25s redhat-operators Red Hat Operators grpc Red Hat 55mUse the
oc describecommand to get more details and status about a catalog source:$ oc describe catalogsource example-catalog -n openshift-marketplaceExample output
Name: example-catalog Namespace: openshift-marketplace Labels: <none> Annotations: operatorframework.io/managed-by: marketplace-operator target.workload.openshift.io/management: {"effect": "PreferredDuringScheduling"} API Version: operators.coreos.com/v1alpha1 Kind: CatalogSource # ... Status: Connection State: Address: example-catalog.openshift-marketplace.svc:50051 Last Connect: 2021-09-09T17:07:35Z Last Observed State: TRANSIENT_FAILURE Registry Service: Created At: 2021-09-09T17:05:45Z Port: 50051 Protocol: grpc Service Name: example-catalog Service Namespace: openshift-marketplace # ...In the preceding example output, the last observed state is
TRANSIENT_FAILURE. This state indicates that there is a problem establishing a connection for the catalog source.List the pods in the namespace where your catalog source was created:
$ oc get pods -n openshift-marketplaceExample output
NAME READY STATUS RESTARTS AGE certified-operators-cv9nn 1/1 Running 0 36m community-operators-6v8lp 1/1 Running 0 36m marketplace-operator-86bfc75f9b-jkgbc 1/1 Running 0 42m example-catalog-bwt8z 0/1 ImagePullBackOff 0 3m55s redhat-operators-smxx8 1/1 Running 0 36mWhen a catalog source is created in a namespace, a pod for the catalog source is created in that namespace. In the preceding example output, the status for the
example-catalog-bwt8zpod isImagePullBackOff. This status indicates that there is an issue pulling the catalog source’s index image.Use the
oc describecommand to inspect a pod for more detailed information:$ oc describe pod example-catalog-bwt8z -n openshift-marketplaceExample output
Name: example-catalog-bwt8z Namespace: openshift-marketplace Priority: 0 Node: ci-ln-jyryyg2-f76d1-ggdbq-worker-b-vsxjd/10.0.128.2 ... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 48s default-scheduler Successfully assigned openshift-marketplace/example-catalog-bwt8z to ci-ln-jyryyf2-f76d1-fgdbq-worker-b-vsxjd Normal AddedInterface 47s multus Add eth0 [10.131.0.40/23] from openshift-sdn Normal BackOff 20s (x2 over 46s) kubelet Back-off pulling image "quay.io/example-org/example-catalog:v1" Warning Failed 20s (x2 over 46s) kubelet Error: ImagePullBackOff Normal Pulling 8s (x3 over 47s) kubelet Pulling image "quay.io/example-org/example-catalog:v1" Warning Failed 8s (x3 over 47s) kubelet Failed to pull image "quay.io/example-org/example-catalog:v1": rpc error: code = Unknown desc = reading manifest v1 in quay.io/example-org/example-catalog: unauthorized: access to the requested resource is not authorized Warning Failed 8s (x3 over 47s) kubelet Error: ErrImagePullIn the preceding example output, the error messages indicate that the catalog source’s index image is failing to pull successfully because of an authorization issue. For example, the index image might be stored in a registry that requires login credentials.
8.6.5. Query Operator pod status Copy linkLink copied to clipboard!
You can list Operator pods within a cluster and their status. You can also collect a detailed Operator pod summary.
Prerequisites
-
You have access to the cluster as a user with the
dedicated-adminrole. - Your API service is still functional.
-
You have installed the OpenShift CLI (
oc).
Procedure
List Operators running in the cluster. The output includes Operator version, availability, and up-time information:
$ oc get clusteroperatorsList Operator pods running in the Operator’s namespace, plus pod status, restarts, and age:
$ oc get pod -n <operator_namespace>Output a detailed Operator pod summary:
$ oc describe pod <operator_pod_name> -n <operator_namespace>
8.7. Investigating pod issues Copy linkLink copied to clipboard!
Red Hat OpenShift Service on AWS leverages the Kubernetes concept of a pod, which is one or more containers deployed together on one host. A pod is the smallest compute unit that can be defined, deployed, and managed on Red Hat OpenShift Service on AWS 4.
After a pod is defined, it is assigned to run on a node until its containers exit, or until it is removed. Depending on policy and exit code, pods are either removed after exiting or retained so that their logs can be accessed.
The first thing to check when pod issues arise is the pod’s status. If an explicit pod failure has occurred, observe the pod’s error state to identify specific image, container, or pod network issues. Focus diagnostic data collection according to the error state. Review pod event messages, as well as pod and container log information. Diagnose issues dynamically by accessing running Pods on the command line, or start a debug pod with root access based on a problematic pod’s deployment configuration.
8.7.1. Understand pod error states Copy linkLink copied to clipboard!
Pod failures return explicit error states that can be observed in the status field in the output of oc get pods. Pod error states cover image, container, and container network related failures.
The following table provides a list of pod error states along with their descriptions.
| Pod error state | Description |
|---|---|
|
| Generic image retrieval error. |
|
| Image retrieval failed and is backed off. |
|
| The specified image name was invalid. |
|
| Image inspection did not succeed. |
|
|
|
|
| When attempting to retrieve an image from a registry, an HTTP error was encountered. |
|
| The specified container is either not present or not managed by the kubelet, within the declared pod. |
|
| Container initialization failed. |
|
| None of the pod’s containers started successfully. |
|
| None of the pod’s containers were killed successfully. |
|
| A container has terminated. The kubelet will not attempt to restart it. |
|
| A container or image attempted to run with root privileges. |
|
| Pod sandbox creation did not succeed. |
|
| Pod sandbox configuration was not obtained. |
|
| A pod sandbox did not stop successfully. |
|
| Network initialization failed. |
|
| Network termination failed. |
8.7.2. Review pod status Copy linkLink copied to clipboard!
You can query pod status and error states. You can also query a pod’s associated deployment configuration and review base image availability.
Prerequisites
-
You have access to the cluster as a user with the
dedicated-adminrole. -
You have installed the OpenShift CLI (
oc). -
skopeois installed.
Procedure
Switch into a project:
$ oc project <project_name>List pods running within the namespace, as well as pod status, error states, restarts, and age:
$ oc get podsDetermine whether the namespace is managed by a deployment configuration:
$ oc statusIf the namespace is managed by a deployment configuration, the output includes the deployment configuration name and a base image reference.
Inspect the base image referenced in the preceding command’s output:
$ skopeo inspect docker://<image_reference>If the base image reference is not correct, update the reference in the deployment configuration:
$ oc edit deployment/my-deploymentWhen deployment configuration changes on exit, the configuration will automatically redeploy. Watch pod status as the deployment progresses, to determine whether the issue has been resolved:
$ oc get pods -wReview events within the namespace for diagnostic information relating to pod failures:
$ oc get events
8.7.3. Inspect pod and container logs Copy linkLink copied to clipboard!
You can inspect pod and container logs for warnings and error messages related to explicit pod failures. Depending on policy and exit code, pod and container logs remain available after pods have been terminated.
Prerequisites
-
You have access to the cluster as a user with the
dedicated-adminrole. - Your API service is still functional.
-
You have installed the OpenShift CLI (
oc).
Procedure
Query logs for a specific pod:
$ oc logs <pod_name>Query logs for a specific container within a pod:
$ oc logs <pod_name> -c <container_name>Logs retrieved using the preceding
oc logscommands are composed of messages sent to stdout within pods or containers.Inspect logs contained in
/var/log/within a pod.List log files and subdirectories contained in
/var/logwithin a pod:$ oc exec <pod_name> -- ls -alh /var/logExample output
total 124K drwxr-xr-x. 1 root root 33 Aug 11 11:23 . drwxr-xr-x. 1 root root 28 Sep 6 2022 .. -rw-rw----. 1 root utmp 0 Jul 10 10:31 btmp -rw-r--r--. 1 root root 33K Jul 17 10:07 dnf.librepo.log -rw-r--r--. 1 root root 69K Jul 17 10:07 dnf.log -rw-r--r--. 1 root root 8.8K Jul 17 10:07 dnf.rpm.log -rw-r--r--. 1 root root 480 Jul 17 10:07 hawkey.log -rw-rw-r--. 1 root utmp 0 Jul 10 10:31 lastlog drwx------. 2 root root 23 Aug 11 11:14 openshift-apiserver drwx------. 2 root root 6 Jul 10 10:31 private drwxr-xr-x. 1 root root 22 Mar 9 08:05 rhsm -rw-rw-r--. 1 root utmp 0 Jul 10 10:31 wtmpQuery a specific log file contained in
/var/logwithin a pod:$ oc exec <pod_name> cat /var/log/<path_to_log>Example output
2023-07-10T10:29:38+0000 INFO --- logging initialized --- 2023-07-10T10:29:38+0000 DDEBUG timer: config: 13 ms 2023-07-10T10:29:38+0000 DEBUG Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager, uploadprofile 2023-07-10T10:29:38+0000 INFO Updating Subscription Management repositories. 2023-07-10T10:29:38+0000 INFO Unable to read consumer identity 2023-07-10T10:29:38+0000 INFO Subscription Manager is operating in container mode. 2023-07-10T10:29:38+0000 INFOList log files and subdirectories contained in
/var/logwithin a specific container:$ oc exec <pod_name> -c <container_name> ls /var/logQuery a specific log file contained in
/var/logwithin a specific container:$ oc exec <pod_name> -c <container_name> cat /var/log/<path_to_log>
8.7.4. Access running pods Copy linkLink copied to clipboard!
You can review running pods dynamically by opening a shell inside a pod or by gaining network access through port forwarding.
Prerequisites
-
You have access to the cluster as a user with the
dedicated-adminrole. - Your API service is still functional.
-
You have installed the OpenShift CLI (
oc).
Procedure
Switch into the project that contains the pod you would like to access. This is necessary because the
oc rshcommand does not accept the-nnamespace option:$ oc project <namespace>Start a remote shell into a pod:
$ oc rsh <pod_name>where:
<pod_name>-
If a pod has multiple containers,
oc rshdefaults to the first container unless-c <container_name>is specified.
Start a remote shell into a specific container within a pod:
$ oc rsh -c <container_name> pod/<pod_name>Create a port forwarding session to a port on a pod:
$ oc port-forward <pod_name> <host_port>:<pod_port>where:
<pod_name> <host_port>:<pod_port>-
Enter
Ctrl+Cto cancel the port forwarding session.
8.7.5. Start debug pods with root access Copy linkLink copied to clipboard!
You can start a debug pod with root access, based on a problematic pod’s deployment or deployment configuration. Pod users typically run with non-root privileges, but running troubleshooting pods with temporary root privileges can be useful during issue investigation.
Prerequisites
-
You have access to the cluster as a user with the
dedicated-adminrole. - Your API service is still functional.
-
You have installed the OpenShift CLI (
oc).
Procedure
Start a debug pod with root access, based on a deployment.
Obtain a project’s deployment name:
$ oc get deployment -n <project_name>Start a debug pod with root privileges, based on the deployment:
$ oc debug deployment/my-deployment --as-root -n <project_name>
Start a debug pod with root access, based on a deployment configuration.
Obtain a project’s deployment configuration name:
$ oc get deploymentconfigs -n <project_name>Start a debug pod with root privileges, based on the deployment configuration:
$ oc debug deploymentconfig/my-deployment-configuration --as-root -n <project_name>NoteYou can append
-- <command>to the precedingoc debugcommands to run individual commands within a debug pod, instead of running an interactive shell.
8.7.6. Copy files to and from pods and containers Copy linkLink copied to clipboard!
You can copy files to and from a pod to test configuration changes or gather diagnostic information.
Prerequisites
-
You have access to the cluster as a user with the
dedicated-adminrole. - Your API service is still functional.
-
You have installed the OpenShift CLI (
oc).
Procedure
Copy a file to a pod:
$ oc cp <local_path> <pod_name>:/<path> -c <container_name>-c <container_name>refers to the desired container in a pod. If you do not specify a container with the-coption, then the first container in a pod is selected.Copy a file from a pod:
$ oc cp <pod_name>:/<path> -c <container_name> <local_path>-c <container_name>refers to the desired container in a pod. If you do not specify a container with the-coption, then the first container in a pod is selected.NoteFor
oc cpto function, thetarbinary must be available within the container.
8.8. Troubleshooting the Source-to-Image process Copy linkLink copied to clipboard!
A cluster administrator can observe the S2I stages to determine where in the S2I process a failure occurred and gather diagnostic data to resolve Source-to-Image issues.
8.8.1. Strategies for Source-to-Image troubleshooting Copy linkLink copied to clipboard!
Use Source-to-Image (S2I) to build reproducible, Docker-formatted container images. You can create ready-to-run images by injecting application source code into a container image and assembling a new image. The new image incorporates the base image (the builder) and built source.
Procedure
To determine where in the S2I process a failure occurs, you can observe the state of the pods relating to each of the following S2I stages:
- During the build configuration stage, a build pod is used to create an application container image from a base image and application source code.
- During the deployment configuration stage, a deployment pod is used to deploy application pods from the application container image that was built in the build configuration stage. The deployment pod also deploys other resources such as services and routes. The deployment configuration begins after the build configuration succeeds.
-
After the deployment pod has started the application pods, application failures can occur within the running application pods. For instance, an application might not behave as expected even though the application pods are in a
Runningstate. In this scenario, you can access running application pods to investigate application failures within a pod.
When troubleshooting S2I issues, follow this strategy:
- Monitor build, deployment, and application pod status.
- Determine the stage of the S2I process where the problem occurred.
- Review logs corresponding to the failed stage.
8.8.2. Gather Source-to-Image diagnostic data Copy linkLink copied to clipboard!
The S2I tool runs a build pod and a deployment pod in sequence. The deployment pod is responsible for deploying the application pods based on the application container image created in the build stage.
Watch build, deployment and application pod status to determine where in the S2I process a failure occurs. Then, focus diagnostic data collection accordingly.
Prerequisites
-
You have access to the cluster as a user with the
cluster-adminrole. - Your API service is still functional.
-
You have installed the OpenShift CLI (
oc).
Procedure
Watch the pod status throughout the S2I process to determine at which stage a failure occurs:
$ oc get pods -wUse the
-wflag to monitor pods for changes until you quit the command usingCtrl+C.Review a failed pod’s logs for errors.
If the build pod fails, review the build pod’s logs:
$ oc logs -f pod/<application_name>-<build_number>-buildNoteAlternatively, you can review the build configuration’s logs using
oc logs -f bc/<application_name>. The build configuration’s logs include the logs from the build pod.If the deployment pod fails, review the deployment pod’s logs:
$ oc logs -f pod/<application_name>-<build_number>-deployNoteAlternatively, you can review the deployment configuration’s logs using
oc logs -f dc/<application_name>. This outputs logs from the deployment pod until the deployment pod completes successfully. The command outputs logs from the application pods if you run it after the deployment pod has completed. After a deployment pod completes, its logs can still be accessed by runningoc logs -f pod/<application_name>-<build_number>-deploy.If an application pod fails, or if an application is not behaving as expected within a running application pod, review the application pod’s logs:
$ oc logs -f pod/<application_name>-<build_number>-<random_string>
8.8.3. Gather application diagnostic data to investigate application failures Copy linkLink copied to clipboard!
Application failures can occur within running application pods. In these situations, you can retrieve diagnostic information with these strategies:
- Review events relating to the application pods.
- Review the logs from the application pods, including application-specific log files that are not collected by the OpenShift Logging framework.
- Test application functionality interactively and run diagnostic tools in an application container.
Prerequisites
-
You have access to the cluster as a user with the
cluster-adminrole. -
You have installed the OpenShift CLI (
oc).
Procedure
List events relating to a specific application pod. The following example retrieves events for an application pod named
my-app-1-akdlg:$ oc describe pod/my-app-1-akdlgReview logs from an application pod:
$ oc logs -f pod/my-app-1-akdlgQuery specific logs within a running application pod. Logs that are sent to stdout are collected by the OpenShift Logging framework and are included in the output of the preceding command. The following query is only required for logs that are not sent to stdout.
If an application log can be accessed without root privileges within a pod, concatenate the log file as follows:
$ oc exec my-app-1-akdlg -- cat /var/log/my-application.logIf root access is required to view an application log, you can start a debug container with root privileges and then view the log file from within the container. Start the debug container from the project’s
DeploymentConfigobject. Pod users typically run with non-root privileges, but running troubleshooting pods with temporary root privileges can be useful during issue investigation:$ oc debug dc/my-deployment-configuration --as-root -- cat /var/log/my-application.logNoteYou can access an interactive shell with root access within the debug pod if you run
oc debug dc/<deployment_configuration> --as-rootwithout appending-- <command>.
Test application functionality interactively and run diagnostic tools, in an application container with an interactive shell.
Start an interactive shell on the application container:
$ oc exec -it my-app-1-akdlg /bin/bash- Test application functionality interactively from within the shell. For example, you can run the container’s entry point command and observe the results. Then, test changes from the command line directly, before updating the source code and rebuilding the application container through the S2I process.
Run diagnostic binaries available within the container.
NoteRoot privileges are required to run some diagnostic binaries. In these situations you can start a debug pod with root access, based on a problematic pod’s
DeploymentConfigobject, by runningoc debug dc/<deployment_configuration> --as-root. Then, you can run diagnostic binaries as root from within the debug pod.
If diagnostic binaries are not available within a container, you can run a host’s diagnostic binaries within a container’s namespace by using
nsenter. The following example runsip adwithin a container’s namespace, using the host`sipbinary.Enter into a debug session on the target node. This step instantiates a debug pod called
<node_name>-debug:$ oc debug node/my-cluster-nodeSet
/hostas the root directory within the debug shell. The debug pod mounts the host’s root file system in/hostwithin the pod. By changing the root directory to/host, you can run binaries contained in the host’s executable paths:# chroot /hostNoteRed Hat OpenShift Service on AWS 4 cluster nodes running Red Hat Enterprise Linux CoreOS (RHCOS) are immutable and rely on Operators to apply cluster changes. Accessing cluster nodes by using SSH is not recommended. However, if the Red Hat OpenShift Service on AWS API is not available, or the kubelet is not properly functioning on the target node,
ocoperations will be impacted. In such situations, it is possible to access nodes usingssh core@<node>.<cluster_name>.<base_domain>instead.Determine the target container ID:
# crictl psDetermine the container’s process ID. In this example, the target container ID is
a7fe32346b120:# crictl inspect a7fe32346b120 --output yaml | grep 'pid:' | awk '{print $2}'Run
ip adwithin the container’s namespace, using the host’sipbinary. This example uses31150as the container’s process ID. Thensentercommand enters the namespace of a target process and runs a command in its namespace. Because the target process in this example is a container’s process ID, theip adcommand is run in the container’s namespace from the host:# nsenter -n -t 31150 -- ip adNoteRunning a host’s diagnostic binaries within a container’s namespace is only possible if you are using a privileged container such as a debug node.
8.9. Troubleshooting storage issues Copy linkLink copied to clipboard!
A multi-attach storage error occurs when the mounting volume on a new node is not possible because the failed node cannot unmount the attached volume. A cluster administrator can resolve multi-attach storage issues by enabling multiple attachments using RWX volumes or recovering/deleting the failed node when using an RWO volume.
8.9.1. Resolve multi-attach errors Copy linkLink copied to clipboard!
When a node crashes or shuts down abruptly, the attached ReadWriteOnce (RWO) volume is expected to be unmounted from the node so that it can be used by a pod scheduled on another node.
However, mounting on a new node is not possible because the failed node is unable to unmount the attached volume.
A multi-attach error is reported:
Unable to attach or mount volumes: unmounted volumes=[sso-mysql-pvol], unattached volumes=[sso-mysql-pvol default-token-x4rzc]: timed out waiting for the condition
Multi-Attach error for volume "pvc-8837384d-69d7-40b2-b2e6-5df86943eef9" Volume is already used by pod(s) sso-mysql-1-ns6b4
Procedure
To resolve the multi-attach issue, use one of the following solutions:
Enable multiple attachments by using RWX volumes:
For most storage solutions, you can use ReadWriteMany (RWX) volumes to prevent multi-attach errors.
Recover or delete the failed node when using an RWO volume:
For storage that does not support RWX, such as VMware vSphere, RWO volumes must be used instead. However, RWO volumes cannot be mounted on multiple nodes.
If you encounter a multi-attach error message with an RWO volume, force delete the pod on a shutdown or crashed node to avoid data loss in critical workloads, such as when dynamic persistent volumes are attached:
$ oc delete pod <old_pod> --force=true --grace-period=0This command deletes the volumes stuck on shutdown or crashed nodes after six minutes.
8.10. Investigating monitoring issues Copy linkLink copied to clipboard!
Red Hat OpenShift Service on AWS includes a preconfigured, preinstalled, and self-updating monitoring stack that provides monitoring for core platform components. In Red Hat OpenShift Service on AWS 4, cluster administrators can optionally enable monitoring for user-defined projects.
Use these procedures if the following issues occur:
- Your own metrics are unavailable.
- Prometheus is consuming a lot of disk space.
-
The
KubePersistentVolumeFillingUpalert is firing for Prometheus.
8.10.2. Determine why Prometheus is consuming a lot of disk space Copy linkLink copied to clipboard!
Developers can create labels to define attributes for metrics in the form of key-value pairs. The number of potential key-value pairs corresponds to the number of possible values for an attribute. An attribute that has an unlimited number of potential values is called an unbound attribute. For example, a customer_id attribute is unbound because it has an infinite number of possible values.
Every assigned key-value pair has a unique time series. The use of many unbound attributes in labels can result in an exponential increase in the number of time series created. This can impact Prometheus performance and can consume a lot of disk space.
You can use the following measures when Prometheus consumes a lot of disk:
- Check the time series database (TSDB) status using the Prometheus HTTP API for more information about which labels are creating the most time series data. Doing so requires cluster administrator privileges.
- Check the number of scrape samples that are being collected.
Reduce the number of unique time series that are created by reducing the number of unbound attributes that are assigned to user-defined metrics.
NoteUsing attributes that are bound to a limited set of possible values reduces the number of potential key-value pair combinations.
- Enforce limits on the number of samples that can be scraped across user-defined projects. This requires cluster administrator privileges.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role. -
You have installed the OpenShift CLI (
oc).
Procedure
-
In the Red Hat OpenShift Service on AWS web console, go to Observe
Metrics. Enter a Prometheus Query Language (PromQL) query in the Expression field. The following example queries help to identify high cardinality metrics that might result in high disk space consumption:
By running the following query, you can identify the ten jobs that have the highest number of scrape samples:
topk(10, max by(namespace, job) (topk by(namespace, job) (1, scrape_samples_post_metric_relabeling)))By running the following query, you can pinpoint time series churn by identifying the ten jobs that have created the most time series data in the last hour:
topk(10, sum by(namespace, job) (sum_over_time(scrape_series_added[1h])))
Investigate the number of unbound label values assigned to metrics with higher than expected scrape sample counts:
- If the metrics relate to a user-defined project, review the metrics key-value pairs assigned to your workload. These are implemented through Prometheus client libraries at the application level. Try to limit the number of unbound attributes referenced in your labels.
- If the metrics relate to a core Red Hat OpenShift Service on AWS project, create a Red Hat support case on the Red Hat Customer Portal.
Review the TSDB status using the Prometheus HTTP API by following these steps when logged in as a cluster administrator:
Get the Prometheus API route URL by running the following command:
$ HOST=$(oc -n openshift-monitoring get route prometheus-k8s -ojsonpath='{.status.ingress[].host}')Extract an authentication token by running the following command:
$ TOKEN=$(oc whoami -t)Query the TSDB status for Prometheus by running the following command:
$ curl -H "Authorization: Bearer $TOKEN" -k "https://$HOST/api/v1/status/tsdb"Example output
"status": "success","data":{"headStats":{"numSeries":507473, "numLabelPairs":19832,"chunkCount":946298,"minTime":1712253600010, "maxTime":1712257935346},"seriesCountByMetricName": [{"name":"etcd_request_duration_seconds_bucket","value":51840}, {"name":"apiserver_request_sli_duration_seconds_bucket","value":47718}, ...
8.11. Diagnosing OpenShift CLI (oc) issues Copy linkLink copied to clipboard!
You can investigate OpenShift CLI (oc) issues by increasing the log level to get more detailed diagnostic information.
8.11.1. Understand OpenShift CLI (oc) log levels Copy linkLink copied to clipboard!
With the OpenShift CLI (oc), you can create applications and manage Red Hat OpenShift Service on AWS projects from a terminal.
If oc command-specific issues arise, increase the oc log level to output API request, API response, and curl request details generated by the command. This provides a granular view of a particular oc command’s underlying operation, which in turn might provide insight into the nature of a failure.
oc log levels range from 1 to 10. The following table provides a list of oc log levels, along with their descriptions.
| Log level | Description |
|---|---|
| 1 to 5 | No additional logging to stderr. |
| 6 | Log API requests to stderr. |
| 7 | Log API requests and headers to stderr. |
| 8 | Log API requests, headers, and body, plus API response headers and body to stderr. |
| 9 |
Log API requests, headers, and body, API response headers and body, plus |
| 10 |
Log API requests, headers, and body, API response headers and body, plus |
8.11.2. Specify OpenShift CLI (oc) log levels Copy linkLink copied to clipboard!
You can investigate OpenShift CLI (oc) issues by increasing the command’s log level.
The Red Hat OpenShift Service on AWS user’s current session token is typically included in logged curl requests where required. You can also obtain the current user’s session token manually, for use when testing aspects of an oc command’s underlying process step-by-step.
Prerequisites
-
Install the OpenShift CLI (
oc).
Procedure
Specify the
oclog level when running anoccommand:$ oc <command> --loglevel <log_level>where:
- <command>
- Specifies the command you are running.
- <log_level>
- Specifies the log level to apply to the command.
To obtain the current user’s session token, run the following command:
$ oc whoami -tExample output
sha256~RCV3Qcn7H-OEfqCGVI0CvnZ6...
8.12. Troubleshooting expired tokens Copy linkLink copied to clipboard!
Troubleshoot expired offline access tokens that prevent access to your Red Hat OpenShift Service on AWS cluster.
8.12.1. Troubleshoot expired offline access tokens Copy linkLink copied to clipboard!
If you use the Red Hat OpenShift Service on AWS (ROSA) CLI, rosa, and your api.openshift.com offline access token expires, an error message is displayed. This happens when sso.redhat.com invalidates the token.
The following example shows the output:
Can't get tokens ....
Can't get access tokens ....
Procedure
- Generate a new offline access token at the following URL. The OpenShift Cluster Manager URL generates a new offline access token every time you visit it.
8.13. Troubleshooting IAM roles Copy linkLink copied to clipboard!
Troubleshoot IAM role issues that prevent proper access to your Red Hat OpenShift Service on AWS cluster resources.
8.13.1. Resolve issues with ocm-roles and user-role IAM resources Copy linkLink copied to clipboard!
You might receive an error when trying to create a cluster by using the ROSA command-line interface (CLI) (rosa). This error means that the user-role IAM role is not linked to your AWS account. The most likely cause of this error is that another user in your Red Hat organization created the ocm-role IAM role. Your user-role IAM role needs to be created.
After any user sets up an ocm-role IAM resource linked to a Red Hat account, any subsequent users wishing to create a cluster in that Red Hat organization must have a user-role IAM role to provision a cluster.
Procedure
Assess the status of your
ocm-roleanduser-roleIAM roles with the following commands:$ rosa list ocm-roleExample output
I: Fetching ocm roles ROLE NAME ROLE ARN LINKED ADMIN ManagedOpenShift-OCM-Role-1158 arn:aws:iam::2066:role/ManagedOpenShift-OCM-Role-1158 No No$ rosa list user-roleExample output
I: Fetching user roles ROLE NAME ROLE ARN LINKED ManagedOpenShift-User.osdocs-Role arn:aws:iam::2066:role/ManagedOpenShift-User.osdocs-Role YesWith the results of these commands, you can create and link the missing IAM resources.
8.13.2. Create an ocm-role IAM role Copy linkLink copied to clipboard!
Create the ocm-role Identity and Access Management (IAM) roles by using the ROSA command-line interface (CLI) (rosa) to grant OpenShift Cluster Manager the permissions needed to install and manage your Red Hat OpenShift Service on AWS clusters.
If you want to create and manage clusters by using only the rosa CLI and the OpenShift CLI (oc), you can use the --no-console profile for the ocm-role IAM resource. For more information about the ocm-role IAM resource permissions profile, see the Additional resources.
You must create the ocm-role IAM role before you can create your Red Hat OpenShift Service on AWS cluster.
Prerequisites
- You have an AWS account.
- You have Red Hat Organization Administrator privileges in the OpenShift Cluster Manager organization.
- You have the permissions required to install AWS account-wide roles.
-
You have installed and configured the latest
rosaCLI,rosa, on your installation host.
Procedure
Run one of the following commands to create the required
ocm-roleIAM resource:ImportantThe process to change your
ocm-roleIAM resource profile requires you to unlink and delete the currentocm-roleIAM resource and create a new one with the required profile.To create an
ocm-roleIAM role with standard privileges, run the following command:$ rosa create ocm-roleTo create an
ocm-roleIAM role with admin privileges, run the following command:ImportantThe admin profile supports "auto" mode configuration for Red Hat OpenShift Service on AWS clusters which provisions OIDC Configuration and Operator roles automatically. To achieve this automatic flow, the profile has a wider set of permissions than the standard profile.
$ rosa create ocm-role --adminThis command allows you to create the role by specifying specific attributes. The following example output shows the "auto mode" selected, which lets the
rosaCLI (rosa) create your Operator roles and policies. See "Methods of account-wide role creation" for more information. The following example shows what your creation flow might look like.I: Creating ocm role ? Role prefix: ManagedOpenShift ? Enable admin capabilities for the OCM role (optional): No ? Permissions boundary ARN (optional): ? Role Path (optional): ? Role creation mode: auto I: Creating role using 'arn:aws:iam::<ARN>:user/<UserName>' ? Create the 'ManagedOpenShift-OCM-Role-182' role? Yes I: Created role 'ManagedOpenShift-OCM-Role-182' with ARN 'arn:aws:iam::<ARN>:role/ManagedOpenShift-OCM-Role-182' I: Linking OCM role ? OCM Role ARN: arn:aws:iam::<ARN>:role/ManagedOpenShift-OCM-Role-182 ? Link the 'arn:aws:iam::<ARN>:role/ManagedOpenShift-OCM-Role-182' role with organization '<AWS ARN>'? Yes I: Successfully linked role-arn 'arn:aws:iam::<ARN>:role/ManagedOpenShift-OCM-Role-182' with organization account '<AWS ARN>'where:
Role prefix-
A prefix value for all of the created AWS resources. In this example,
ManagedOpenShiftprepends all of the AWS resources. Enable admin capabilities for the OCM role (optional)Choose if you want this role to have the additional admin permissions.
NoteYou do not see this prompt if you used the
--adminoption.Permissions boundary ARN (optional)- The Amazon Resource Name (ARN) of the policy to set permission boundaries.
Role Path (optional)- Specify an IAM path for the user name.
Role creation mode-
Choose the method to create your AWS roles. By using
auto, therosaCLI generates and links the roles and policies. In theautomode, you receive some different prompts to create the AWS roles. Create the 'ManagedOpenShift-OCM-Role-182' role?-
The
automethod asks if you want to create a specificocm-roleby using your prefix. OCM Role ARN- Confirm that you want to associate your IAM role with your OpenShift Cluster Manager.
Link the 'arn:aws:iam::<ARN>:role/ManagedOpenShift-OCM-Role-182' role with organization '<AWS ARN>'?- Links the created role with your AWS organization.
To create an
ocm-roleIAM role with the minimum required privileges, run the following command:NoteWhile the
no-consoleprofile offers the minimum permissions policy that can still create Red Hat OpenShift Service on AWS clusters, the permissions are insufficient if you want to use OpenShift Cluster Manager for cluster creation.$ rosa create ocm-role --no-console
8.13.3. Create a user-role IAM role Copy linkLink copied to clipboard!
You can create your user-role IAM roles by using the ROSA command-line interface (CLI) (rosa).
Prerequisites
- You have an AWS account.
-
You have installed and configured the latest
rosaCLI,rosa, on your installation host.
Procedure
To create a
user-roleIAM role with basic privileges, run the following command:$ rosa create user-roleThis command allows you to create the role by specifying specific attributes. The following example output shows the "auto mode" selected, which lets the
rosaCLI (rosa) to create your Operator roles and policies. See "Understanding the auto and manual deployment modes" for more information. The following example shows what your creation flow might look like.I: Creating User role ? Role prefix: ManagedOpenShift ? Permissions boundary ARN (optional): ? Role Path (optional): ? Role creation mode: auto I: Creating ocm user role using 'arn:aws:iam::2066:user' ? Create the 'ManagedOpenShift-User.osdocs-Role' role? Yes I: Created role 'ManagedOpenShift-User.osdocs-Role' with ARN 'arn:aws:iam::2066:role/ManagedOpenShift-User.osdocs-Role' I: Linking User role ? User Role ARN: arn:aws:iam::2066:role/ManagedOpenShift-User.osdocs-Role ? Link the 'arn:aws:iam::2066:role/ManagedOpenShift-User.osdocs-Role' role with account '1AGE'? Yes I: Successfully linked role ARN 'arn:aws:iam::2066:role/ManagedOpenShift-User.osdocs-Role' with account '1AGE'where:
Role prefix-
A prefix value for all of the created AWS resources. In this example,
ManagedOpenShiftprepends all of the AWS resources. Permissions boundary ARN (optional)- The Amazon Resource Name (ARN) of the policy to set permission boundaries.
Role Path (optional)- Specify an IAM path for the user name.
Role creation mode-
Choose the method to create your AWS roles. By using
auto, therosaCLI generates and links the roles and policies. In theautomode, you receive some different prompts to create the AWS roles. Create the 'ManagedOpenShift-User.osdocs-Role' role?-
The
automethod asks if you want to create a specificuser-roleby using your prefix. Link the 'arn:aws:iam::2066:role/ManagedOpenShift-User.osdocs-Role' role with account '1AGE'?- Links the created role with your AWS organization.
ImportantIf you unlink or delete your
user-roleIAM role before deleting your cluster, an error prevents you from deleting your cluster. You must create or relink this role to proceed with the deletion process.
8.13.4. Associate your AWS account with IAM roles Copy linkLink copied to clipboard!
You can associate or link your AWS account with existing IAM roles by using the ROSA command-line interface (CLI) (rosa).
Prerequisites
- You have an AWS account.
- You have the permissions required to install AWS account-wide roles. See the "Additional resources" of this section for more information.
-
You have installed and configured the latest AWS CLI (
aws) androsaCLI on your installation host. You have created the
ocm-roleanduser-roleIAM roles, but have not yet linked them to your AWS account. You can check whether your IAM roles are already linked by running the following commands:$ rosa list ocm-role$ rosa list user-roleIf
Yesis displayed in theLinkedcolumn for both roles, you have already linked the roles to an AWS account.
Procedure
In the ROSA CLI, link your
ocm-roleresource to your Red Hat organization by using your Amazon Resource Name (ARN):NoteYou must have Red Hat Organization Administrator privileges to run the
rosa linkcommand. After you link theocm-roleresource with your AWS account, it takes effect and is visible to all users in the organization.$ rosa link ocm-role --role-arn <arn>For example:
I: Linking OCM role ? Link the '<AWS ACCOUNT ID>` role with organization '<ORG ID>'? Yes I: Successfully linked role-arn '<AWS ACCOUNT ID>' with organization account '<ORG ID>'In the ROSA CLI, link your
user-roleresource to your Red Hat user account by using your Amazon Resource Name (ARN):$ rosa link user-role --role-arn <arn>For example:
I: Linking User role ? Link the 'arn:aws:iam::<ARN>:role/ManagedOpenShift-User-Role-125' role with organization '<AWS ID>'? Yes I: Successfully linked role-arn 'arn:aws:iam::<ARN>:role/ManagedOpenShift-User-Role-125' with organization account '<AWS ID>'
8.13.5. Associate multiple AWS accounts with your Red Hat organization Copy linkLink copied to clipboard!
You can associate multiple AWS accounts with your Red Hat organization. Associating multiple accounts lets you create Red Hat OpenShift Service on AWS clusters on any of the associated AWS accounts from your Red Hat organization.
With this capability, you can create clusters on different AWS profiles according to characteristics that make sense for your business, for example, by using one AWS profile for each region to create region-bound environments.
Prerequisites
- You have an AWS account.
- You are using OpenShift Cluster Manager to create clusters.
- You have the permissions required to install AWS account-wide roles.
-
You have installed and configured the latest AWS CLI (
aws) and ROSA command-line interface (CLI) (rosa) on your installation host. -
You have created the
ocm-roleanduser-roleIAM roles for Red Hat OpenShift Service on AWS.
Procedure
To specify an AWS account profile when creating an OpenShift Cluster Manager role:
$ rosa create --profile <aws_profile> ocm-roleTo specify an AWS account profile when creating a user role:
$ rosa create --profile <aws_profile> user-roleTo specify an AWS account profile when creating the account roles:
$ rosa create --profile <aws_profile> account-rolesNoteIf you do not specify a profile, the default AWS profile and its associated AWS region are used.
8.14. Troubleshooting Red Hat OpenShift Service on AWS cluster deployments Copy linkLink copied to clipboard!
Troubleshoot cluster deployment errors by completing the following instructions.
8.14.1. Obtain information about a failed cluster Copy linkLink copied to clipboard!
If a cluster deployment fails, the cluster is put into an "error" state.
Procedure
Run the following command to get more information:
$ rosa describe cluster -c <my_cluster_name> --debug
8.14.2. Troubleshoot cluster creation with an osdCcsAdmin error Copy linkLink copied to clipboard!
If a cluster creation action fails, you might receive the following error message.
The following example shows the output:
Failed to create cluster: Unable to create cluster spec: Failed to get access keys for user 'osdCcsAdmin': NoSuchEntity: The user with name osdCcsAdmin cannot be found.
Procedure
Delete the stack:
$ rosa init --deleteReinitialize your account:
$ rosa init
8.14.3. Create the Elastic Load Balancing (ELB) service-linked role Copy linkLink copied to clipboard!
If you have not created a load balancer in your AWS account, it is possible that the service-linked role for Elastic Load Balancing (ELB) might not exist yet. You might receive the following error:
Error: Error creating network Load Balancer: AccessDenied: User: arn:aws:sts::xxxxxxxxxxxx:assumed-role/ManagedOpenShift-Installer-Role/xxxxxxxxxxxxxxxxxxx is not authorized to perform: iam:CreateServiceLinkedRole on resource: arn:aws:iam::xxxxxxxxxxxx:role/aws-service-role/elasticloadbalancing.amazonaws.com/AWSServiceRoleForElasticLoadBalancing"
Procedure
To resolve this issue, ensure that the role exists on your AWS account. If not, create this role with the following command:
aws iam get-role --role-name "AWSServiceRoleForElasticLoadBalancing" || aws iam create-service-linked-role --aws-service-name "elasticloadbalancing.amazonaws.com"NoteThis command only needs to be executed once per account.
8.14.4. Repair a cluster that cannot be deleted Copy linkLink copied to clipboard!
In specific cases, the following error is displayed in OpenShift Cluster Manager if you attempt to delete your cluster:
Error deleting cluster
CLUSTERS-MGMT-400: Failed to delete cluster <hash>: sts_user_role is not linked to your account. sts_ocm_role is linked to your organization <org number> which requires sts_user_role to be linked to your Red Hat account <account ID>.Please create a user role and link it to the account: User Account <account ID> is not authorized to perform STS cluster operations
Operation ID: b0572d6e-fe54-499b-8c97-46bf6890011c
If you try to delete your cluster from the CLI, the following error is displayed:
E: Failed to delete cluster <hash>: sts_user_role is not linked to your account. sts_ocm_role is linked to your organization <org_number> which requires sts_user_role to be linked to your Red Hat account <account_id>.Please create a user role and link it to the account: User Account <account ID> is not authorized to perform STS cluster operations
This error occurs when the user-role is unlinked or deleted.
Procedure
Run the following command to create the
user-roleIAM resource:$ rosa create user-roleAfter you see that the role has been created, you can delete the cluster. The following confirms that the role was created and linked:
I: Successfully linked role ARN <user role ARN> with account <account ID>