docker에서 (수동으로) aks 에 배포해보기

이동현·2022년 8월 24일
0

SKT 프로젝트

목록 보기
7/15

sample jenkins pipeline

pipeline{
	agent any
    
    stages {
    	stage('Hello') {
        	steps {
            	echo 'Hello World'
            }
        }
    	stage('Testing') {
        	steps {
            	echo "Testing stage"
            }
       	}
  }
  

basic kubernetes yaml file

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-python-deployment

spec:
replicas: 3
selector:
matchLabels:
app: python-app
template:
metadata:
labels:
app: python-app
spec:
containers:
- name: my-python-app
image: ske04186/hello_world:latest
imagePullPolicy: Always
ports:
- containerPort: 8000
// service type loadbalancer


apiVersion: v1
kind: Service
metadata:
name: python-app-svc
spec:
selector:
app: python-app
ports:
- protocol: TCP
port: 8000
targetPort: 8000
type: LoadBalancer

를 Sample-Python-App.yaml에 작성하고
kubectl apply -f Sample-Python-App.yaml
kubectl get pods
kubectl get svc

해서 external ip 주소얻고
externalip:8000하면 접속 해진다 .
load balancer 가 알아서 해줌.

0개의 댓글