Red Hat OpenShift での Instana エージェントのアンインストール

エージェントの展開方法に応じて、 Red Hat OpenShift 上の Instana エージェントをさまざまな方法でアンインストールできます。

準備

Instana エージェントをアンインストールする前に、アプリケーションの実行環境にインストールされているトレーサー(またはインプロセス・コレクター)をアンインストールする必要があります。

Red Hat OpenShift 環境に PHP ランタイムが含まれており、かつエージェント設定( configuration.yamlspec.agent.configuration_yaml )で PHP トレースが有効になっている(デフォルト)場合は、 「 PHP トレースの無効化 」に記載されている手順に従って、 PHP Tracerをアンインストールする必要があります。

トレーサーをアンインストールした後、以下の方法に従って、 Red Hat OpenShift から Instana エージェントをアンインストールできます

operator を使用してインストールされたエージェントをアンインストールする

オペレータを使用してインストールされたエージェントをアンインストールするには、以下の手順を実行します:

  1. カスタムリソースを削除して、 Instana エージェントをアンインストールします:

    oc delete -f instana-agent.customresource.yaml
     
  2. 以下のコマンドを実行して、オペレータをアンインストールします:

    oc delete -f https://github.com/instana/instana-agent-operator/releases/latest/download/instana-agent-operator.yaml
     

「 Helm 」チャートを使用してインストールされたホストエージェントをアンインストールする

注: コマンド helm uninstall を実行する前に、エージェントのカスタムリソース(CR)を必ず削除してください。 そうでない場合、CRはクラスターから削除されません。

「 Helm 」チャートを使用してインストールされた Instana エージェントをアンインストールするには、次のコマンドを実行してください:

NAMESPACE=instana-agent
# delete agent custom resource, the operator will remove the agent artifacts it is owning
oc delete agents.instana.io instana-agent -n ${NAMESPACE} --wait
# uninstall helm chart which removes the operator and RBAC artifacts
helm uninstall instana-agent -n ${NAMESPACE}
# manually uninstall the custom resource definition which is not uninstalled by helm
oc delete crd agents.instana.io
# remove the entire namespace
oc delete namespace ${NAMESPACE}
 

コマンドを実行すると、エージェントに関連するすべてのリソースが削除される。

CRを削除する前にまずこの helm uninstall コマンドを実行する場合は、以下のコマンドを使用して、クラスタ上のエージェントのインストール全体を削除してください:

NAMESPACE=instana-agent
# remove the finalizer
oc patch agents.instana.io instana-agent -p '{"metadata":{"finalizers":null}}' --type=merge -n ${NAMESPACE}
# remove the cluster-wide objects
oc delete crd/agents.instana.io clusterrole/leader-election-role clusterrole/instana-agent-clusterrole clusterrolebinding/leader-election-rolebinding clusterrolebinding/instana-agent-clusterrolebinding
# remove helm chart,if still present
helm uninstall instana-agent -n ${NAMESPACE} || true
# delete the entire namespace
oc delete ns ${NAMESPACE} --wait || true
 

Instana をアンインストールするには、 AutoTrace WebHook, を参照してください。 Instana のアンインストールについては、 AutoTrace WebHook を参照してください。