Learn and Be Curious

ECS 1

Cloud/GEP2018. 7. 3. 05:27































[ec2-user@ip-10-0-1-65 cats]$ sudo docker build -t cats .
Sending build context to Docker daemon  1.209MB
Step 1/9 : FROM nginx
 ---> 40960efd7b8f
Step 2/9 : EXPOSE 80
 ---> Using cache
 ---> d81f3a4ec204
Step 3/9 : RUN apt-get update -y &&   apt-get upgrade -y &&   apt-get install -y curl &&   apt-get install -y python2.7 &&   cd /tmp &&   curl -O https://bootstrap.pypa.io/get-pip.py &&   python2.7 get-pip.py &&   pip install awscli &&   rm -rf /tmp/* &&   rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 07762b5777da
Step 4/9 : COPY ./default.conf /etc/nginx/conf.d/default.conf
 ---> Using cache
 ---> e5688e077566
Step 5/9 : COPY ./index.html /usr/share/nginx/html/index.html
 ---> Using cache
 ---> 3de0fcad04be
Step 6/9 : ENV BUCKET_CATS_DOGS="syd-ecs-cats/cats"
 ---> Using cache
 ---> 43380a8571e5
Step 7/9 : ENV REGION="us-east-1"
 ---> Using cache
 ---> 715398fd2663
