1 [root@s17e3bbc1fd7 6]# more Dockerfile FROM centos:7 # Install Apache RUN yum -y update && yum install -y httpd httpd-tools && yum install -y telnet RUN mkdir /var/www/html/b # change index.html RUN echo ' \ \ NCP \ \ \

NCP TEST에 오신걸 환영합니다!

\
Subject : Kubernetes Service를 활용한 컨테이너 관리
\
Version : 3.0.0
\ \ ' > /var/www/html/b/index.html CMD ["systemctl","restart","httpd"] #Start Apache CMD ["/usr/sbin/httpd","-D","FOREGROUND"] [root@s17e3bbc1fd7 6]# docker build -t image_apache_2 . docker images [root@s17e3bbc1fd7 6]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE image_apache_2 latest f849bab1a9f6 5 seconds ago 521MB docker login –u .kr.ncr.ntruss.com –p docker login -u tUBEqk -p uiicgAoiS47n m6n7b87w.kr.private-ncr.ntruss.com docker login -u tUB -p uiicgAoiS m6n7b87w.kr.private-ncr.ntruss.com docker run -tid -p 4000:80 --name=hello_apache2 image_apache_2 # docker run -tid -p 7000:80 --name=hello_apache2 image_apache_2 docker: Error response from daemon: Conflict. The container name "/hello_apache2" is already in use by container "3268f53e0971cb2bd4c752b382040afdd5b449a592ebc6e029c04a14bc4c7c8b". You have to remove (or rename) that container to be able to reuse that name. See 'docker run --help'. docker image tag image_apache_2 /image_apache_2:1.0 docker image tag image_apache_2 m6n7b87w.kr.ncr.ntruss.com/image_apache_2:1.0 docker push m6n7b87w.kr.ncr.ntruss.com/image_apache_2:1.0 The push refers to repository [m6n7b87w.kr.ncr.ntruss.com/image_apache_2] 61c2024c67fc: Preparing d04bd79f8323: Preparing f57bf25422cf: Preparing 174f56854903: Preparing denied: requested access to the resource is denied kubectl apply -f https://gist.githubusercontent.com/NaverCloudPlatformDeveloper/c47620d8d25b2a0e08648f225043adf6/raw/675addde0a56ba727824f30f92a73b40550fb73c/nks-tutorial-hello-service.yaml kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controllerv0.43.0/deploy/static/provider/cloud/deploy.yaml kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingressnginx/2de5a893aa15f14102d714e918b0045b960ad1a5/deploy/static/provider/cloud-generic.yaml 2 vi ingress.yaml apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ab-ingress annotations: kubernetes.io/ingress.class: nginx ingress.kubernetes.io/rewrite-target: / nginx.ingress.kubernetes.io/ssl-redirect: "false" spec: rules: - http: paths: - path: /a backend: serviceName: a-svc servicePort: 80 - path: /b backend: serviceName: b-svc kubectl create –f ingress.yaml error: error parsing ingress.yaml: error converting YAML to JSON: yaml: line 16: did not find expected key kubectl get ingress curl (ingress domain)/a curl (ingress domain)/b