Skip to content

Instantly share code, notes, and snippets.

Git 교육 자료 & 연습 사이트 정리

분류 기준

  • 난이도: 입문 / 초중급 / 중급 이상
  • 목적: 개념 이해 / 실습 / 협업

1️⃣ 입문 (Git 처음)

# ec2 에서
#설치
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# helm repo 추가
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install monitoring prometheus-community/kube-prometheus-stack \
-n monitoring --create-namespace \
#설치
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# helm repo 추가
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
# 리소스 제한해서 monitoring
helm install monitoring prometheus-community/kube-prometheus-stack \
-n monitoring --create-namespace \
# ec2
sudo cat /etc/rancher/k3s/k3s.yaml > /home/ubuntu/k3s-embedded.yaml
sudo chown ubuntu:ubuntu /home/ubuntu/k3s-embedded.yaml
# local
scp -i {key pair path} \
ubuntu@{ec2 ip}:/home/ubuntu/k3s-embedded.yaml \
~/.kube/k3s-gangwon-ec2.yaml
export KUBECONFIG=~/.kube/k3s-gangwon-ec2.yaml
# ec2 설치
curl -sfL https://get.k3s.io | sh -s - --docker --disable traefik --write-kubeconfig-mode 644
mkdir -p $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
# ec2 포트포워딩 추가
# ec2 kubeconfig 복사
cat << 'EOF' >> ~/.bashrc
# kubectl aliases
alias k=kubectl
alias kg='kubectl get'
alias kga='kubectl get all'
alias kd='kubectl describe'
alias kdel='kubectl delete'
alias kaf='kubectl apply -f'
alias kdf='kubectl delete -f'
curl -sfL https://get.k3s.io | sh -s - --docker --disable traefik --write-kubeconfig-mode 644
mkdir -p $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
# 1. 사용자 정보
git config --global user.name "서영학"
git config --global user.email "your-email@example.com"
# 2. 기본 브랜치 이름 main으로
git config --global init.defaultBranch main
# 3. github token 키체인 저장
git config --global credential.helper osxkeychain
# 3-1 windows 일 경우