Step 8/9 : COPY ./tmp/* /usr/share/nginx/html/
 ---> 1e943f16706b
Step 9/9 : CMD nginx -g "daemon off;"
 ---> Running in 8f3ffaefda3f
Removing intermediate container 8f3ffaefda3f
 ---> c7c8e1429608
Successfully built c7c8e1429608
Successfully tagged cats:latest






[ec2-user@ip-10-0-1-65 docker]$ docker build -t dogs .
Sending build context to Docker daemon  1.239MB
Step 1/9 : FROM httpd
 ---> 74ad7f48867f
Step 2/9 : EXPOSE 80
 ---> Using cache
 ---> fb9e7d4b4bf9
Step 3/9 : RUN apt-get update -y &&   apt-get upgrade -y &&   apt-get install -y curl &&   apt-get install -y python2.7 &&   cd /tmp &&   curl -O https://bootstrap.pypa.io/get-pip.py &&   python2.7 get-pip.py &&   pip install awscli &&   rm -rf /tmp/* &&   rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 7d342ee4389f
Step 4/9 : COPY ./httpd.conf /usr/local/apache2/conf/
 ---> Using cache
 ---> a87f2e33e720
Step 5/9 : COPY ./index.html /usr/local/apache2/htdocs/
 ---> Using cache
 ---> a645ba51b3d2
Step 6/9 : ENV BUCKET_CATS_DOGS="syd-ecs-dogs/dogs"
 ---> Using cache
 ---> 41e5dee4e4a1
Step 7/9 : ENV REGION="us-east-1"
 ---> Using cache
 ---> 8050f4295358
Step 8/9 : COPY ./tmp/ /usr/local/apache2/htdocs/
 ---> 84b46f953260
Step 9/9 : CMD httpd -D FOREGROUND
 ---> Running in 77cc81f567da
Removing intermediate container 77cc81f567da
 ---> e24a64698370
Successfully built e24a64698370
Successfully tagged dogs:latest









[root@ip-10-0-1-65 ~]# docker login -u AWS -p

sdfsdgsdfg== https://297062999199.dkr.ecr.us-east-1.amazonaws.com
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded

[root@ip-10-0-1-65 ~]# docker images
REPOSITORY                                                                 TAG                 IMAGE ID            CREATED             SIZE
dogs                                                                       latest              e24a64698370        23 minutes ago      303MB
297062999199.dkr.ecr.us-east-1.amazonaws.com/cats                          latest              c7c8e1429608        29 minutes ago      289MB
cats                                                                       latest              c7c8e1429608        29 minutes ago      289MB
<none>                                                                     <none>              3b903f3dc262        35 minutes ago      288MB
<none>                                                                     <none>              6d5d7326ea7f        About an hour ago   288MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/dogstest2                latest              30383a9fee6d        6 months ago        271MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/catstest2                latest              e89eae83e6e9        6 months ago        214MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/cat                      latest              4a12659d75a6        7 months ago        214MB
cat                                                                        latest              4a12659d75a6        7 months ago        214MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/microservice_webserver   latest              4a8bf86543aa        7 months ago        883MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/web                      latest              4a8bf86543aa        7 months ago        883MB
mustacheme_webserver                                                       latest              4a8bf86543aa        7 months ago        883MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/microservice_processor   latest              4b89382d6c39        7 months ago        936MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/proc                     latest              4b89382d6c39        7 months ago        936MB
mustacheme_processor                                                       latest              4b89382d6c39        7 months ago        936MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/info                     latest              72802221913e        7 months ago        936MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/microservice_info        latest              72802221913e        7 months ago        936MB
mustacheme_info                                                            latest              72802221913e        7 months ago        936MB
mustacheme                                                                 base                db7a546a8618        7 months ago        904MB
python                                                                     2.7                 bd2db1324f76        8 months ago        681MB
nginx                                                                      latest              40960efd7b8f        8 months ago        108MB
httpd                                                                      latest              74ad7f48867f        8 months ago        177MB
<none>                                                                     <none>              a09b06e2c67d        12 months ago       750MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/cats                     latest              1d7b7b94aef8        14 months ago       264MB
289303096751.dkr.ecr.eu-west-1.amazonaws.com/cats                          v2                  1d7b7b94aef8        14 months ago       264MB
289303096751.dkr.ecr.eu-west-1.amazonaws.com/cats                          v1                  759c05be3b65        15 months ago       279MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/dogs                     latest              e99986f084c3        15 months ago       270MB
289303096751.dkr.ecr.eu-west-1.amazonaws.com/dogs                          v1                  e99986f084c3        15 months ago       270MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/webtest2                 latest              40ce661d38c9        15 months ago       233MB
289303096751.dkr.ecr.eu-west-1.amazonaws.com/simplehomepage                latest              40ce661d38c9        15 months ago       233MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/homepage                 latest              40ce661d38c9        15 months ago       233MB
golang                                                                     1.6                 63330314bb46        17 months ago       749MB
awsbootcamp/mustachemebase                                                 latest              d66168c8f79d        21 months ago       881MB


[root@ip-10-0-1-65 ~]# docker push 297062999199.dkr.ecr.us-east-1.amazonaws.com/cats:latest
The push refers to repository [297062999199.dkr.ecr.us-east-1.amazonaws.com/cats]
13fec6af1466: Pushed
4eba00859455: Pushed
887d54fde2e0: Pushed
5e2d525e5c7b: Pushed
f4cc3366d6a9: Pushed
bba7659ae2e7: Pushed
cec7521cdf36: Pushed
latest: digest: sha256:fdfc33e39952409beb3ed6f1b052df7a09db73f085486139b0c3d390cc0ef723 size: 1785

[root@ip-10-0-1-65 ~]# docker tag dogs:latest 297062999199.dkr.ecr.us-east-1.amazonaws.com/dogs:latest
[root@ip-10-0-1-65 ~]# docker push 297062999199.dkr.ecr.us-east-1.amazonaws.com/dogs:latest

The push refers to repository [297062999199.dkr.ecr.us-east-1.amazonaws.com/dogs]
ccf4ea48feb6: Pushed
90ce5a6482ea: Pushed
8c4391ed9234: Pushed
e7ae8afa7c68: Pushed
607cc31ddf99: Pushed
4bb682cd39bd: Pushed
aa6b8cb0f3ac: Pushed
9ff764a04f48: Pushed
607e4dd85443: Pushed
fc59c7018530: Pushed
c01c63c6823d: Pushed
latest: digest: sha256:dd80fa4236afbe347bc13aca2bb6e0a98a4c0b1d32b7a3869e28cd3a024ba598 size: 2618
















2









'Cloud > docker' 카테고리의 다른 글

kubernetes  (0) 2018.03.26
Kuber  (0) 2017.10.19
네트워크  (0) 2017.10.18
3  (0) 2017.10.18
docker 레지스트리  (0) 2017.10.17

kubernetes

Cloud/docker2018. 3. 26. 00:41

http://jeongchul.tistory.com/570

'Cloud > docker' 카테고리의 다른 글

docker for linux fundimental  (0) 2018.04.12
Kuber  (0) 2017.10.19
네트워크  (0) 2017.10.18
3  (0) 2017.10.18
docker 레지스트리  (0) 2017.10.17

설치

Cloud/교육2018. 1. 15. 11:14
  1. JDK



2. Tomcat




3. Maven 다운로드




3. Eclipse 다운로드


4. JDK설치후 Installed JRE 지정




5. Tomcat 추가




6. maven 셋팅




7. Import project






8. spring plugin 설치





9. lib 두개 추가








https://s3.ap-northeast-2.amazonaws.com/cf-templates-3gnxnw1y9tyu-ap-northeast-2/faro_sql.tar




Kuber

Cloud/docker2017. 10. 19. 15:04

3개 노드면

1개는 master,

2개는 worker (컨테이너)


RC (리플리케이션 컨트롤러) 잘 안씀

Deployment 씀


Service : 포드간에 네트웍을 처리하는 개체

짝짓기 : label, selector






GCP에서 구성할때는 디폴트로 제공되는것 들이 많다 (ex: cAdvisor)





==Docker v 1.12 설치=================================

apt-get update


apt-get install apt-transport-https ca-certificates


apt-key adv \

               --keyserver hkp://ha.pool.sks-keyservers.net:80 \

               --recv-keys 58118E89F3A912897C070ADBF76221572C52609D


echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list


apt-get update


apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual


apt-get install -y docker-engine=1.12.0-0~xenial








==Kubernetes 설치==========================================

==모든 노드에서

apt-get update 


curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -


cat <<EOF >/etc/apt/sources.list.d/kubernetes.list

deb http://apt.kubernetes.io/ kubernetes-xenial main

EOF


apt-get update


apt-get install -y kubelet kubeadm kubernetes-cni




[설치]


도커 1.12버전이 쿠버와 안정적






==마스터에서

kubeadm init


mkdir -p $HOME/.kube


cp -i /etc/kubernetes/admin.conf $HOME/.kube/config


chown $(id -u):$(id -g) $HOME/.kube/config


export kubever=$(kubectl version | base64 | tr -d '\n')


kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"


kubectl get pods --all-namespaces 명령 결과 모든 요소의 설치가 완료될때까지 기다린다.


==노드에서

마스터의 kube init 결과로 나온 토큰 조인 구문을 실행한다.

ex) 

kubeadm join --token 90deae.6aac5fc055c311ed 10.10.12.141:6443 --discovery-token-ca-cert-hash sha256:e6c3fec15d9d707eeb76ee466cf1f3713563399b96d8853aab720157630fd5cc



==문제 발생시

kubeadm reset

/etc/systemd/system/kubelet.service.d/10-kubeadm.conf 파일에 다음을 추가

Environment="KUBELET_EXTRA_ARGS=--fail-swap-on=false"


systemctl daemon-reload

systemctl restart kubelet









Desired Status :1 이면

- pod나 docker container를 아무리 지워도 1로 유지됨




---------------------------------------------------------------------------------------------------------------------------------------

root@host14-01:~# scp 10.10.12.171:/test/* /test/

root@10.10.12.171's password:

busybox-ns.yaml                                                                                                                                                                           100%  371     0.4KB/s   00:00

curlpod.yml                                        

.....

---------------------------------------------------------------------------------------------------------------------------------------

root@host14-01:~# kubectl create -f /test/simple-pod.yml

pod "simple" created

root@host14-01:~# kubectl get no

NAME                  STATUS    ROLES     AGE       VERSION

host14-01.cloud.com   Ready     master    14h       v1.8.1

host14-02.cloud.com   Ready     <none>    14h       v1.8.1

host14-03.cloud.com   Ready     <none>    14h       v1.8.1

root@host14-01:~# kubectl get po

NAME      READY     STATUS              RESTARTS   AGE

simple    0/1       ContainerCreating   0          43s


---------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------



root@host14-01:~# kubectl describe po simple

Name:         simple

Namespace:    default

Node:         host14-02.cloud.com/10.10.12.142

Start Time:   Fri, 20 Oct 2017 11:43:58 +0900

Labels:       <none>

Annotations:  <none>

Status:       Running

IP:           10.44.0.1

Containers:

  web:

    Container ID:   docker://a089ef160476ae3b1d492bed6724ea0ffd50f229bbef241fcc203dd0ed27a03a

    Image:          nginx

    Image ID:       docker-pullable://nginx@sha256:004ac1d5e791e705f12a17c80d7bb1e8f7f01aa7dca7deee6e65a03465392072

    Ports:          80/TCP, 443/TCP

    State:          Running

      Started:      Fri, 20 Oct 2017 11:49:05 +0900

    Ready:          True

    Restart Count:  0

    Environment:    <none>

    Mounts:

      /var/run/secrets/kubernetes.io/serviceaccount from default-token-k7qw2 (ro)

Conditions:

  Type           Status

  Initialized    True

  Ready          True

  PodScheduled   True

Volumes:

  default-token-k7qw2:

    Type:        Secret (a volume populated by a Secret)

    SecretName:  default-token-k7qw2

    Optional:    false

QoS Class:       BestEffort

Node-Selectors:  <none>

Tolerations:     node.alpha.kubernetes.io/notReady:NoExecute for 300s

                 node.alpha.kubernetes.io/unreachable:NoExecute for 300s

Events:

  Type    Reason                 Age   From                          Message

  ----    ------                 ----  ----                          -------

  Normal  Scheduled              5m    default-scheduler             Successfully assigned simple to host14-02.cloud.com

  Normal  SuccessfulMountVolume  5m    kubelet, host14-02.cloud.com  MountVolume.SetUp succeeded for volume "default-token-k7qw2"

  Normal  Pulling                5m    kubelet, host14-02.cloud.com  pulling image "nginx"

  Normal  Pulled                 22s   kubelet, host14-02.cloud.com  Successfully pulled image "nginx"

  Normal  Created                22s   kubelet, host14-02.cloud.com  Created container

  Normal  Started                21s   kubelet, host14-02.cloud.com  Started container

root@host14-01:~# kubectl get po -o wide

NAME      READY     STATUS    RESTARTS   AGE       IP          NODE

simple    1/1       Running   0          5m        10.44.0.1   host14-02.cloud.com


---------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------



root@host14-01:~# kubectl get po -o wide
NAME      READY     STATUS    RESTARTS   AGE       IP          NODE
simple    1/1       Running   0          8m        10.44.0.1   host14-02.cloud.com


---------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------

[컨테이너가 아닌 pod에 붙음]

root@host14-01:~# kubectl exec simple -it bash
root@simple:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@simple:/#





포트내 컨테이너 통신은 port로 가능




---------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------


root@host14-01:/test# kubectl create -f multi.yml

pod "multi" created


root@host14-01:/test# kubectl get po

NAME      READY     STATUS              RESTARTS   AGE

multi     0/2       ContainerCreating   0          23s

simple    1/1       Running             0          12m


0/2 <-- 뒤에 2는 총 컨테이너 개수 (pod이 2개 X)






---------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------


root@host14-01:/test# kubectl create -f nodejs-controller.yaml

replicationcontroller "node-js" created

root@host14-01:/test#

root@host14-01:/test# kubectl get rc

NAME      DESIRED   CURRENT   READY     AGE

node-js              3             3         0         14s

=> 3은 pod 개수


root@host14-01:/test# kubectl get pod

NAME            READY     STATUS              RESTARTS   AGE

multi           0/2       ErrImagePull        0          9m

node-js-695kl   0/1       ContainerCreating   0          30s

node-js-rdrkk   0/1       ContainerCreating   0          30s

node-js-shq4v   0/1       ContainerCreating   0          30s

simple          1/1       Running             0          21m







root@host14-01:/test# kubectl get pod

NAME            READY     STATUS              RESTARTS   AGE

multi           0/2       ErrImagePull        0          15m

node-js-695kl   0/1       ContainerCreating   0          6m

node-js-rdrkk   0/1       ContainerCreating   0          6m

node-js-shq4v   0/1       ContainerCreating   0          6m

simple          1/1       Running             0          27m


root@host14-01:/test# kubectl create -f nodejs-rc-service.yaml

service "node-js" created


root@host14-01:/test# kubectl get svc

NAME         TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE

kubernetes   ClusterIP      10.96.0.1        <none>        443/TCP        14h

node-js      LoadBalancer   10.103.138.190   <pending>     80:31057/TCP   14s    <== internal ip











root@host14-01:/test# kubectl delete svc node-js













root@host14-01:/test# cat mysql-password.yml

apiVersion: v1

kind: Secret

metadata:

  name: mysql-passwords

type: Opaque

data:

  root: cm9vdC1wYXNzd29yZA==

  wordpress: d29yZHByZXNzLXBhc3N3b3Jk


Secret 이라는 리소스가 생김


root@host14-01:/test# kubectl create -f mysql-password.yml
secret "mysql-passwords" created
root@host14-01:/test# kubectl get secret
NAME                  TYPE                                  DATA      AGE
default-token-k7qw2   kubernetes.io/service-account-token   3         16h
mysql-passwords       Opaque                                2         10s


root@host14-01:/test# kubectl describe secret mysql-passwords
Name:         mysql-passwords
Namespace:    default
Labels:       <none>
Annotations:  <none>

Type:  Opaque

Data
====
root:       13 bytes
wordpress:  18 bytes



-----------------------------------------------------



root@host14-01:/test# kubectl create -f multi-secret.yml

pod "multi-secrets" created

root@host14-01:/test# kubectl get po

NAME            READY     STATUS              RESTARTS   AGE

multi           2/2       Running             0          2h

multi-secrets   0/2       ContainerCreating   0          13s

node-js-695kl   1/1       Running             0          2h

node-js-rdrkk   1/1       Running             0          2h

node-js-shq4v   1/1       Running             0          2h

simple          1/1       Running             0          2h

root@host14-01:/test# kubectl get po

NAME            READY     STATUS    RESTARTS   AGE

multi           2/2       Running   0          2h

multi-secrets   2/2       Running   0          24s

node-js-695kl   1/1       Running   0          2h

node-js-rdrkk   1/1       Running   0          2h

node-js-shq4v   1/1       Running   0          2h

simple          1/1       Running   0          2h





root@host14-01:/test# kubectl exec multi-secrets -c db -it bash

root@multi-secrets:/# hostname

multi-secrets

root@multi-secrets:/# env

NODE_JS_PORT_80_TCP=tcp://10.96.94.67:80

HOSTNAME=multi-secrets

NODE_JS_PORT=tcp://10.96.94.67:80

KUBERNETES_PORT=tcp://10.96.0.1:443

KUBERNETES_PORT_443_TCP_PORT=443

MYSQL_VERSION=5.7.20-1debian8

NODE_JS_PORT_80_TCP_PROTO=tcp

KUBERNETES_SERVICE_PORT=443

MYSQL_DATABASE=wordpress

KUBERNETES_SERVICE_HOST=10.96.0.1

MYSQL_PASSWORD=wordpress-password

NODE_JS_PORT_80_TCP_PORT=80

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

PWD=/

SHLVL=1

HOME=/root

KUBERNETES_PORT_443_TCP_PROTO=tcp

MYSQL_MAJOR=5.7

KUBERNETES_SERVICE_PORT_HTTPS=443

GOSU_VERSION=1.7

NODE_JS_SERVICE_HOST=10.96.94.67

MYSQL_USER=wordpress

KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1

NODE_JS_PORT_80_TCP_ADDR=10.96.94.67

MYSQL_ROOT_PASSWORD=root-password

NODE_JS_SERVICE_PORT=80

KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443

_=/usr/bin/env

root@multi-secrets:/#






root@host14-01:/test# kubectl exec multi-secrets -c wordpress -it bash

root@multi-secrets:/var/www/html# env

NODE_JS_PORT_80_TCP=tcp://10.96.94.67:80

HOSTNAME=multi-secrets

NODE_JS_PORT=tcp://10.96.94.67:80

KUBERNETES_PORT=tcp://10.96.0.1:443

KUBERNETES_PORT_443_TCP_PORT=443

PHP_INI_DIR=/usr/local/etc/php

PHP_ASC_URL=https://secure.php.net/get/php-5.6.31.tar.xz.asc/from/this/mirror

NODE_JS_PORT_80_TCP_PROTO=tcp

KUBERNETES_SERVICE_PORT=443

WORDPRESS_DB_PASSWORD=wordpress-password

KUBERNETES_SERVICE_HOST=10.96.0.1

PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2

NODE_JS_PORT_80_TCP_PORT=80

PHP_MD5=

PHPIZE_DEPS=autoconf            dpkg-dev                file            g++             gcc             libc-dev                libpcre3-dev            make            pkg-config              re2c

PHP_URL=https://secure.php.net/get/php-5.6.31.tar.xz/from/this/mirror

WORDPRESS_DB_HOST=127.0.0.1

WORDPRESS_VERSION=4.8.2

PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style=both -pie

APACHE_ENVVARS=/etc/apache2/envvars

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

GPG_KEYS=0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3

PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2

PWD=/var/www/html

WORDPRESS_DB_USER=wordpress

SHLVL=1

HOME=/root

PHP_SHA256=c464af61240a9b7729fabe0314cdbdd5a000a4f0c9bd201f89f8628732fe4ae4

WORDPRESS_SHA1=a99115b3b6d6d7a1eb6c5617d4e8e704ed50f450

KUBERNETES_PORT_443_TCP_PROTO=tcp

APACHE_CONFDIR=/etc/apache2

KUBERNETES_SERVICE_PORT_HTTPS=443

PHP_EXTRA_BUILD_DEPS=apache2-dev

NODE_JS_SERVICE_HOST=10.96.94.67

KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1

NODE_JS_PORT_80_TCP_ADDR=10.96.94.67

NODE_JS_SERVICE_PORT=80

KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443

PHP_VERSION=5.6.31

PHP_EXTRA_CONFIGURE_ARGS=--with-apxs2

_=/usr/bin/env

root@multi-secrets:/var/www/html#





'Cloud > docker' 카테고리의 다른 글

docker for linux fundimental  (0) 2018.04.12
kubernetes  (0) 2018.03.26
네트워크  (0) 2017.10.18
3  (0) 2017.10.18
docker 레지스트리  (0) 2017.10.17

네트워크

Cloud/docker2017. 10. 18. 17:04

overlay

vxlan : cisco, vmware 가 만듬, 마켓쉐어 높음
L2, L3

네트워크 가상화

cf) gre : ms가 만듬


브릿지 : 쓰면안됨. 보안X


OVS (open v switch) : 오픈소스, 내장된 스위치





쿠버네티스의 스토리지와 네트워크가 따로 있다







네트웍을 호스트 네트웍을 쓴다 : 베어메탈 처럼 쓸수있다. but, 보안 취약



쿠버의 pod는 컨테이너들이 호스트의 ip를 공유한다.




내가 네트웍 직접 만들때 위를 참고 (default)









shutdown 하면 지워짐. 다시 start하면 다시 연결












nameserver 127.0.0.11 는 내장 DNS



[Router]

frontend 와 backend 를 연결해주려면 별도의 라우터가 필요







[MYSQL]












'Cloud > docker' 카테고리의 다른 글

docker for linux fundimental  (0) 2018.04.12
kubernetes  (0) 2018.03.26
Kuber  (0) 2017.10.19
3  (0) 2017.10.18
docker 레지스트리  (0) 2017.10.17

3

Cloud/docker2017. 10. 18. 09:31


inspect 위에는 image 또는 container


container면 뒤에 런타임 정보가 더 붙는다










[Volume]





위방법은 잘안씀



unmanaged volume :  관리가 잘 안됨






3번째 방법 권장 : volume을 먼저 만들고 매핑하자 (office)


댕글링볼륨 지우기 (옵션사용 또는 prune)



[공유볼륨]









볼륨을 지울때 -fv 옵션을 사용해도 해당 볼륨을 참조하는 컨테이너가 있다면 안지워진다.








'Cloud > docker' 카테고리의 다른 글

docker for linux fundimental  (0) 2018.04.12
kubernetes  (0) 2018.03.26
Kuber  (0) 2017.10.19
네트워크  (0) 2017.10.18
docker 레지스트리  (0) 2017.10.17

이미지를 배포하는 방법

1. 레지스트리

=> 궁극적으로는 레지스트리가 있어야 한다.


2. tar 파일 (임시적인 방편)





docker history 로 레이어를 볼 수 있다.



ctrl+p => ctrl+q

종료하지 않고 나옴


살아있음




[컨테이너를 stateful 하게 쓰는 방법]

1. commit

  but, 일반적인 방법이 아님





2. volume을 사용

- 일반스토리지를 쓴다 (layered filesystem말고)

마이나스 v (-v) 옵션을 쓴다.



-------------------------------------------------------------------------------------


exec : 연결 + 실행

attach : 연결만













[commit]








-v 옵션으로 다시 죽이고 띄워도 홈페이지는 열린다 (p161)










[Docker File]

- 각각의 Instruction은 레이어가 된다 (MAINTAINER 제외 : 연락처정보)

-






inpect 위에 image/container

container 면 런타임정보가 추가적으로 더 있다




'Cloud > docker' 카테고리의 다른 글

docker for linux fundimental  (0) 2018.04.12
kubernetes  (0) 2018.03.26
Kuber  (0) 2017.10.19
네트워크  (0) 2017.10.18
3  (0) 2017.10.18

devops lab3

Cloud/AWS2017. 8. 31. 14:09

Myung-ui-MacBook-Air:Downloads Jay$ chmod 400 qwikLABS-L1417-907037.pem 

Myung-ui-MacBook-Air:Downloads Jay$ ssh -i qwikLABS-L1417-907037.pem ec2-user@54.89.184.6

The authenticity of host '54.89.184.6 (54.89.184.6)' can't be established.

RSA key fingerprint is e5:70:6d:17:e1:b0:75:1f:2c:cc:35:85:a5:d6:b7:b8.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '54.89.184.6' (RSA) to the list of known hosts.


       __|  __|_  )

       _|  (     /   Amazon Linux AMI

      ___|\___|___|


https://aws.amazon.com/amazon-linux-ami/2017.03-release-notes/

[ec2-user@ip-10-1-10-250 ~]$ 

[ec2-user@ip-10-1-10-250 ~]$ 

[ec2-user@ip-10-1-10-250 ~]$ 




[ec2-user@ip-10-1-10-250 ~]$ aws codecommit create-repository --repository-name myung --region us-east-1

{

    "repositoryMetadata": {

        "repositoryName": "myung", 

        "cloneUrlSsh": "ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/myung", 

        "lastModifiedDate": 1504152906.66, 

        "repositoryId": "1262ccb8-cf22-4e03-b5fc-a14fd4d65f8e", 

        "cloneUrlHttp": "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/myung", 

        "creationDate": 1504152906.66, 

        "Arn": "arn:aws:codecommit:us-east-1:223206376027:myung", 

        "accountId": "223206376027"

    }

}

[ec2-user@ip-10-1-10-250 ~]$ ll

합계 8

-rwxr-xr-x 1 ec2-user ec2-user 4196  2월 23  2016 setup-codecommit.sh

[ec2-user@ip-10-1-10-250 ~]$ vi setup-codecommit.sh 

[ec2-user@ip-10-1-10-250 ~]$ ./setup-codecommit.sh 


This script will perform the steps necessary to setup AWS CodeCommit;

including provisioning IAM users and uploading SSH keys.











































Lets start with developer1 - creating IAM user and CLI profile...

{

    "User": {

        "UserName": "developer1", 

        "Path": "/", 

        "CreateDate": "2017-08-31T04:17:02.611Z", 

        "UserId": "AIDAJT5XCT4DNVIEEJVTW", 

        "Arn": "arn:aws:iam::223206376027:user/developer1"

    }

}



































developer profile complete.  Time to upload SSH key to IAM and configure local SSH settings.
























































































All finished with developer1.  Lets set up the CI user and EC2 instance now!












































Creating IAM user for the Continuous Integration platform

{

    "User": {

        "UserName": "ci-user", 

        "Path": "/", 

        "CreateDate": "2017-08-31T04:17:22.802Z", 

        "UserId": "AIDAIQYOGRZ53M65UJRHM", 

        "Arn": "arn:aws:iam::223206376027:user/ci-user"

    }

}

Warning: Permanently added '10.1.10.43' (ECDSA) to the list of known hosts.

id_rsa.pub                                                                                             100%  400     0.4KB/s   00:00    

Connecting to 10.1.10.43 to configure the CI Instance with access to AWS CodeCommit
































ci-config                                                                                              100%  137     0.1KB/s   00:00    

Connection to 10.1.10.43 closed.

Connection to 10.1.10.43 closed.










































Configuration for ci-user complete.  The setup script will now exit.












































[ec2-user@ip-10-1-10-250 ~]$ source ~/.bash_profile 

[ec2-user@ip-10-1-10-250 ~]$ cd /opt/git/ci-project/

[ec2-user@ip-10-1-10-250 ci-project]$ ll

합계 8

drwxr-xr-x 2 ec2-user apache 4096  8월 31 02:35 cfn

drwxr-xr-x 2 ec2-user apache 4096  8월 31 02:35 php

[ec2-user@ip-10-1-10-250 ci-project]$ git init

초기화: 빈 깃 저장소, 위치 /opt/git/ci-project/.git/

[ec2-user@ip-10-1-10-250 ci-project]$ wget -O cfn/lab-3-app-test-env.template https://d2lrzjb0vjvpn5.cloudfront.net/devops/v1.5/lab-3-ci/static/lab-3-app-test-env.template

--2017-08-31 04:20:32--  https://d2lrzjb0vjvpn5.cloudfront.net/devops/v1.5/lab-3-ci/static/lab-3-app-test-env.template

Resolving d2lrzjb0vjvpn5.cloudfront.net (d2lrzjb0vjvpn5.cloudfront.net)... 52.84.118.125, 52.84.118.165, 52.84.118.244, ...

Connecting to d2lrzjb0vjvpn5.cloudfront.net (d2lrzjb0vjvpn5.cloudfront.net)|52.84.118.125|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 8280 (8.1K) [application/octet-stream]

Saving to: ‘cfn/lab-3-app-test-env.template’


cfn/lab-3-app-test-env.template    100%[=============================================================>]   8.09K  --.-KB/s    in 0s      


2017-08-31 04:20:32 (185 MB/s) - ‘cfn/lab-3-app-test-env.template’ saved [8280/8280]


[ec2-user@ip-10-1-10-250 ci-project]$ ll

합계 8

drwxr-xr-x 2 ec2-user apache 4096  8월 31 04:20 cfn

drwxr-xr-x 2 ec2-user apache 4096  8월 31 02:35 php

[ec2-user@ip-10-1-10-250 ci-project]$ wget -O ~/sample-app.tgz https://d2lrzjb0vjvpn5.cloudfront.net/devops/v1.5/lab-3-ci/static/sample-app.tgz

--2017-08-31 04:20:58--  https://d2lrzjb0vjvpn5.cloudfront.net/devops/v1.5/lab-3-ci/static/sample-app.tgz

Resolving d2lrzjb0vjvpn5.cloudfront.net (d2lrzjb0vjvpn5.cloudfront.net)... 52.84.118.93, 52.84.118.125, 52.84.118.165, ...

Connecting to d2lrzjb0vjvpn5.cloudfront.net (d2lrzjb0vjvpn5.cloudfront.net)|52.84.118.93|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 6268 (6.1K) [application/x-tar]

Saving to: ‘/home/ec2-user/sample-app.tgz’


/home/ec2-user/sample-app.tgz      100%[=============================================================>]   6.12K  --.-KB/s    in 0s      


2017-08-31 04:20:58 (1.79 GB/s) - ‘/home/ec2-user/sample-app.tgz’ saved [6268/6268]


[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ printf "################################\n\nMain branch initialized `date`.\n\n" >> readme.txt

[ec2-user@ip-10-1-10-250 ci-project]$ ll

합계 12

drwxr-xr-x 2 ec2-user apache   4096  8월 31 04:20 cfn

drwxr-xr-x 2 ec2-user apache   4096  8월 31 02:35 php

-rw-rw-r-- 1 ec2-user ec2-user   93  8월 31 04:21 readme.txt

[ec2-user@ip-10-1-10-250 ci-project]$ git add .

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ git commit -m "Initializing Git master branch

> "

[master (최상위-커밋) edc87d7] Initializing Git master branch

 Committer: EC2 Default User <ec2-user@ip-10-1-10-250.ec2.internal>

이름과 전자메일 주소를 사용자 이름과 호스트 이름을 이용해서 자동으로

설정했습니다. 이 정보가 맞는지 확인하십시오. 이 메시지를 보지 않으려면 정보를

명시적으로 설정하십시오. 다음 명령어를 실행하고 편집기의 안내에 따라 설정

파일을 편집하십시오:


    git config --global --edit


이렇게 한 다음, 이 커밋에 사용한 신원 정보를 다음과 같이 해서 바꿀 수 있습니다:


    git commit --amend --reset-author


 4 files changed, 343 insertions(+)

 create mode 100644 cfn/lab-3-app-test-env.template

 create mode 100644 php/errorpage.php

 create mode 100644 php/index.php

 create mode 100644 readme.txt

[ec2-user@ip-10-1-10-250 ci-project]$ git remote add origin ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/myung

[ec2-user@ip-10-1-10-250 ci-project]$ git push origin master

Warning: Permanently added 'git-codecommit.us-east-1.amazonaws.com,72.21.203.185' (RSA) to the list of known hosts.

오브젝트 개수 세는 중: 7, 완료.

오브젝트 압축하는 중: 100% (6/6), 완료.

오브젝트 쓰는 중: 100% (7/7), 2.23 KiB | 0 bytes/s, 완료.

Total 7 (delta 0), reused 0 (delta 0)

To ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/myung

 * [new branch]      master -> master

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ git remote -v

origin ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/myung (fetch)

origin ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/myung (push)

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ sudo ln -s /opt/git/ci-project/php/ /var/www/html/php

[ec2-user@ip-10-1-10-250 ci-project]$ git checkout -b new

새로 만든 'new' 브랜치로 전환합니다

[ec2-user@ip-10-1-10-250 ci-project]$ git branch

  master

* new

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ printf "################################\n\nInitialized new branch `date`.\n\n" >> readme.txt

[ec2-user@ip-10-1-10-250 ci-project]$ ll

합계 12

drwxr-xr-x 2 ec2-user apache   4096  8월 31 04:20 cfn

drwxr-xr-x 2 ec2-user apache   4096  8월 31 02:35 php

-rw-rw-r-- 1 ec2-user ec2-user  185  8월 31 04:30 readme.txt

[ec2-user@ip-10-1-10-250 ci-project]$ vi readme.txt 

[ec2-user@ip-10-1-10-250 ci-project]$ git add readme.txt 

[ec2-user@ip-10-1-10-250 ci-project]$ git commit -m "Recorded creation of new branch in readme.txt"

[new 72e61d7] Recorded creation of new branch in readme.txt

 Committer: EC2 Default User <ec2-user@ip-10-1-10-250.ec2.internal>

이름과 전자메일 주소를 사용자 이름과 호스트 이름을 이용해서 자동으로

설정했습니다. 이 정보가 맞는지 확인하십시오. 이 메시지를 보지 않으려면 정보를

명시적으로 설정하십시오. 다음 명령어를 실행하고 편집기의 안내에 따라 설정

파일을 편집하십시오:


    git config --global --edit


이렇게 한 다음, 이 커밋에 사용한 신원 정보를 다음과 같이 해서 바꿀 수 있습니다:


    git commit --amend --reset-author


 1 file changed, 4 insertions(+)

[ec2-user@ip-10-1-10-250 ci-project]$ git push origin new

Warning: Permanently added the RSA host key for IP address '54.239.20.180' to the list of known hosts.

오브젝트 개수 세는 중: 3, 완료.

오브젝트 압축하는 중: 100% (3/3), 완료.

오브젝트 쓰는 중: 100% (3/3), 381 bytes | 0 bytes/s, 완료.

Total 3 (delta 1), reused 0 (delta 0)

To ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/myung

 * [new branch]      new -> new

[ec2-user@ip-10-1-10-250 ci-project]$ git show :readme.txt

################################


Main branch initialized 2017. 08. 31. (목) 04:21:11 UTC.


################################


Initialized new branch 2017. 08. 31. (목) 04:30:22 UTC.


[ec2-user@ip-10-1-10-250 ci-project]$ git checkout master

'master' 브랜치로 전환합니다

[ec2-user@ip-10-1-10-250 ci-project]$ git show :readme.txt

################################


Main branch initialized 2017. 08. 31. (목) 04:21:11 UTC.


[ec2-user@ip-10-1-10-250 ci-project]$ git checkout new

'new' 브랜치로 전환합니다

[ec2-user@ip-10-1-10-250 ci-project]$ ll

합계 12

drwxr-xr-x 2 ec2-user apache   4096  8월 31 04:20 cfn

drwxr-xr-x 2 ec2-user apache   4096  8월 31 02:35 php

-rw-rw-r-- 1 ec2-user ec2-user  185  8월 31 04:32 readme.txt

[ec2-user@ip-10-1-10-250 ci-project]$ tar -xvf ~/sample-app.tgz -C /opt/git/ci-project/.

./

./php/

./php/errorpage.php

./php/index.php

./php/img/

./php/img/AWS_Logo_Web_200px.png

[ec2-user@ip-10-1-10-250 ci-project]$ ll

합계 12

drwxr-xr-x 2 ec2-user apache   4096  8월 31 04:20 cfn

drwxrwxr-x 3 ec2-user apache   4096  3월 27  2015 php

-rw-rw-r-- 1 ec2-user ec2-user  185  8월 31 04:32 readme.txt

[ec2-user@ip-10-1-10-250 ci-project]$ ll

합계 12

drwxr-xr-x 2 ec2-user apache   4096  8월 31 04:20 cfn

drwxrwxr-x 3 ec2-user apache   4096  3월 27  2015 php

-rw-rw-r-- 1 ec2-user ec2-user  185  8월 31 04:32 readme.txt

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ 

[ec2-user@ip-10-1-10-250 ci-project]$ vi cfn/lab-3-app-test-env.template 

[ec2-user@ip-10-1-10-250 ci-project]$ git add cfn/lab-3-app-test-env.template

[ec2-user@ip-10-1-10-250 ci-project]$ git commit -m "Corrected an issue with the test environment template"

[new eab0970] Corrected an issue with the test environment template

 Committer: EC2 Default User <ec2-user@ip-10-1-10-250.ec2.internal>

이름과 전자메일 주소를 사용자 이름과 호스트 이름을 이용해서 자동으로

설정했습니다. 이 정보가 맞는지 확인하십시오. 이 메시지를 보지 않으려면 정보를

명시적으로 설정하십시오. 다음 명령어를 실행하고 편집기의 안내에 따라 설정

파일을 편집하십시오:


    git config --global --edit


이렇게 한 다음, 이 커밋에 사용한 신원 정보를 다음과 같이 해서 바꿀 수 있습니다:


    git commit --amend --reset-author


 1 file changed, 1 insertion(+), 1 deletion(-)

[ec2-user@ip-10-1-10-250 ci-project]$ git push origin new

오브젝트 개수 세는 중: 4, 완료.

오브젝트 압축하는 중: 100% (4/4), 완료.

오브젝트 쓰는 중: 100% (4/4), 454 bytes | 0 bytes/s, 완료.

Total 4 (delta 1), reused 0 (delta 0)

To ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/myung

   72e61d7..eab0970  new -> new

[ec2-user@ip-10-1-10-250 ci-project]$ git branch

  master

* new

[ec2-user@ip-10-1-10-250 ci-project]$ git add .

[ec2-user@ip-10-1-10-250 ci-project]$ git commit -m "Completed v1.0 of sample app"

[new 93ea0f2] Completed v1.0 of sample app

 Committer: EC2 Default User <ec2-user@ip-10-1-10-250.ec2.internal>

이름과 전자메일 주소를 사용자 이름과 호스트 이름을 이용해서 자동으로

설정했습니다. 이 정보가 맞는지 확인하십시오. 이 메시지를 보지 않으려면 정보를

명시적으로 설정하십시오. 다음 명령어를 실행하고 편집기의 안내에 따라 설정

파일을 편집하십시오:


    git config --global --edit


이렇게 한 다음, 이 커밋에 사용한 신원 정보를 다음과 같이 해서 바꿀 수 있습니다:


    git commit --amend --reset-author


 3 files changed, 78 insertions(+)

 create mode 100644 php/img/AWS_Logo_Web_200px.png

[ec2-user@ip-10-1-10-250 ci-project]$ git push origin new

오브젝트 개수 세는 중: 7, 완료.

오브젝트 압축하는 중: 100% (7/7), 완료.

오브젝트 쓰는 중: 100% (7/7), 6.23 KiB | 0 bytes/s, 완료.

Total 7 (delta 0), reused 0 (delta 0)

To ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/myung

   eab0970..93ea0f2  new -> new

[ec2-user@ip-10-1-10-250 ci-project]$ git checkout master

'master' 브랜치로 전환합니다

[ec2-user@ip-10-1-10-250 ci-project]$ git merge new

업데이트 중 edc87d7..93ea0f2

Fast-forward

 cfn/lab-3-app-test-env.template |   2 +-

 php/errorpage.php               |  15 +++++++++++++++

 php/img/AWS_Logo_Web_200px.png  | Bin 0 -> 5243 bytes

 php/index.php                   |  63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 readme.txt                      |   4 ++++

 5 files changed, 83 insertions(+), 1 deletion(-)

 create mode 100644 php/img/AWS_Logo_Web_200px.png

[ec2-user@ip-10-1-10-250 ci-project]$ git push origin master

Total 0 (delta 0), reused 0 (delta 0)

To ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/myung

   edc87d7..93ea0f2  master -> master

[ec2-user@ip-10-1-10-250 ci-project]$ 



DevOps Engineering on AWS: Lab 3 - Continuous Integration - v1.5

==================================================================================================================

Using this command reference.

==================================================================================================================


1. Locate the section you need. Each section in this file matches a section in the lab instructions.

2. Replace items in angle brackets - < > - with appropriate values. For example, in this command you would replace the value - <JobFlowID> - (including the angle brackets) with the parameter indicated in the lab instructions:

elastic-mapreduce --list <JobFlowID>. You can also use find and replace to change bracketed parameters in bulk.

3. Do NOT enable the Word Wrap feature in Windows Notepad or the text editor you use to view this file.


++++1. Task: Initialize Continuous Integrations Framework

==================================================================================================================
1.2 Prepare the Git repository
==================================================================================================================

1.2.2 Create a new AWS CodeCommit Repository

aws codecommit create-repository --repository-name <repo name> --region us-east-1

1.2.3 View the contents of the setup script and run the setup script to configure permissions for CodeCommit

cat ./setup-codecommit.sh

./setup-codecommit.sh

1.2.4 Reload the bash_profile to enable profile:developer1

source ~/.bash_profile

1.2.5 Navigate to the local CI directory

cd /opt/git/ci-project

1.2.6 Initialize local Git repository

git init

1.2.7 Retrieve sample content

wget -O cfn/lab-3-app-test-env.template https://d2lrzjb0vjvpn5.cloudfront.net/devops/v1.5/lab-3-ci/static/lab-3-app-test-env.template

wget -O ~/sample-app.tgz https://d2lrzjb0vjvpn5.cloudfront.net/devops/v1.5/lab-3-ci/static/sample-app.tgz

1.2.8 Create simple text file

printf "################################\n\nMain branch initialized `date`.\n\n" >> readme.txt

1.2.9 Add files to Git repository

git add .

1.2.10 Commit files to Git repository

git commit -m "Initializing Git master branch"

1.2.11 Configure remote for CodeCommit repository

git remote add origin <cloneUrlSsh>

1.2.12 Push your commits to the origin

git push origin master

==================================================================================================================
1.3 Fork Branches
==================================================================================================================

1.3.1 Create symbolic link for unit testing

sudo ln -s /opt/git/ci-project/php /var/www/html/php

1.3.2 Create a new branch in your local Git repository

git checkout -b newWidget

1.3.3 Verify working branch

git branch

1.3.4 Update readme.txt

printf "################################\n\nInitialized newWidget branch `date`.\n\n" >> readme.txt

1.3.5 Add the readme file to a checkin

git add readme.txt

1.3.6 Commit the change

git commit -m "Recorded creation of new branch in readme.txt"

1.3.7 Push the commit to AWS CodeCommit

git push origin newWidget

1.3.8 Display current content of the readme.txt file

git show :readme.txt

1.3.9 Switch branches

git checkout master

1.3.10 View readme.txt in the master branch

git show :readme.txt

1.3.11 Switch back to the newWidget branch

git checkout newWidget

1.3.12 Extract the contents of the sample app

tar -xvf ~/sample-app.tgz -C /opt/git/ci-project/.

1.3.13 Browse to the custom app

http://<CommandHostPublicIp>/php/

==================================================================================================================
1.4 Create Automated Validation Jobs
==================================================================================================================

1.4.7 Add the branch to build

*/newWidget

