Red Hat OpenShift 에서 Instana 에이전트 관리

에이전트를 설치한 후, 필요에 따라 에이전트를 구성하고 관리하십시오. Red Hat OpenShift 에서 사용할 수 있는 모든 에이전트 구성 옵션은 다음 목록을 참조하십시오.

포드 상태 확인

에이전트를 설치한 후에는 다음 명령을 사용하여 에이전트 배포에서 파드의 상태를 확인할 수 있습니다:

kubectl get pods -n instana-agent
kubectl get agent instana-agent -n instana-agent -o yaml | yq ".status"
 

올바른 배포에서, 네임스페이스에 있는 모든 파드의 ' STATUS '은 ' Running'여야 한다. 다음 예시와 같이 ' instana-agent 사용자 정의 리소스에도 ' status: Running'가 표시되어야 합니다:

$ kubectl get pods -n instana-agent
NAME                                      READY   STATUS    RESTARTS   AGE
controller-manager-6478cb4c6f-8s29b       1/1     Running   0          70m
instana-agent-8ftnj                       1/1     Running   0          70m
instana-agent-9w4vc                       1/1     Running   0          70m
instana-agent-k8sensor-5bbf568976-5pjk2   1/1     Running   0          3h2m
instana-agent-k8sensor-5bbf568976-h96hr   1/1     Running   0          3h2m
instana-agent-k8sensor-5bbf568976-lnbsg   1/1     Running   0          3h2m
instana-agent-zpmrj                       1/1     Running   0          70m

$ kubectl get agent instana-agent -n instana-agent -o yaml | yq ".status"
conditions:
  - lastTransitionTime: "2024-08-06T08:12:03Z"
    message: most recent reconcile of agent CR completed without issue
    observedGeneration: 2

    ...

observedGeneration: 2
oldVersionsUpdated: true
operatorVersion: 0.0.1-dev
status: Running
 

에이전트 구성

에이전트를 설치한 방법에 따라, Kubernetes 및 Red Hat OpenShift 용 Instana 에이전트를 두 가지 다른 방식으로 구성할 수 있습니다.

Operator를 통해 설치된 에이전트 구성

운영자를 통해 설치된 Instana 에이전트를 구성하려면 다음 단계를 수행하십시오:

  1. YAML 파일을 엽니다 instana-agent.customresource.yaml.

  2. ' spec.agent.configuration_yaml 아래에 구성을 저장합니다. 다음 예를 참조하십시오.

    spec:
      agent:
        configuration_yaml: |
          # Example of configuration yaml template
          # Host
          com.instana.plugin.host:
            tags:
              - 'dev'
              - 'app1'
     
  3. 다음 명령을 실행하여 변경 사항을 적용하십시오:

    kubectl apply -f instana-agent.customresource.yaml
     

YAML 파일의 자세한 예시는 instana_v1_extended_instanaagent.yaml 에서 확인할 수 있습니다.

에이전트 구성에 대한 자세한 내용은 “에이전트 구성 파일을 사용하여 호스트 에이전트 구성”을 참조하십시오.

Helm 차트를 사용하여 설치된 에이전트 구성

Helm 차트를 사용하여 설치된 Instana 에이전트를 구성하려면 다음 방법 중 하나를 선택하십시오:

  • ' --set agent.configuration_yaml=<config> 플래그를 사용하여 명령줄에서 구성을 지정합니다.

  • Helm 차트 구성 파일 ' values.yaml'에 구성을 추가한다. ' -f ' 플래그를 사용하여 Helm 설치(설치 중) 또는 Helm 업그레이드(설치 후) 명령에 파일을 전달한다.

모든 구성 매개변수에 대한 자세한 목록은 Instana 의 ‘ Helm ’ 차트를 참조하십시오.

Container Registry 사용자 지정

사용 중인 Red Hat OpenShift 환경에 따라 Red Hat OpenShift Container Registry 사용자 지정해야 할 수도 있습니다.

이미지 스트림 추가

IBM Cloud Container Registryicr.io에서 이미지를 가져올 수 없는 경우 두 개의 이미지 스트림을 수동으로 추가해야 합니다. Red Hat OpenShift Container Registry' instana-agent 네임스페이스로 이동하여 다음 이미지 스트림을 추가합니다:

Name: instana-agent
Image: icr.io/instana/agent:latest
 

결과 이미지 스트림은 ' docker-registry.default.svc:5000/instana-agent/instana-agent:latest 입니다.

Name: k8sensor
Image: icr.io/instana/k8sensor:latest
 

결과 이미지 스트림은 ' docker-registry.default.svc:5000/instana-agent/k8sensor:latest 입니다.

