1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenShiftにおけるconfiguration設定(Operator編)

Last updated at Posted at 2025-12-08

はじめに

  • みなさん!メリークリスマス!Advent Calendar9日目は、OpenShiftにおけるconfiguration設定(Operator編)の記事となります。
  • ホストにInstana Agentをインストール後、Instana Agent用の設定ファイル (configuration.yaml など) を編集することで、Instana UI上の表示変更や、アプリケーション開発フレームワーク、データベースの詳細を可視化などといった、様々な設定を適用できます。
  • OpenShiftには、複数のInstana Agentインストール方法がます、今回は、Operatorによる設定および編集方法を紹介します。
  • Operator Hub編はこちら
  • 次回は、Helm Chart編も公開予定なのでお楽しみに!

公式ドキュメントのリンク

設定の前提条件

  • OpenShift 4.18に対して、Operator(手動設定)によるInstana Agentインストールおよび編集をします。

  • Instana UIのインフラストラクチャーマップにおいて、「Instana Maturity Zone」というカスタムゾーンを設定します。

  • 下記は、今回変更するconfigurationの抜粋となります。

    com.instana.plugin.generic.hardware:
      enabled: true
      availability-zone: 'Instana Maturity Zone'
    

Operatorによる設定例

OperatorでのInstana Agentにおけるconfiguration設定例

  • kubectl applyコマンドを用いて、Instana Agent用Operatorを手動でインストールします。

    kubectl apply -f https://github.com/instana/instana-agent-operator/releases/latest/download/instana-agent-operator.yaml
    
  • OpenShiftのダッシュボードでもOperatorがインストールされていることを確認できます。

configuring-host-agents_OperatorManual_1.png

  • Instana Agent用カスタムリソースinstana-agent.customresource.yamlを作成します。設定内容として、configuration_yamlを記載することで、Instana Agentの詳細設定を行うことができます。

    touch instana-agent.customresource.yaml
    vi instana-agent.customresource.yaml
    
    apiVersion: instana.io/v1
    kind: InstanaAgent
    metadata:
      name: instana-agent
      namespace: instana-agent
    spec:
      zone:
        name:  # (optional) name of the zone of the host
      cluster:
          name: 
      agent:
        key: <key>
        downloadKey: <downloadKey>
        endpointHost: <endpointHost Name>
        endpointPort: "443"
        env: {}
        configuration_yaml: |
          com.instana.plugin.generic.hardware:
            enabled: true
            availability-zone: 'Instana Maturity Zone'
    
  • 最後にカスタムリソースをデプロイします。

    kubectl apply -f instana-agent.customresource.yaml
    
  • Instana UIにて、configuration_yamlの設定内容が反映されていることを確認できます。

configuring-host-agents_OperatorManual_2.png

OperatorでのInstana Agentのconfiguration設定変更例

  • configurationの内容を変更する場合、 instana-agent.customresource.yamlを編集・保存し、再度kubectl applyをすることで反映されます。

    vi instana-agent.customresource.yaml
    
  • availability-zoneInstana Maturity Zone Operator Manualに変更します。

    apiVersion: instana.io/v1
    kind: InstanaAgent
    metadata:
      name: instana-agent
      namespace: instana-agent
    spec:
      zone:
        name:  # (optional) name of the zone of the host
      cluster:
          name: 
      agent:
        key: <key>
        downloadKey: <downloadKey>
        endpointHost: <endpointHost Name>
        endpointPort: "443"
        env: {}
        configuration_yaml: |
          com.instana.plugin.generic.hardware:
            enabled: true
            availability-zone: 'Instana Maturity Zone Operator Manual'
    
  • 最後にカスタムリソースをデプロイします。

    kubectl apply -f instana-agent.customresource.yaml
    
  • Instana UIにて、configurationの変更内容が反映されていることを確認できます。

configuring-host-agents_OperatorManual_3.png

うまく反映されない場合、Instana AgentのDaemonSetをRolloutすることをご検討ください。

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

instana-agent.customresource.yamlに対して、spec.agentに下記のようなimage.nameの項目を追加すると、Static Agentとしてインストールすることができます。

spec:
  agent:
    image:
      name: containers.instana.io/instana/release/agent/static

kubectl apply -f instana-agent.customresource.yamlを実行後、Instanaの画面で、更新モードがOffになっていることを確認することができます。

configuring-host-agents_OperatorManual_4.png

おわりに

  • OperatorによるInstana Agentインストールや設定変更は、実際に反映されている設定パラメータをコードとして残すことができるので便利ですね!
  • さらに、instana-agent.customresource.yamlをバージョン管理システムで管理することで、設定の紛失や意図しない設定変更を防ぐことも期待できそうです。
  • 次回は、Helm Chartによる方法を公開予定ですので、ぜひご覧ください!良い年末を!
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?