1.4.9 Copy into the Schedule field

* * * * *

1.4.12 Add validation script

#!/bin/bash
/var/lib/jenkins/script/simple-test.sh

==================================================================================================================
1.5 Validate and Repair
==================================================================================================================

1.5.5 Ensure correct working directory

cd /opt/git/ci-project

1.5.6 Open up file for editing

vi cfn/lab-3-app-test-env.template

1.5.9 Add the change to the newWidget branch

git add cfn/lab-3-app-test-env.template

1.5.10 Commit changes

git commit -m "Corrected an issue with the test environment template"

1.5.11 Push changes to Git

git push origin newWidget

==================================================================================================================
1.6 Merge, Validate, and Deploy
==================================================================================================================

1.6.8 Jenkins shell command

#!/bin/bash
/var/lib/jenkins/script/test-build-deploy.sh

1.6.10 Confirm the current branch

git branch

If the result is master, switch back to newWidget:

git checkout newWidget

1.6.11 Add the changes

git add .

1.6.12 Commit the changes

git commit -m "Completed v1.0 of sample app"

1.6.13 Push the changes to the Git server

git push origin newWidget

1.6.16 Check out the master branch

git checkout master

1.6.17 Merge the newWidget branch into the master branch

git merge newWidget

1.6.18 Push the merged changes into the master branch

