[K8S]ETCD - Commands

2024. 12. 2. 13:50·Endpoint

ETCD - Commands

 

(Optional) Additional information about ETCDCTL Utility

 

ETCDCTL is the CLI tool used to interact with ETCD.

ETCDCTL can interact with ETCD Server using 2 API versions - Version 2 and Version 3.  By default its set to use Version 2. Each version has different sets of commands.

For example ETCDCTL version 2 supports the following commands:

 

etcdctl backup
etcdctl cluster-health
etcdctl mk
etcdctl mkdir
etcdctl set

 

Whereas the commands are different in version 3

 

etcdctl snapshot save 
etcdctl endpoint health
etcdctl get
etcdctl put

 

 

To set the right version of API set the environment variable ETCDCTL_API command

export ETCDCTL_API=3

 

When API version is not set, it is assumed to be set to version 2. And version 3 commands listed above don't work. When API version is set to version 3, version 2 commands listed above don't work.

 

Apart from that, you must also specify path to certificate files so that ETCDCTL can authenticate to the ETCD API Server. The certificate files are available in the etcd-master at the following path. We discuss more about certificates in the security section of this course. So don't worry if this looks complex:

 
--cacert /etc/kubernetes/pki/etcd/ca.crt     
--cert /etc/kubernetes/pki/etcd/server.crt     
--key /etc/kubernetes/pki/etcd/server.key

 

So for the commands I showed in the previous video to work you must specify the ETCDCTL API version and path to certificate files. Below is the final form:

 

  1. kubectl exec etcd-master -n kube-system -- sh -c "ETCDCTL_API=3 etcdctl get / --prefix --keys-only --limit=10 --cacert /etc/kubernetes/pki/etcd/ca.crt --cert /etc/kubernetes/pki/etcd/server.crt --key /etc/kubernetes/pki/etcd/server.key"
저작자표시 비영리 변경금지 (새창열림)

'Endpoint' 카테고리의 다른 글

[PowerCLI]VM Template 통한 VM머신 다수 배포  (0) 2024.07.24
[Windows]VMWare PowerCLI 모듈 설치 및 설정 : 효율적인 가상화 관리  (0) 2024.07.23
[Linux] syslog 시스템 로그 관리  (0) 2024.07.04
VMWare OVF 추출  (0) 2023.03.22
[Ubuntu] 고정 IP부여 + 실수썰  (0) 2020.09.23
'Endpoint' 카테고리의 다른 글
  • [PowerCLI]VM Template 통한 VM머신 다수 배포
  • [Windows]VMWare PowerCLI 모듈 설치 및 설정 : 효율적인 가상화 관리
  • [Linux] syslog 시스템 로그 관리
  • VMWare OVF 추출
카이로스차니
카이로스차니
지금부터 공부하고 꾸준하게 기록하자 일단 시작해보라
  • 카이로스차니
    차니의 IT 인사이트 하이브
    카이로스차니
  • 전체
    오늘
    어제
    • 분류 전체보기
      • AWS
        • 리전
        • Route53 & DNS
        • VPC
        • Internet gatway
        • route table
        • EC2 & AMI & PEM
        • 서브넷
        • s3
        • sg (secret group)
        • elb
        • rds
        • cdn (cloud front)
        • 람다
        • autoscaling
        • direct connect
        • redis
        • IAM
      • Endpoint
      • Kubernetes
      • DevOps
        • CICD
        • Infrastructure as Code (IaC..
        • 컨테이너&이미지
        • 스토리지
        • 모니터링
      • 네트워크
      • 모니터링
      • NCP(네이버클라우드)
      • 프로그래밍
        • Python
        • Java
        • C
        • power shell
      • 공부
        • 정보보안기사
      • 기타
      • 정보
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • Github
  • 공지사항

  • 인기 글

  • 태그

    windowsec2
    ALB
    나비테어시스템
    방화벽실수
    it 대란 원인은
    syslogd
    k8s
    it장애
    windows
    전원onoff
    ec2rescue
    it대란
    ovf추출
    PowerCLI
    tekton
    vm
    리눅스로그
    GWLB
    OVF
    Amazon Linux 2023
    ㅁㅈㄴ
    rdp오류
    ms발 it대란
    vm template
    ova추출
    쿠버네티스
    ms클라우드서비스장애
    aws팁
    로드밸런서
    vmware
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
카이로스차니
[K8S]ETCD - Commands
상단으로

티스토리툴바