Skip to content

Commit

Permalink
merge 병합
Browse files Browse the repository at this point in the history
  • Loading branch information
sofia authored and sofia committed Nov 26, 2024
2 parents f19aa06 + 2519dd2 commit d93d2cb
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 5 deletions.
33 changes: 32 additions & 1 deletion k8s-cluster-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

## 설치 방법

<<<<<<< HEAD
1. aws 네트워크 구성 설치:
```
cd terraform
Expand Down Expand Up @@ -44,13 +45,43 @@ ansible-playbook playbooks/setup-argocd (최대 10분 소요)

## 디렉토리 구조
- `inventory/ptk/`: 클러스터 설정 파일
=======
1. 저장소 클론:
```bash
git clone https://github.com/your-org/k8s-cluster-config.git
cd k8s-cluster-config
```

2. 사전 요구사항 설치:
```bash
./scripts/setup-requirements.sh
```

3. 클러스터 설치:
```bash
./install.sh
```

4. 설치 검증:
```bash
./scripts/verify-installation.sh
```

## 디렉토리 구조
- `inventory/ptk-dev/`: 클러스터 설정 파일
- `scripts/`: 유틸리티 스크립트
>>>>>>> 2519dd2bed55a806a97d29202daeea748c1ab6bc
## 주의사항
- AWS 자격 증명이 필요합니다
- 방화벽 설정을 확인해주세요
<<<<<<< HEAD
- SSH 키는 ~/.ssh/ptk-k8s-key.pem 위치에 있어야 합니다

kubectl apply -f root-app.yaml

helm repo add jetstack https://charts.jetstack.io
helm repo update
helm repo update
=======
- SSH 키는 ~/.ssh/ptk-k8s-key.pem 위치에 있어야 합니다
>>>>>>> 2519dd2bed55a806a97d29202daeea748c1ab6bc
37 changes: 37 additions & 0 deletions k8s-cluster-config/inventory/ptk-dev/group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 기본 클러스터 설정
cluster_name: ptk-dev
aws_region: "ap-northeast-2"

# 네트워크 설정
kube_network_plugin: calico
kube_pods_subnet: "172.16.0.0/16"
kube_service_addresses: "10.233.0.0/18"

# 컨테이너 런타임 설정
container_manager: containerd
dns_mode: coredns

# 쿠버네티스 버전 설정
kube_version: v1.30.0

# 클라우드 프로바이더 설정
cloud_provider: external

# AWS CCM 설정
aws_cloud_controller_manager_enabled: true
aws_cloud_controller_manager_version: v1.30.0
aws_ebs_csi_enabled: true

# kubeadm 설정
kubeadm_config:
init:
nodeRegistration:
kubeletExtraArgs:
cloud-provider: "external"
cluster:
apiServer:
extraArgs:
cloud-provider: "external"
controllerManager:
extraArgs:
cloud-provider: "external"
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# AWS Cloud Controller Manager
aws_cloud_controller_manager_enabled: true

# AWS EBS CSI Driver
aws_ebs_csi_enabled: true
aws_ebs_csi_enable_volume_scheduling: true
aws_ebs_csi_enable_volume_snapshot: true
aws_ebs_csi_enable_volume_resizing: true
aws_ebs_csi_controller_replicas: 1

# Dashboard (필요한 경우)
dashboard_enabled: false

# Helm (필요한 경우)
helm_enabled: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kube_version: v1.30.0
container_manager: containerd
cluster_name: ptk-dev
cloud_provider: external
kube_pods_subnet: 10.244.0.0/16
kubelet_node_config:
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
cloudProvider: external
28 changes: 28 additions & 0 deletions k8s-cluster-config/inventory/ptk-dev/hosts.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[all]
ip-10-0-1-93.ap-northeast-2.compute.internal ansible_host=13.124.196.146 ip=10.0.1.93 etcd_member_name=etcd1
ip-10-0-1-63.ap-northeast-2.compute.internal ansible_host=43.203.208.123 ip=10.0.1.63
ip-10-0-2-213.ap-northeast-2.compute.internal ansible_host=13.125.205.70 ip=10.0.2.213

[all:vars]
ansible_user=ubuntu
ansible_become=true
ansible_ssh_private_key_file=~/.ssh/ptk-k8s-key.pem
kube_user=root
cluster_name=ptk-dev

[kube_control_plane]
ip-10-0-1-93.ap-northeast-2.compute.internal

[etcd]
ip-10-0-1-93.ap-northeast-2.compute.internal

[kube_node]
ip-10-0-1-63.ap-northeast-2.compute.internal
ip-10-0-2-213.ap-northeast-2.compute.internal

[calico_rr]

[k8s_cluster:children]
kube_control_plane
kube_node
calico_rr
5 changes: 2 additions & 3 deletions k8s-cluster-config/playbooks/setup_argocd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
become: true
vars:
service_port: 30080
git_repo_url: "https://github.com/Parrotalk/Parrotalk-Manifests.git"
git_repo_url: "https://github.com/your-username/infrastructure-gitops.git"
git_username: "suugit"
git_token: "ghp_"
cluster_name: ptk
git_token: "ghp"
roles:
- argocd
2 changes: 1 addition & 1 deletion k8s-cluster-config/roles/argocd/tasks/argocd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
command: "helm repo add jetstack https://charts.jetstack.io"

- name: Update Helm repositories
command: "helm repo update"
command: "helm repo update"
Empty file.
18 changes: 18 additions & 0 deletions k8s-cluster-config/roles/argocd/tasks/gitrepo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- name: Get Argo CD initial admin password
shell: "kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 --decode"
register: argocd_admin_password


# - name: Add Git repository to ArgoCD
# command: >
# argocd login --port-forward-namespace argocd
# --username admin
# --password {{ argocd_password.stdout }}
# --plaintext

# - name: Add repository
# command: >
# argocd repo add {{ git_repo_url }}
# --username {{ git_username }}
# --password {{ git_token }}
# --port-forward-namespace argocd

0 comments on commit d93d2cb

Please sign in to comment.