git push origin master


© 2017 Amazon Web Services, Inc. or its affiliates. All rights reserved.


'Cloud > AWS' 카테고리의 다른 글

devops lab2  (0) 2017.08.31
devops lab1  (0) 2017.08.31
Devops on AWS  (0) 2017.08.30
aws 정기 웨비나  (0) 2017.06.13
AWS 배포 3가지  (0) 2017.06.05

devops lab2

Cloud/AWS2017. 8. 31. 10:27

[ec2-user@ip-10-0-10-45 cfnverifierlambda]$ ll

합계 460

-rw-r--r-- 1 ec2-user root   1118  8월 10  2016 _sampleEvent.json

-rw-r--r-- 1 ec2-user root   1885 12월 18  2015 _testdriver.js

-rw-r--r-- 1 ec2-user root   3333  8월 10  2016 cfn-verifier-lambda.js

-rw-r--r-- 1 ec2-user root 434659  8월 11  2016 cfnverifierlambda.zip

-rw-r--r-- 1 ec2-user root    561 12월 18  2015 lab-2-simple-test-cfn-lambda.template

-rw-r--r-- 1 ec2-user root   1308  1월 18  2016 lambda-iam-setup.js

-rw-r--r-- 1 ec2-user root   1068 12월 18  2015 lambda-iam-setup.ps1

