Argo CD 애플리케이션


Red Hat OpenShift GitOps 1.10

Argo CD 대시보드 또는 oc 툴을 사용하여 OpenShift 클러스터에서 애플리케이션 생성 및 배포

Red Hat OpenShift Documentation Team

초록

이 문서에서는 Argo CD 대시보드를 사용하거나 oc 툴을 사용하여 OpenShift 클러스터에 애플리케이션을 생성하고 배포하는 방법을 설명합니다. Argo CD에서 자동 복구 동작을 확인하는 방법도 설명합니다.

1장. Argo CD로 Spring Boot 애플리케이션 배포

Argo CD를 사용하면 Argo CD 대시보드를 사용하거나 oc 툴을 사용하여 애플리케이션을 OpenShift 클러스터에 배포할 수 있습니다.

1.1. 사전 요구 사항

  • Red Hat OpenShift GitOps가 클러스터에 설치되어 있습니다.
  • Argo CD 인스턴스에 로그인합니다.

1.2. Argo CD 대시보드를 사용하여 애플리케이션 생성

Argo CD는 애플리케이션을 만들 수 있는 대시보드를 제공합니다.

프로세스

  1. Argo CD 대시보드에서 새 APP를 클릭하여 새 Argo CD 애플리케이션을 추가합니다.
  2. 이 워크플로의 경우 다음 구성을 사용하여 Spring-petclinic 애플리케이션을 생성합니다.

    애플리케이션 이름
    spring-petclinic
    프로젝트
    default
    동기화 정책
    자동
    리포지터리 URL
    https://github.com/redhat-developer/openshift-gitops-getting-started
    버전
    HEAD
    경로
    app
    대상
    https://kubernetes.default.svc
    네임스페이스
    spring-petclinic
  3. 만들기 클릭하여 애플리케이션을 생성합니다.
  4. 왼쪽 메뉴에서 웹 콘솔의 관리자 화면을 열고 관리 → 네임스페이스 로 이동합니다.
  5. 네임스페이스를 검색하고 선택한 다음 레이블 필드에 argocd.argoproj.io/managed-by=openshift-gitops 를 입력하여 openshift-gitops 네임스페이스의 Argo CD 인스턴스가 네임스페이스를 관리할 수 있도록 합니다.

1.3. oc 툴을 사용하여 애플리케이션 생성

oc 툴을 사용하여 터미널에서 Argo CD 애플리케이션을 생성할 수 있습니다.

프로세스

  1. 샘플 애플리케이션을 다운로드합니다.

    $ git clone git@github.com:redhat-developer/openshift-gitops-getting-started.git
    Copy to Clipboard Toggle word wrap
  2. 애플리케이션을 생성합니다.

    $ oc create -f openshift-gitops-getting-started/argo/app.yaml
    Copy to Clipboard Toggle word wrap
  3. oc get 명령을 실행하여 생성된 애플리케이션을 검토합니다.

    $ oc get application -n openshift-gitops
    Copy to Clipboard Toggle word wrap
  4. openshift-gitops 네임스페이스의 Argo CD 인스턴스에서 관리할 수 있도록 애플리케이션이 배포되는 네임스페이스에 레이블을 추가합니다.

    $ oc label namespace spring-petclinic argocd.argoproj.io/managed-by=openshift-gitops
    Copy to Clipboard Toggle word wrap

1.4. Argo CD 자동 복구 동작 확인

Argo CD는 배포된 애플리케이션의 상태를 지속적으로 모니터링하고, Git에서 지정된 매니페스트와 클러스터의 실시간 변경 사항 간의 차이점을 감지한 다음 자동으로 수정합니다. 이 동작을 자동 복구라고 합니다.

Argo CD에서 자동 복구 동작을 테스트하고 관찰할 수 있습니다.

사전 요구 사항

  • 샘플 app-spring-petclinic 애플리케이션이 배포 및 구성되어 있습니다.

프로세스

  1. Argo CD 대시보드에서 애플리케이션에 Synced 상태가 있는지 확인합니다.
  2. Argo CD 대시보드에서 app-spring-petclinic 타일을 클릭하여 클러스터에 배포된 애플리케이션 리소스를 확인합니다.
  3. OpenShift Container Platform 웹 콘솔에서 개발자 화면으로 이동합니다.
  4. Spring PetClinic 배포를 수정하고 Git 리포지토리의 app/ 디렉터리에 대한 변경 사항을 커밋합니다. Argo CD는 클러스터에 변경 사항을 자동으로 배포합니다.

    1. OpenShift GitOps에 시작 리포지토리를 분기합니다.
    2. deployment.yaml 파일에서 failureThreshold 값을 5 로 변경합니다.
    3. 배포 클러스터에서 다음 명령을 실행하여 failureThreshold 필드의 변경된 값을 확인합니다.

      $ oc edit deployment spring-petclinic -n spring-petclinic
      Copy to Clipboard Toggle word wrap
  5. OpenShift Container Platform 웹 콘솔에서 애플리케이션을 모니터링하면서 클러스터에서 배포를 수정하고 2개의 pod로 확장하여 자동 복구 동작을 테스트합니다.

    1. 다음 명령을 실행하여 배포 상태를 확인합니다.

      $ oc scale deployment spring-petclinic --replicas 2  -n spring-petclinic
      Copy to Clipboard Toggle word wrap
    2. OpenShift Container Platform 웹 콘솔에서 배포는 두 개의 pod로 확장되었다가 즉시 하나의 pod로 축소됩니다. Argo CD는 Git 리포지토리와 차이점을 감지하고 OpenShift Container Platform 클러스터에서 애플리케이션을 자동 복구했습니다.
  6. Argo CD 대시보드에서 app-spring-petclinic 타일 → APP DETAILS → CryostatENT S를 클릭합니다. Cryo statENTS 탭에는 다음 이벤트가 표시됩니다. Argo CD에서 클러스터의 동기화되지 않은 배포 리소스를 감지한 다음 Git 리포지토리를 다시 동기화하여 수정합니다.

법적 공지

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat