4. OASE Agent (Kubernetes)¶
4.1. 目的¶
4.2. 特徴¶
4.3. 前提条件¶
Exastro IT Automationについて
Exastro OASE Agentの運用には、Exastro OASE AgentとExastro IT Automationのバージョンが一致している必要があります。クライアント要件
動作確認が取れているクライアントアプリケーションのバージョンは下記のとおりです。表 4.1 クライアント要件¶ アプリケーション
バージョン
Helm
v3.9.x
kubectl
1.23
デプロイ環境
動作確認が取れているコンテナ環境の最小要求リソースとバージョンは下記のとおりです。表 4.2 ハードウェア要件(最小構成)¶ リソース種別
要求リソース
CPU
2 Cores (3.0 GHz, x86_64)
Memory
4GB
Storage (Container image size)
10GB
Kubernetes (Container image size)
1.23 以上
通信要件
OASE Agentから収集対象サーバにアクセスできる必要があります。
コンテナ環境からコンテナイメージの取得のために、Docker Hub に接続できる必要があります。
警告
4.4. インストールの準備¶
4.4.1. Helm リポジトリの登録¶
Exastro OASE Agent
リポジトリ |
---|
1# Exastro システムの Helm リポジトリを登録
2helm repo add exastro https://exastro-suite.github.io/exastro-helm/ -n exastro
3# リポジトリ情報の更新
4helm repo update
4.4.2. デフォルト設定値の取得¶
helm show values exastro/exastro-agent > exastro-agent.yaml
exastro-agent.yaml
1# Default values for exastro-agent.
2# This is a YAML-formatted file.
3# Declare variables to be passed into your templates.
4global:
5 agentGlobalDefinition:
6 name: agent-global
7 enabled: true
8 image:
9 registry: "docker.io"
10 organization: exastro
11 package: exastro-it-automation
12
13ita-ag-oase:
14 agents:
15 - image:
16 repository: ""
17 # Overrides the image tag whose default is the chart appVersion.
18 tag: ""
19 pullPolicy: IfNotPresent
20 extraEnv:
21 TZ: Asia/Tokyo
22 DEFAULT_LANGUAGE: ja
23 LANGUAGE: "en"
24 ITERATION: "500"
25 EXECUTE_INTERVAL: "10"
26 LOG_LEVEL: INFO
27 AGENT_NAME: "oase-agent"
28 EXASTRO_URL: "http://platform-auth:8000"
29 EXASTRO_ORGANIZATION_ID: "org001"
30 EXASTRO_WORKSPACE_ID: "ws01"
31 # ROLES: "_ws_admin"
32 EVENT_COLLECTION_SETTINGS_NAMES: "id0001"
33 secret:
34 EXASTRO_USERNAME: "admin"
35 EXASTRO_PASSWORD: "sample-password"
36 # USER_ID: "user01"
37 resources: {}
38 # requests:
39 # memory: "64Mi"
40 # cpu: "250m"
41 # limits:
42 # memory: "64Mi"
43 # cpu: "250m"
44
45 imagePullSecrets: []
46 nameOverride: ""
47 fullnameOverride: ""
48
49 initContainerImage:
50 repository: "registry.access.redhat.com/ubi8/ubi-init"
51 pullPolicy: IfNotPresent
52 # Overrides the image tag whose default is the chart appVersion.
53 tag: ""
54
55 serviceAccount:
56 # Specifies whether a service account should be created
57 create: false
58 # Annotations to add to the service account
59 annotations: {}
60 # The name of the service account to use.
61 # If not set and create is true, a name is generated using the fullname template
62 name: ""
63
64 persistence:
65 enabled: true
66 reinstall: false
67 accessMode: ReadWriteMany
68 size: 10Gi
69 volumeType: hostPath # e.g.) hostPath or AKS
70 storageClass: "-" # e.g.) azurefile or - (None)
71 # matchLabels:
72 # release: "stable"
73 # matchExpressions:
74 # - {key: environment, operator: In, values: [dev]}
75 mountPath:
76 storage: /storage
77 homeDir: /home/app_user
78 pid:
79 path: /var/run_app_user/httpd/pid
80 subPath: httpd-pid
81 socket:
82 path: /var/run_app_user/httpd/socket
83 subPath: httpd-socket
84 tmp: /tmp
85
86 podAnnotations: {}
87
88 podSecurityContext: {}
89 # fsGroup: 2000
90
91 securityContext:
92 allowPrivilegeEscalation: false
93 readOnlyRootFilesystem: true
94 runAsUser: 1000
95 runAsGroup: 1000
96 runAsNonRoot: true
97
98 service: {}
99
100 ingress:
101 enabled: false
102 className: ""
103 annotations: {}
104 # kubernetes.io/ingress.class: nginx
105 # kubernetes.io/tls-acme: "true"
106 hosts:
107 - host: chart-example.local
108 paths:
109 - path: /
110 pathType: ImplementationSpecific
111 tls: []
112 # - secretName: chart-example-tls
113 # hosts:
114 # - chart-example.local
115
116 nodeSelector: {}
117
118 tolerations: []
119
120 affinity: {}
exastro-agent.yaml
に対してインストールに必要なパラメータを設定してきいます。4.4.3. OASE Agentの設定¶
シンプル構成
複数エージェント(同一Pod)
複数エージェント(別Pod)
4.4.3.1. パラメータ¶
パラメータ |
説明 |
変更 |
デフォルト値・選択可能な設定値 |
---|---|---|---|
ita-ag-oase.agents.image.repository |
コンテナイメージのリポジトリ名 |
不可 |
"" |
ita-ag-oase.agents.image.tag |
コンテナイメージのタグ |
不可 |
"" |
ita-ag-oase.agents.image.pullPolicy |
イメージプルポリシー |
可 |
IfNotPresent (デフォルト): コンテナイメージが存在しない場合のみプル
Always: 毎回必ずプル
None: プルしない
|
ita-ag-oase.agents.extraEnv.TZ |
OASE エージェント システムで使用する規定の言語 |
可 |
Asia/Tokyo |
ita-ag-oase.agents.extraEnv.DEFAULT_LANGUAGE |
OASE エージェント システムで使用する言語 |
可 |
ja |
ita-ag-oase.agents.extraEnv.LANGUAGE |
OASE エージェント のバージョン |
可 |
en |
ita-ag-oase.agents.extraEnv.ITERATION |
OASE エージェント が設定を初期化するまでの、処理の繰り返し数(下限値: 10) |
可 |
500 |
ita-ag-oase.agents.extraEnv.EXECUTE_INTERVAL |
ita-ag-oaseがイベント取得対象に対してイベント取得の間隔(秒)(下限値: 3) |
可 |
10 |
ita-ag-oase.agents.extraEnv.LOG_LEVEL |
OASE エージェント のログレベル |
可 |
INFO |
ita-ag-oase.eagents.xtraEnv.AGENT_NAME |
起動する OASEエージェントの名前 |
可 |
oase-agent |
ita-ag-oase.agents.extraEnv.EXASTRO_URL |
Exastro IT Automation の Service URL |
可 |
|
ita-ag-oase.agents.extraEnv.EXASTRO_ORGANIZATION_ID |
Exastro IT Automation で作成した OrganizationID |
必須 |
org001 |
ita-ag-oase.agents.extraEnv.EXASTRO_WORKSPACE_ID |
Exastro IT Automation で作成した WorkspaceID |
必須 |
ws01 |
ita-ag-oase.agents.extraEnv.EVENT_COLLECTION_SETTINGS_NAMES |
Exastro IT Automation のOASE管理 エージェント で作成した イベント収集設定名
カンマ区切りで複数指定可能
|
必須 |
id0001 |
ita-ag-oase.agents.secret.EXASTRO_USERNAME |
Exastro IT Automation で作成した ユーザー名 |
可 |
admin |
ita-ag-oase.agents.secret.EXASTRO_PASSWORD |
Exastro IT Automation で作成した パスワード |
可 |
sample-password |
ita-ag-oase.agents.resources.requests.memory |
メモリ要求 |
可 |
"64Mi" |
ita-ag-oase.agents.resources.requests.cpu |
CPU要求 |
可 |
"250m" |
ita-ag-oase.agents.resources.limits.memory |
メモリ上限 |
可 |
"64Mi" |
ita-ag-oase.agents.resources.limits.cpu |
CPU上限 |
可 |
"250m" |
ita-ag-oase.nameOverride |
Exastro OASE Agent の定義名
※同一クラスタ内に複数エージェントを構築する際は必須
|
可 |
"" |
ita-ag-oase.persistence.enabled |
OASE エージェントコンテナのデプロイの有無 |
可 |
true (デフォルト): OASE エージェントコンテナをデプロイします。
false : OASE エージェントコンテナをデプロイしません。
|
ita-ag-oase.persistence.reinstall |
再インストール時にデータ領域の初期化の要否 |
不可 |
true : データを初期化(削除)する
false (デフォルト): データを初期化(削除)しない
|
ita-ag-oase.persistence.accessMode |
永続ボリュームのアクセスモードの指定。 |
不可 |
"ReadWriteMany" |
ita-ag-oase.persistence.size |
永続ボリュームのディスク容量 |
可 (データ永続化時) |
"10Gi" |
ita-ag-oase.persistence.volumeType |
永続ボリュームのボリュームタイプ |
可 (現在無効) |
hostPath (デフォルト): Kubernetes クラスタのノード上にデータを保存(非推奨)
AKS: AKS のストレージクラスを利用
|
ita-ag-oase.persistence.storageClass |
永続ボリュームにストレージクラスを利用する場合のクラスを指定 |
可 (データ永続化時) |
- (デフォルト): ストレージクラスを指定しない。
ストレージクラス名: クラウドプロバイダなどから提供されるストレージクラス名を指定。
|
exastro-platform.mariadb.persistence.matchLabels.name |
利用する永続ボリューム名を指定 |
可(データ永続化時) |
"" |
4.4.3.2. OASE Agentのパラメータ設定例¶
特徴
設定例
OASE Agentの設定
OASE Agentの設定します。13ita-ag-oase: 14 agents: 15 - image: 16 repository: "" 17 # Overrides the image tag whose default is the chart appVersion. 18 tag: "alpha.4ccca4.20240124-110529" 19 pullPolicy: IfNotPresent 20 extraEnv: 21 TZ: Asia/Tokyo 22 DEFAULT_LANGUAGE: ja 23 LANGUAGE: "en" 24 ITERATION: "500" 25 EXECUTE_INTERVAL: "10" 26 LOG_LEVEL: INFO 27 AGENT_NAME: "oase-agent" 28- EXASTRO_URL: "http://platform-auth:8000" 29+ EXASTRO_URL: "http://your-exastro-url" # Exastro IT Automation の Service URL 30- EXASTRO_ORGANIZATION_ID: "org001" 31+ EXASTRO_ORGANIZATION_ID: "your-organization-id" # Exastro IT Automation で作成した OrganizationID 32- EXASTRO_WORKSPACE_ID: "ws01" 33+ EXASTRO_WORKSPACE_ID: "your-workspace-id" # Exastro IT Automation で作成した WorkspaceID 34 # ROLES: "_ws_admin" 35- EVENT_COLLECTION_SETTINGS_NAMES: "id0001" 36+ EVENT_COLLECTION_SETTINGS_NAMES: "your-event-collection-settigs-names" # OASE管理 エージェント で作成した イベント収集設定名 37 secret: 38- EXASTRO_USERNAME: "admin" 39- EXASTRO_PASSWORD: "sample-password" 40+ EXASTRO_USERNAME: "your-ita-user-name" # Exastro IT Automation で作成した ユーザー名 41+ EXASTRO_PASSWORD: "your-ita-user-password" # Exastro IT Automation で作成した パスワード
特徴
設定例
OASE Agentの設定
OASE Agentの設定します。13ita-ag-oase: 14 agents: 15 - image: 16 repository: "" 17 # Overrides the image tag whose default is the chart appVersion. 18 tag: "alpha.4ccca4.20240124-110529" 19 pullPolicy: IfNotPresent 20 extraEnv: 21 TZ: Asia/Tokyo 22 DEFAULT_LANGUAGE: ja 23 LANGUAGE: "en" 24 ITERATION: "500" 25 EXECUTE_INTERVAL: "10" 26 LOG_LEVEL: INFO 27 AGENT_NAME: "oase-agent" 28+ AGENT_NAME: "oase-agent-1" # 起動する OASEエージェントの名前 29- EXASTRO_URL: "http://platform-auth:8000" 30+ EXASTRO_URL: "http://your-exastro-url" # Exastro IT Automation の Service URL 31- EXASTRO_ORGANIZATION_ID: "org001" 32+ EXASTRO_ORGANIZATION_ID: "your-organization-id" # Exastro IT Automation で作成した OrganizationID 33- EXASTRO_WORKSPACE_ID: "ws01" 34+ EXASTRO_WORKSPACE_ID: "your-workspace-id-1" # Exastro IT Automation で作成した WorkspaceID 35 # ROLES: "_ws_admin" 36- EVENT_COLLECTION_SETTINGS_NAMES: "id0001" 37+ EVENT_COLLECTION_SETTINGS_NAMES: "your-event-collection-settigs-names-1" # OASE管理 エージェント で作成した イベント収集設定名 38 secret: 39- EXASTRO_USERNAME: "admin" 40- EXASTRO_PASSWORD: "sample-password" 41+ EXASTRO_USERNAME: "your-ita-user-name" # Exastro IT Automation で作成した ユーザー名 42+ EXASTRO_PASSWORD: "your-ita-user-password" # Exastro IT Automation で作成した パスワード 43+ - image: 44+ repository: "" 45+ # Overrides the image tag whose default is the chart appVersion. 46+ tag: "alpha.4ccca4.20240124-110529" 47+ pullPolicy: IfNotPresent 48+ extraEnv: 49+ TZ: Asia/Tokyo 50+ DEFAULT_LANGUAGE: ja 51+ LANGUAGE: "en" 52+ ITERATION: "500" 53+ EXECUTE_INTERVAL: "10" 54+ LOG_LEVEL: INFO 55+ AGENT_NAME: "oase-agent-2" # 起動する OASEエージェントの名前 56+ EXASTRO_URL: "http://your-exastro-url" # Exastro IT Automation の Service URL 57+ EXASTRO_ORGANIZATION_ID: "your-organization-id" # Exastro IT Automation で作成した OrganizationID 58+ EXASTRO_WORKSPACE_ID: "your-workspace-id-2" # Exastro IT Automation で作成した WorkspaceID 59+ # ROLES: "_ws_admin" 60+ EVENT_COLLECTION_SETTINGS_NAMES: "your-event-collection-settigs-names-2" # OASE管理 エージェント で作成した イベント収集設定名 61+ secret: 62+ EXASTRO_USERNAME: "your-ita-user-name" # Exastro IT Automation で作成した ユーザー名 63+ EXASTRO_PASSWORD: "your-ita-user-password" # Exastro IT Automation で作成した パスワード
特徴
設定例
設定値ファイルを用意
exastro-agent.yamlをコピーして、exastro-agent-1.yamlを用意してください。exastro-agent.yamlをコピーして、exastro-agent-2.yamlを用意してください。一つ目のOASE Agentの設定
13ita-ag-oase: 14 agents: 15 - image: 16 repository: "" 17 # Overrides the image tag whose default is the chart appVersion. 18 tag: "" 19 pullPolicy: IfNotPresent 20 extraEnv: 21 TZ: Asia/Tokyo 22 DEFAULT_LANGUAGE: ja 23 LANGUAGE: "en" 24 ITERATION: "500" 25 EXECUTE_INTERVAL: "10" 26 LOG_LEVEL: INFO 27 AGENT_NAME: "oase-agent" 28- EXASTRO_URL: "http://platform-auth:8000" 29+ EXASTRO_URL: "http://your-exastro-url" # Exastro IT Automation の Service URL 30- EXASTRO_ORGANIZATION_ID: "org001" 31+ EXASTRO_ORGANIZATION_ID: "your-organization-id" # Exastro IT Automation で作成した OrganizationID 32- EXASTRO_WORKSPACE_ID: "ws01" 33+ EXASTRO_WORKSPACE_ID: "your-workspace-id-1" # Exastro IT Automation で作成した WorkspaceID 34 # ROLES: "_ws_admin" 35- EVENT_COLLECTION_SETTINGS_NAMES: "id0001" 36+ EVENT_COLLECTION_SETTINGS_NAMES: "your-event-collection-settigs-names-1" # OASE管理 エージェント で作成した イベント収集設定名 37 secret: 38- EXASTRO_USERNAME: "admin" 39- EXASTRO_PASSWORD: "sample-password" 40+ EXASTRO_USERNAME: "your-ita-user-name" # Exastro IT Automation で作成した ユーザー名 41+ EXASTRO_PASSWORD: "your-ita-user-password" # Exastro IT Automation で作成した パスワード
一つ目のOASE Agentの定義名を設定
45 imagePullSecrets: [] 46- nameOverride: "" 47+ nameOverride: "ita-ag-oase-1" # Exastro OASE Agent の定義名 48 fullnameOverride: ""
一つ目のOASE AgentのmatchLabelsを設定
64 persistence: 65 enabled: true 66 reinstall: false 67 accessMode: ReadWriteMany 68 size: 10Gi 69 volumeType: hostPath # e.g.) hostPath or AKS 70 storageClass: "-" # e.g.) azurefile or - (None) 71- # matchLabels: 72- # release: "stable" 73+ matchLabels: 74+ release: "pv-ita-ag-oase-1" # 利用する永続ボリューム名を指定
二つ目のOASE Agentの設定
13ita-ag-oase: 14 agents: 15 - image: 16 repository: "" 17 # Overrides the image tag whose default is the chart appVersion. 18 tag: "" 19 pullPolicy: IfNotPresent 20 extraEnv: 21 TZ: Asia/Tokyo 22 DEFAULT_LANGUAGE: ja 23 LANGUAGE: "en" 24 ITERATION: "500" 25 EXECUTE_INTERVAL: "10" 26 LOG_LEVEL: INFO 27 AGENT_NAME: "oase-agent" 28- EXASTRO_URL: "http://platform-auth:8000" 29+ EXASTRO_URL: "http://your-exastro-url" # Exastro IT Automation の Service URL 30- EXASTRO_ORGANIZATION_ID: "org001" 31+ EXASTRO_ORGANIZATION_ID: "your-organization-id" # Exastro IT Automation で作成した OrganizationID 32- EXASTRO_WORKSPACE_ID: "ws01" 33+ EXASTRO_WORKSPACE_ID: "your-workspace-id-2" # Exastro IT Automation で作成した WorkspaceID 34 # ROLES: "_ws_admin" 35- EVENT_COLLECTION_SETTINGS_NAMES: "id0001" 36+ EVENT_COLLECTION_SETTINGS_NAMES: "your-event-collection-settigs-names-2" # OASE管理 エージェント で作成した イベント収集設定名 37 secret: 38- EXASTRO_USERNAME: "admin" 39- EXASTRO_PASSWORD: "sample-password" 40+ EXASTRO_USERNAME: "your-ita-user-name" # Exastro IT Automation で作成した ユーザー名 41+ EXASTRO_PASSWORD: "your-ita-user-password" # Exastro IT Automation で作成した パスワード
二つ目のOASE Agentの定義名を設定します。
45 imagePullSecrets: [] 46- nameOverride: "" 47+ nameOverride: "ita-ag-oase-2" # Exastro OASE Agent の定義名 48 fullnameOverride: ""
二つ目のOASE AgentのmatchLabelsを設定
64 persistence: 65 enabled: true 66 reinstall: false 67 accessMode: ReadWriteMany 68 size: 10Gi 69 volumeType: hostPath # e.g.) hostPath or AKS 70 storageClass: "-" # e.g.) azurefile or - (None) 71- # matchLabels: 72- # release: "stable" 73+ matchLabels: 74+ release: "pv-ita-ag-oase-2" # 利用する永続ボリューム名を指定
4.4.4. 永続ボリュームの設定¶
特徴
危険
利用例
1# pv-ita-ag-oase.yaml
2apiVersion: v1
3kind: PersistentVolume
4metadata:
5 name: pv-ita-ag-oase
6spec:
7 claimRef:
8 name: pvc-ita-ag-oase
9 namespace: exastro
10 capacity:
11 storage: 10Gi
12 accessModes:
13 - ReadWriteMany
14 persistentVolumeReclaimPolicy: Retain
15 hostPath:
16 path: /var/data/exastro-suite/exastro-agent/ita-ag-oase
17 type: DirectoryOrCreate
1# pv-ita-ag-oase-1.yaml
2apiVersion: v1
3kind: PersistentVolume
4metadata:
5 name: pv-ita-ag-oase-1
6spec:
7 claimRef:
8 name: pvc-ita-ag-oase-1
9 namespace: exastro
10 capacity:
11 storage: 10Gi
12 accessModes:
13 - ReadWriteMany
14 persistentVolumeReclaimPolicy: Retain
15 hostPath:
16 path: /var/data/exastro-suite/exastro-agent/ita-ag-oase-1
17 type: DirectoryOrCreate
1# pv-ita-ag-oase-2.yaml
2apiVersion: v1
3kind: PersistentVolume
4metadata:
5 name: pv-ita-ag-oase-2
6spec:
7 claimRef:
8 name: pvc-ita-ag-oase-2
9 namespace: exastro
10 capacity:
11 storage: 10Gi
12 accessModes:
13 - ReadWriteMany
14 persistentVolumeReclaimPolicy: Retain
15 hostPath:
16 path: /var/data/exastro-suite/exastro-agent/ita-ag-oase-2
17 type: DirectoryOrCreate
4.5. インストール¶
4.5.1. 永続ボリュームの作成¶
# pv-ita-ag-oase.yaml
kubectl apply -f pv-ita-ag-oase.yaml
# 複数エージェント(別Pod)の場合は下記を実施
# pv-ita-ag-oase-1.yaml
kubectl apply -f pv-ita-ag-oase-1.yaml
# pv-ita-ag-oase-2.yaml
kubectl apply -f pv-ita-ag-oase-2.yaml
# 確認
kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-ita-ag-oase 10Gi RWX Retain Available 6s
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-ita-ag-oase-1 10Gi RWX Retain Available 5s
pv-ita-ag-oase-2 10Gi RWX Retain Available 6s
4.5.2. インストール¶
Helm コマンドを使い Kubernetes 環境にインストールを行います。
helm install exastro-agent exastro/exastro-agent \ --namespace exastro --create-namespace \ --values exastro-agent.yaml
NAME: exastro-agent LAST DEPLOYED: Wed Feb 14 14:36:27 2024 NAMESPACE: exastro STATUS: deployed REVISION: 1 TEST SUITE: None
インストール状況確認
# Pod の一覧を取得 kubectl get po -n exastro | 正常に起動している場合は、“Running” となります。 | ※正常に起動するまで数分かかる場合があります。
NAME READY STATUS RESTARTS AGE ita-ag-oase-66cb7669c6-m2q8c 1/1 Running 0 16m
Helm コマンドを使い Kubernetes 環境にインストールを行います。
helm install exastro-agent-1 exastro/exastro-agent \ --namespace exastro --create-namespace \ --values exastro-agent-1.yaml
NAME: exastro-agent-1 LAST DEPLOYED: Wed Feb 14 14:36:27 2024 NAMESPACE: exastro STATUS: deployed REVISION: 1 TEST SUITE: None
helm install exastro-agent-2 exastro/exastro-agent \ --namespace exastro --create-namespace \ --values exastro-agent-2.yaml
NAME: exastro-agent-2 LAST DEPLOYED: Wed Feb 14 14:36:27 2024 NAMESPACE: exastro STATUS: deployed REVISION: 1 TEST SUITE: None
インストール状況確認
# Pod の一覧を取得 kubectl get po -n exastro | 正常に起動している場合は、“Running” となります。 | ※正常に起動するまで数分かかる場合があります。
NAME READY STATUS RESTARTS AGE ita-ag-oase-1-66cb7669c6-m2q8c 1/1 Running 0 16m ita-ag-oase-2-787fb97f75-9s7xj 1/1 Running 0 13m