-rw-r--r-- 1 ec2-user root    290  8월 30 23:08 lambda-trust-rel.json

drwxr-xr-x 4 ec2-user root   4096  8월 31 00:39 node_modules

[ec2-user@ip-10-0-10-45 cfnverifierlambda]$ aws lambda create-function --function-name "CfnVerifierLambda" --role arn:aws:iam::812140151192:role/LambdaCustomResourceExecutionPolicy --runtime nodejs4.3 --handler cfn-verifier-lambda.handler --zip-file fileb://cfnverifierlambda.zip

{

    "TracingConfig": {

        "Mode": "PassThrough"

    }, 

    "CodeSha256": "Agdpllmb6ykzgeThVcOhVsJsTFW3DdoRE7hhIgM8kk4=", 

    "FunctionName": "CfnVerifierLambda", 

    "CodeSize": 434659, 

    "MemorySize": 128, 

    "FunctionArn": "arn:aws:lambda:us-east-1:812140151192:function:CfnVerifierLambda", 

    "Version": "$LATEST", 

    "Role": "arn:aws:iam::812140151192:role/LambdaCustomResourceExecutionPolicy", 

    "Timeout": 3, 

    "LastModified": "2017-08-31T00:54:04.959+0000", 

    "Handler": "cfn-verifier-lambda.handler", 

    "Runtime": "nodejs4.3", 

    "Description": ""

}

