IMAGE_URL=$(aws ecr describe-repositories --repository-name hrdkorea-ecr-repo --query "repositories[].repositoryUri" --region us-esat-1 --output text)
IMAGE_TAG=$(aws ecr describe-images --repository-name hrdkorea-ecr-repo --query "imageDetails[?contains(imageTags, 'product')].imageTags" --region us-east-1 --output text)
IMAGE="$IMAGE_URL:$IMAGE_TAG"
Shell
복사
sed -i "s|IMAGE|$IMAGE|g" deployment.yaml
Shell
복사
kubectl apply -f deployment.yaml
Shell
복사
apiVersion: v1
kind: Service
metadata:
name: product-service
namespace: hrdkorea
spec:
selector:
app: product
ports:
- protocol: TCP
port: 8080
targetPort: 8080
YAML
복사
kubectl apply -f service.yaml
Shell
복사
