티스토리 뷰
OpenShift 에 Nginx 서비스 배포
- 빠른 생성(Yaml 을 통한 간단 베포)

Nginx 배포를 위한 Yaml
# nginx-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: default # 오픈시프트에 생성되어있는 namespace 확인
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
namespace: default # 오픈시프트에 생성되어있는 namespace 확인
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer # 또는 NodePort
Nginx 배포 상태

Nginx 서비스 노출 (openshift route리소스 활용)
# nginx service 용 라우트 생성
oc create -n default route edge nginx-route --service=nginx-service --port=80
도메인 라우팅 설정확인
oc get route nginx-route -n default --no-headers -o custom-columns=HOST:.spec.host
Nginx 서비스 도메인 주소 확인

Nginx 웹 서비스 확인
https://nginx-route-default.apps-crc.testing
'openshift' 카테고리의 다른 글
| [OpenShift] CRC install on Bare Metal VM (0) | 2025.11.16 |
|---|---|
| Fundamentals of Red Hat OpenShift Administration (0) | 2025.11.15 |
| 1. Introduction to Kubernetes and OpenShift (0) | 2025.11.15 |