[ec2-user@ip-10-0-10-45 cfnverifierlambda]$ 

  [복원됨]

Last login: Thu Aug 31 09:17:28 on ttys000

Myung-ui-MacBook-Air:Downloads Jay$ 

Myung-ui-MacBook-Air:Downloads Jay$ 

Myung-ui-MacBook-Air:Downloads Jay$ ssh -i qwikLABS-L1416-906673.pem ec2-user@ec2-54-210-200-31.compute-1.amazonaws.com

Last login: Thu Aug 31 00:19:51 2017 from 115.89.233.194


       __|  __|_  )

       _|  (     /   Amazon Linux AMI

      ___|\___|___|


https://aws.amazon.com/amazon-linux-ami/2017.03-release-notes/

[ec2-user@ip-10-0-10-45 ~]$ cd cfnverifierlambda/

[ec2-user@ip-10-0-10-45 cfnverifierlambda]$ sudo python -m SimpleHTTPServer 80

Serving HTTP on 0.0.0.0 port 80 ...


115.89.233.194 - - [31/Aug/2017 01:11:47] "GET / HTTP/1.1" 200 -

115.89.233.194 - - [31/Aug/2017 01:11:48] code 404, message File not found

115.89.233.194 - - [31/Aug/2017 01:11:48] "GET /favicon.ico HTTP/1.1" 404 -

115.89.233.194 - - [31/Aug/2017 01:11:48] "GET / HTTP/1.1" 200 -

115.89.233.194 - - [31/Aug/2017 01:11:53] "GET /_sampleEvent.json HTTP/1.1" 200 -

115.89.233.194 - - [31/Aug/2017 01:11:58] "GET /_testdriver.js HTTP/1.1" 200 -

115.89.233.194 - - [31/Aug/2017 01:12:11] "GET /node_modules/ HTTP/1.1" 200 -

115.89.233.194 - - [31/Aug/2017 01:12:13] "GET /node_modules/async/ HTTP/1.1" 200 -

'Cloud > AWS' 카테고리의 다른 글

devops lab3  (0) 2017.08.31
devops lab1  (0) 2017.08.31
Devops on AWS  (0) 2017.08.30
aws 정기 웨비나  (0) 2017.06.13
AWS 배포 3가지  (0) 2017.06.05