IBM API Connect(コンテナー版)では、Gatewayのログ出力設定など、default domainの追加設定を行う際に、gateway-default-domain-config config map を編集・設定することがあります。
この設定方法の場合、FixPackを適用すると、適用するFixPackによっては、gateway-default-domain-configが初期化されてしまい、再度設定が必要になる場合があるので注意が必要です。
gateway-default-domain-config config mapの編集ではなく、以下の方法で設定すると、FixPackを適用しても、default domainの追加設定が消えることはありません。
(IBM API Connect v10.0.8.5で、ocコマンドを使用しての設定例を記述します。)
やること:
- cfgファイル作成
- ConfigMap作成
- GatewayCluster編集
手順:
1. cfgファイル作成
ファイル名は何でも良いです。ここではcustom-config.cfgファイルを作成します。
この例では、
・web-mgmtの有効化
・アクセスログのsyslog転送設定
・rbmの設定
を行います。
top
configure terminal
web-mgmt
admin-state enabled
exit
logging category accesslog
exit
logging target accesslogtarget1
admin-state enabled
type syslog-tcp
local-ident "local-ident名"
remote-address "出力先のremote serverのhost or ip" "514"
facility "facility名"
local-address "local-address名"
event "accesslog" "info"
exit
rbm
pwd-minimum-length 16
pwd-mixed-case on
exit
2.ConfigMap作成
1で作成したファイルを使用してConfigMapを作成します。ここでは'custom-config'という名前のConfigMapを作成しています。
# oc create configmap custom-config --from-file=./custom-config.cfg
configmap/custom-config created
3.GatewayCluster編集
additionalDomainConfigを追加し、作成したConfigMapを設定します。
# oc edit GatewayCluster gateway
gatewaycluster.gateway.apiconnect.ibm.com/gateway edited
spec以下にadditionalDomainConfig:を追記します。
spec:
additionalDomainConfig:
- dpApp:
config:
- custom-config #2で作成したConfigMapを指定
name: default #default domainを編集
保存をすると、gateway podが自動的に再起動します。
再起動が完了すると、設定が反映されます。