본문 바로가기

Code/cloud & linux & git

[GCP공부] Coursera: Google Cloud Platform Fundamentals: Core Infrastructure - Getting Started with Google Cloud Platform

Introduction

프로젝트를 조직화하고 관리하기 위해서 Google Cloud Identity and Access Management 를 사용해야 합니다.(IAM, IM)

 

GCP's management layer

There are four way to interact with GCP's management layer 

- web-based console

- sdk command-line tools 이거 두개만 쓸꺼임

- APIs

- mobile app

 

예전에 클라우드 없었을때는 (on-premises시절) 에는 보안의 모든것을 책임져야만 했다.

From the physical security of the hardware, and the premises in which they're housed, through the encrption of the data on disk, the integrity of your network, all the way up to securing the content stored in those applications.

근데 구글은 

Layers

 

The Google Cloud Platform resource hierarchy

모든 리소스는 '프로젝트' 안에서 관리된다.

프로젝트는 폴더에 담을수 있고, 폴더도 폴더에 담을수 있고 

All the folders and projects used by your organization can be brought together under an organization node.

여기에는 다 정책이 적용된다. (예외가 있음 ex ) cloud storage buckets)

remember that policies are inherited downwards in the hierarchy.

projectId: unique

projectName: 내맘대로

proejctNumber: unique -> 이건 이번에 배우는 범위에 없음

 

 

 

 

하여튼 organization node를 만들면 

이게 먼말이지;; resource는 우리 팀이면 다 만들수 있다고 하는것 같음 그러니 정하는게 좋을것 같음

 

 

권한을 뺐는다는게.. ㅇㅇ

Identity and Access Management (IAM)

IAM lets administrators authorize who can take action on specific resources.

An IAM role is a collection of permissions.

 

 

IAM roles

Compute Engines InstanceAdmin Role 이거에 대해 설명함 (다시한번 상기: Role은 권한의 묶음)

이 롤을 부여한 사람들에게 어떤 action을 하게 함: 

어느 리소스에 적용할지 선택하면 됨 .

 

그리고 least-previlige 규칙 따르는게 좋음

롤은 커스텀 해서 세세하게 설정하수도 있음, custom roles 라는걸 사용하면됨

주의사항 1: custom roles를 사용하기로 결정해야함 (회사에서!) 왜냐면 그냥 기존에 정해진 권한만 사용하길 원하는 회사가 있음

주의사항 2: custom roles  오직 project or organization levels에 만 사용가능해

 

사람이 아닌 Compute engine에 롤을 주고 싶으면 어떻게 할까? 

예를 들어 내 Compute engine만 Cloud storage에 접근하게 하고 싶어. (다른서비스랑 다른 유저들은 접근 못하게 하고 싶어)

Then you would use a service account.

 

서비스 어카운트를 만들어서 내 compute engine -> cloud storage 를 인증하면 됨

서비스 어카운트의 이름은 email address 로 해야함 비번은 안쓰고 cryptographics keys 를 사용한다고 함 to access resources

 

예를 들어 service account has been grated compute Engine's InstanceAdmin Role.

적용하고 싶은롤에 Service Account 만들어서 -> 리소스에 할당하면 됨

ex) 엘리스(사람이)는 Service Account 에서 어떤 행동을 할수있는지 관리하고 싶어해

밥은 그냥 Service Account 에서 어떤 행동이 있는지 확인(Just view)만 하고 싶음

근데 Service Account 또한 리소스여서 it can have IAM policies on its own.

그래서 이전에 했던것 처럼 엘리스는 에디터 롤을 주면되고 밥은 뷰어롤을 주면 됨

위의 그림에서 서비스 어카운트가 없다고 생각하고 보자

프로젝트 b에 접근하고 싶다. 그러면 프로젝트에 있는 모든 resource (즉, compute engine)에  Service Account 를 줘서 프로젝트에 접근하게 하면 된다. 근데 이렇게하면 잠재적인 위험이 있으니 필요한 부분만 권한을 줘보자

 

비슷한 기능을하는 compute engine 들끼리 묶어서 component_1, component_2 라고 하기로 하자

근데 component_1 만 project b에 접근하게 하고 싶어 이럴때 component_1만 Service Account 1를 사용해서 Editor 권한을 주면 된다. component_2는 걍 뷰어권한 정도..

 

Ps. 문제풀면서 느낀거

organization node를 언제만드냐면, 폴더 사용할때, 정책 전반적으로 적용할때

Interacting with Google Cloud Platform

GCP와 상호작용하는 방법은 4가지 있습니다.

- console:

- sdk and cloud shell:

- mobile app: 리소스확인하고 대쉬보드만들고 .. 별거아님

- APIs: 구글 서비스들이 API를 제공함. 그럼 내 코드로 컨트롤 할수 있음 (JSON)

Cloud Marketplace (formerly Cloud Launcher)

create react app 처럼 이것도 Google Cloud Launcher 가 있다.  함수형 소프트웨어 패키지를 빠르게 배포해준다. 

 compute instances, storage, network setting 자동으로 해준다. 근데 배포전엔 수정을 해줘야한다. 특별히 더 붙는 가격은 없고, 일반 인스턴스 비용이랑 똑같다. 근데 third part commercially licensed software 가 붙으면 추가 비용이 붙을수 있다. 근데 이것들 다 시작전에 예상금액이 보여주니다. 확인하자 . 예상금액은 '예상'일 뿐이다. 기본적인 이미지가 업데이트되면 deployed systems에서 maintain them 해주면 됨

 

동영상에서 LAMP stack 배포하는거 보여줌. (별거없음)  (퀵랩으로 해봄)

퀴즈도 품 모듈 1끝