PaaS 221

SSH key로 Github 인증 받기

우선 내 로컬 혹은 서버 (어디든 무관하다.) 에서 SSH 접속을 위한 RSA Key를 생성한다. 이때 필자는 key의 이름을 GH_RO_key_rsa 라고 하겠다.imacs-imac:~ scott$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/~/~/.ssh/id_rsa): /~/~/.ssh/GH_RO_key_rsa Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /~/~/.ssh/GH_RO_key_rsa. Your publi..

PaaS/CI CD 2024.12.28

ArgoCD) Git-Sync를 통하여 주기적으로 git repo fetch 받아오게 하기

가끔식 kustomization이나 Submodule과 같은 경우 다른 Repository의 최신 버전을 참고해야 할 때가 있다.  이때는 ArgoCD 의 구성요소중 argocd-repo-server를 활용하여야 한다. 참고로 argocd-repo-server는 argocd에서 repository에 대한 fetch를 받을때 사용하는 컴포넌트로써 /tmp 경로 하위에 fetch 받은 repo의 Cache가 쌓인다. 여기서 먼저 질의한후 없으면 실제 repo에서 fetch 받는 구조이다. https://argo-cd.readthedocs.io/en/stable/operator-manual/server-commands/argocd-repo-server/#argocd-repo-server  이 argocd-re..

PaaS/CI CD 2024.12.27

Kustomization) Kustomize build 시 참조되는 파일 경로 유효성 평가 생략하기

Kustomize는 Build할때 참조되는 Resource들의 path에 대해서 정합성을 체크한다. 휴먼에러를 방지하기 위한 내부 메커니즘으로 보이는데, Kustomization으로 build하는 Application Scope을 벗어난 리소스 참조는 실패하도록 설계되어 있다.  가령├── base│ ├── app-new-manifest.yaml # I am trying to patch this│ ├── kustomization.yaml│ ├── app│ │ ├── app.yaml│ │ └── kustomization.yaml└── overlay └── environment1 │ ├── kustomization.yaml # I want to patch app-ne..

PaaS/CI CD 2024.12.27

Sidecar Injector 사용하기

k8s를 운영하다 보면 Sidecar를 체계적으로 관리하고 싶을 때가 있다. Istio가 아니더라도 Sidecar가 필요한 경우는 많다.  이 경우에 tumblr에서 opensource로 제공한 Sidecar Injector를 사용하면 좋다.  1. Git Clonegit clone https://github.com/tumblr/k8s-sidecar-injector.git 2. Certificate  export ORG="org1" DOMAIN="org1.com"sed -i '' -e "s|__ORG__|$ORG|g" -e "s|__DOMAIN__|$DOMAIN|g" examples/tls/ca.conf examples/tls/csr-prod.conf  3. TLS 용 Key 생성export DEPLOY..

PaaS/Kubernetes 2024.12.17

Gitlab Runner ) kubernetes Executor Error 'Is the docker daemon running?'

ERROR: Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running? Gitlab Runner를 kubernetes executor로 배포하여 사용중이다. 그런데 docker build를 CICD에서 수행하게 되면 위와 같은 오류가 발생한다.  정말 많은 트러블 슈팅을 했다.  내가 최종적으로 적용한 Solution을 공유하고자 한다. 1. Helm으로 Runner Kubernetes Executor를 배포하였는데, 다음의 Value를 values.yaml에 추가한다.runners: privileged: true config: | [[runners]] environment = [ ..

PaaS/CI CD 2024.12.15

Gitlab Runner ) Kubernetes에 scaling Runner 배포하기

일반 인스턴스에 Runner를 배포하게되면 하나의 Deamon에서 queue로 들어오는 Job을 처리하게 된다. Github에는 ARC(Actions Runner Controller)라고 On-Demand하게 Scaling되는 Runner type이 있는데, 이와 유사한게 Gitlab Runner에서는 kubernetes type Executor이다.   설치방법1. Gitlab Helm 용 Repo 등록$ helm repo add gitlab https://charts.gitlab.io 2, 필요한 경우 Helm init을 수행한다. 3. Gitlab Runner 버전을 확인한다.$ helm search repo -l gitlab/gitlab-runner 4. 만약 최신 Gitlab 버전을 접근할 수 ..

PaaS/CI CD 2024.12.10

DockerHub Rate Limit 정책 그리고 이슈

Docker Hub rate limit | Docker Docs Docker Hub rate limitLearn how download rate limits for image pulls on Docker Hub workdocs.docker.com  DockerHub에서 Image Pull을 할 경우 다음의 정책을 따른다. User type Rate limit Anonymous users100 pulls per 6 hours per IP addressAuthenticated users200 pulls per 6 hour periodUsers with a paid Docker subscriptionUp to 5000 pulls per day  만약 당신의 Kubernetes 혹은 CICD Workflow에..

PaaS/CI CD 2024.08.03

Gitlab-CI) AWS CLI 사용을 위한 인증 방법

ECR에 이미지를 Push하거나 할때 AWS Configure가 미리 선행되어 있어야 한다. Gitlab CI는 관련한 Action을 이미 정형화 해서 서비스 제공을 하는데... 1. AWS IAM에서 사용자를 추가한다. 그리고 Access Token을 발행한다. 2. 위 사용자에 Policy를 부여한다. 해당 Poilcy는 아래의 JSON과 같이 정의한다. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ecr:CompleteLayerUpload", "ecr:GetAuthorizationToken", "ecr:UploadLayerPart", "ecr:InitiateLayerUpload", "ecr:BatchCheck..

PaaS/CI CD 2024.03.11

Github Actions) 나의 Github 계정에서 수행된 Actions History를 모두 수집해보자

본 과제는 Github Actions 사용 추이 통계를 작성하는 과정에서 필요한 데이터를 얻기 위해 추진한 내용이다. Github API에서는 특정 Repository에 대한 Github Actions 이력을 보여준다. 예시로 https://api.github.com/repos/armyost/testPagePy/actions/runs 와 같이 조회하게 되면 아래와 같은 JSON 데이터 가 나온다. { "total_count": 106, "workflow_runs": [ { "id": 8049570541, "name": "Python application", "node_id": "WFR_kwLOFs44Vs8AAAAB38qy7Q", "head_branch": "master", "head_sha": "3120..

PaaS/CI CD 2024.03.03