YAML에서 각각의 새 이미지 스트림을 사용하십시오.

ConfigMap 를 사용하여 모니터링 설정 사용자 지정하기

' agent.configuration_yaml ' 파일을 구성하여 필요에 따라 모니터링을 사용자 지정할 수 있습니다. 자세한 내용은 구성 참조를 참조하십시오.

구성에 대한 자세한 내용은 ‘호스트 에이전트 구성’을 참조하십시오.

에이전트 설치 업데이트

설치 방법에 따라, Red Hat OpenShift 용 Instana 에이전트를 여러 가지 방법으로 업데이트할 수 있습니다.

운영자 설치 환경 업데이트

에이전트 설치 업데이트는 두 단계로 이루어집니다:

  1. 운영자 업데이트
  2. 이미지 업데이트하기

OLM 를 사용하여 오퍼레이터를 최신 버전으로 업데이트하려면, Red Hat OpenShift 문서의 ‘보류 중인 오퍼레이터 업데이트 수동 승인 ’ 섹션에 설명된 단계를 따르십시오.

운영자가 자동으로 업데이트하도록 구성할 수도 있습니다. 자세한 내용은 ‘오퍼레이터의 업데이트 채널 변경’을 참조하십시오.

Instana UI를 사용하여 운영자를 수동으로 업데이트하려면 다음 단계를 따르십시오:

  1. Instana UI의 홈 페이지에서 ‘에이전트 및 수집기’를 클릭합니다. ‘ Instana ’의 ‘에이전트’ 탭에서 ‘에이전트 설치’를 선택합니다.

  2. 상담원 배포 카탈로그 페이지에서 OpenShift - 상담원 타일을 클릭합니다.

  3. 명령을 복사하여 실행하여 새 운영자를 배포합니다. 다음 명령 샘플을 참조하세요:

    kubectl apply -f https://github.com/instana/instana-agent-operator/releases/latest/download/instana-agent-operator.yaml
     
    참고:
    운영 체제를 특정 버전으로 업데이트하려면 다음 명령을 실행하십시오:
    kubectl apply -f https://github.com/instana/instana-agent-operator/releases/download/<operator_version>/instana-agent-operator.yaml
    사용 가능한 오퍼레이터 버전 목록은 ‘ Instana 에이전트 오퍼레이터’ 릴리스 노트를 참조하십시오.

운영자가 업데이트된 후, 이미지 업데이트 를 진행하십시오.

Helm 차트 설치 업데이트

에이전트 설치 업데이트는 두 단계로 이루어집니다:

  1. Helm 차트 업데이트
  2. 이미지 업데이트하기

Helm 에이전트 차트를 업데이트하려면 다음 명령을 실행하십시오:

helm pull --repo https://agents.instana.io/helm --untar instana-agent
kubectl apply -f instana-agent/crds
oc adm policy add-scc-to-user privileged -z instana-agent -n instana-agent
oc adm policy add-scc-to-user anyuid -z instana-agent-remote -n instana-agent
helm upgrade --namespace instana-agent instana-agent \
--repo https://agents.instana.io/helm instana-agent \
--reuse-values
 
참고:
Helm 차트를 특정 버전으로 업데이트하려면 명령어에 --version <helm-version> 해당 플래그를 추가하십시오. 사용 가능한 ‘ Helm ’ 차트 버전의 목록을 보려면, ‘ Instana ’ 에이전트 Helm 차트의 릴리스 노트를 참조하십시오.
참고:
Instana agent Helm 의 차트 버전 2.0.0 및 그 이전 버전에는 해당 instana-agent/crds 폴더가 없습니다. 따라서 해당 kubectl apply -f instana-agent/crds 단계는 필요하지 않습니다.

운영자가 업데이트된 후, 이미지 업데이트 를 진행하십시오.

Instana 에이전트 이미지 업데이트

' instana-agent DaemonSet ' k8sensor ' 배포는 파드 시작 시 최신 이미지를 가져오도록 설정되어 있습니다. 업데이트를 강제 적용하려면 다음 명령을 실행합니다:

kubectl rollout restart ds instana-agent -n instana-agent
 
kubectl rollout restart deployment k8sensor -n instana-agent
 

Instana 이러한 이미지를 자동으로 업데이트하는 기능을 제공하지 않습니다. 요구 사항에 맞는 솔루션을 활용할 수 있습니다. 예를 들어, 워크로드에 restart 대한 CronJobs 충분한 권한을 부여하거나, imagestreams와 같은 더 고급 OpenShift GitOps 도구를 사용할 수 있습니다.

에이전트 관리 대시보드를 사용하여 에이전트 관리하기

