Voiced by Amazon Polly |
Introduction
In the dynamic world of container orchestration, managing and exposing network traffic efficiently is crucial. OpenShift, built on Kubernetes, simplifies this process with Routes — a powerful way to expose your applications to external traffic. In this blog, we’ll take you through a beautiful and detailed journey of creating Routes in OpenShift, ensuring your applications are accessible, secure, and well-optimized.
Learn from Industry Certified DevOps Experts and Become a Certified DevOps Professional with a High Paying Job
- Experienced Authorized Instructor led Training
- Live Hands-on Labs
Why Routes Matter in OpenShift
Routes in OpenShift provide a user-friendly and scalable way to access your services from outside the cluster. Whether you’re managing simple HTTP traffic or securing connections with TLS encryption, Routes offer a flexible and powerful mechanism for traffic control.
Here’s what Routes offer:
- External Access: Seamlessly expose your services to the outside world.
- TLS Termination: Secure your applications with HTTPS traffic.
- Custom Hostnames: Assign user-friendly URLs for better accessibility.
- Path-Based Routing: Direct specific traffic to designated application endpoints.
Step-by-Step Lab: Creating a Route in OpenShift
- Open your browser and navigate to the OpenShift web console URL.
- Log in using your credentials.
- In the left-hand navigation menu, expand Networking, and select Services
- Click the Create Service
- Define the Service Details in the YAML, and click on Create
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
apiVersion: v1 kind: Service metadata: name: httpd-service spec: selector: app: httpd-deployment ports: - protocol: TCP port: 80 targetPort: 80 |
- Once created, the Service will appear on the service page.
- Now go to Routes. In the left-hand navigation menu, expand Networking.
- Click on Routes.
- Click the Create Route button.
- Define the Route Details:
- Name: Enter a name for the route (e.g., nginx-route).
- Service: Select the service associated with the nginx-deployment (e.g., nginx-deployment).
- Target Port: Choose the port exposed by the service (e.g., 80 for HTTP).
- Hostname (Optional):
- By default, OpenShift generates a hostname for the route.
- If you want a custom hostname, enter it in the Hostname field (e.g., nginx.example.com).
- Specify a path if the route should serve only a specific URI (e.g., /app). (Optional):
- TLS Configuration (Optional):
- If the route should use HTTPS, configure TLS settings. You can select:
- Edge: Terminate TLS at the router.
- Passthrough: Pass encrypted traffic directly to the backend.
- Reencrypt: Terminate and reencrypt traffic between the router and backend.
- Click Create to finalize the route.
- Once created, the route will appear in the Routes list.
- The route’s URL will be displayed under the Location.
- Click on the URL to verify it redirects to your NGINX application.
Services vs Routes in OpenShift
Conclusion
Creating a Service and Route in OpenShift is a straightforward process that enables you to expose your applications to external users. By following the steps outlined in this guide, you can easily configure Services and Routes for your deployments, ensuring seamless communication and accessibility.
Routes in OpenShift are a powerful feature that goes beyond basic Kubernetes Ingress, offering advanced routing, security, and customization options. Whether you’re running a simple HTTPD application or a complex microservices architecture, OpenShift provides the tools you need to manage your applications effectively.
Attend 8+ DevOps and Kubernetes Certification Trainings and become a Certified DevOps expert
- Experienced Authorized Instructor led Training
- Live Hands-on Labs
About CloudThat
CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.
CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 650k+ professionals in 500+ cloud certifications and completed 300+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training Partner, AWS Migration Partner, AWS Data and Analytics Partner, AWS DevOps Competency Partner, AWS GenAI Competency Partner, Amazon QuickSight Service Delivery Partner, Amazon EKS Service Delivery Partner, AWS Microsoft Workload Partners, Amazon EC2 Service Delivery Partner, Amazon ECS Service Delivery Partner, AWS Glue Service Delivery Partner, Amazon Redshift Service Delivery Partner, AWS Control Tower Service Delivery Partner, AWS WAF Service Delivery Partner, Amazon CloudFront, Amazon OpenSearch, AWS DMS, AWS Systems Manager, Amazon RDS, and many more.

WRITTEN BY Sirin Kausar Isak Ali
Comments