Instana UI의 에이전트 관리 대시보드를 사용하여 다음 작업을 수행할 수 있습니다:

상담원 관리 대시보드를 열려면 다음 단계를 따르세요:

  1. Instana UI의 사이드바에서 ‘인프라’를 선택합니다.
  2. 모니터링되는 특정 호스트를 클릭합니다.
  3. 호스트 대시보드에서 상담원 관리 열기를 클릭합니다.

모니터 대상 애플리케이션에 대한 네트워크 액세스 구성

다음 유형의 애플리케이션이 에이전트와 통신할 수 있도록 네트워크 액세스를 구성해야 합니다:

  • Node.js
  • Go
  • Ruby
  • Python
  • .NET Core
  • HTTPd

이 애플리케이션들은 에이전트가 수신 대기 중인 IP 주소를 알아야 합니다. 에이전트가 호스트 IP에서 자동으로 수신 대기합니다. 다음 Downward API 스니펫을 사용하여 환경 변수에 저장된 호스트 IP를 애플리케이션 포드에 전달할 수 있습니다:

spec:
  containers:
    env:
      - name: INSTANA_AGENT_HOST
        valueFrom:
          fieldRef:
            fieldPath: status.hostIP
 

제어 플레인 노드(이전의 마스터 노드) 모니터링

기본적으로 호스트 에이전트는 Kubernetes 제어 플레인 노드에서는 예약되지 않습니다. 컨트롤 플레인 노드를 모니터링하는 방법에 대한 자세한 내용은 “컨트롤 플레인 노드 모니터링” 섹션을 참조하십시오.

보다 직접적인 제어를 원한다면, 제어 플레인 노드에 에이전트를 별도로 설치하십시오.

Kubernetes 모니터링 NGINX Ingress

Kubernetes NGINX Ingress를 구성하고 NGINX 메트릭을 수집하기 위한 에이전트를 설정하는 방법에 대한 지침은 모니터링 NGINX 페이지를 참조하십시오. Kubernetes 의 추적 NGINX Ingress는 OpenTracing 프로젝트를 통해서도 가능합니다. 설정 방법에 대한 지침은 ‘ NGINX Ingress용 분산 추적’을 참조하십시오.

여러 백엔드에 보고

helm 와 operator를 사용하여 백엔드를 추가하려면 다음 명령어를 실행하십시오. Instana 에이전트를 구성할 때 추가 백엔드를 사용할 수도 있고, 비워둘 수도 있습니다.

참고:
다음 명령을 실행하면 에이전트 데이터가 Kubernetes 데이터 및 메트릭 데이터와 함께 여러 백엔드로 전달됩니다.
  • helm 사용법:

       helm install instana-agent \
       --repo https://agents.instana.io/helm \
       --namespace instana-agent \
       --create-namespace \
       --set agent.key=my-key \
       --set agent.endpointHost='<your_host_agent_endpoint>' \
       --set agent.endpointPort=443 \
       --set cluster.name='<your_cluster_name>' \
       --set zone.name='zone-name' \
       --set "agent.additionalBackends[0].endpointHost=<your_host_agent_endpoint>" \
       --set "agent.additionalBackends[0].key=<your_agent_key>" \
       --set "agent.additionalBackends[0].endpointPort=443" \
       --set "agent.additionalBackends[1].endpointHost=<your_other_host_agent_endpoint>" \
       --set "agent.additionalBackends[1].key=<your_other_agent_key>" \
       --set "agent.additionalBackends[1].endpointPort=443" \
       instana-agent
     
  • 연산자 사용:

    apiVersion: instana.io/v1
    kind: InstanaAgent
    metadata:
      name: instana-agent
      namespace: instana-agent
    spec:
      zone:
        name: edited-zone # (optional) name of the zone of the host
      cluster:
        name: my-cluster
      agent:
        endpointHost: <your_host_agent_endpoint>
        endpointPort: "443"
        env: {}
        key: <your_agent_key>
        additionalBackends:
        - endpointHost: <your_host_agent_endpoint>
          endpointPort: "443"
          key: <your_agent_key>
        configuration_yaml: |
          # You can leave this empty, or use this to configure your instana agent.
          # See https://github.com/instana/instana-agent-operator/blob/main/config/samples/instana_v1_extended_instanaagent.yaml for the extended version.
    
     

Kubernetes 에이전트에서 여러 백엔드로 보고를 수행하려면 Docker 에이전트 구성을 참조하십시오.

시크릿 구성

비밀을 사용하여 자격증명, 토큰 또는 키와 같은 민감한 데이터를 저장하고 관리할 수 있습니다. 자세한 내용은 Kubernetes secrets를 참조하세요.