【IBM Application Gateway】kustomizeを使ってアプリをデプロイする

# はじめに
これまでの記事では、configmap/Secretを[IBM Application Gateway Deployment Asset](https://github.com/jonpharry/iag) に含まれているシェルスクリプトを使って、事前登録しておく前提でした。
- [【IBM Application Gateway】IBM CloudにGitLabのリポジトリーを作成&利用してみる](https://qiita.com/fitz/items/551bac934071056967e1)
- [【IBM Application Gateway】OpenShift GitOps(Argo CD)を使ってアプリをデプロイする](https://qiita.com/fitz/items/5449f07b2f708b549b84)

前回の記事でSecretの暗号化ができました。
- [【IBM Application Gateway】ROKS上でsealedsecret を使ってSecretを暗号化してみる](https://qiita.com/fitz/items/66537dec33547f5d81b9)

今回は、アセット内で利用しているtemplateではなく、[Kustomize](https://kustomize.io/ )を使ってみました。
kustomizeには、ConfigMapGeneratorという機能があり、こちらを利用してConfigmapを登録するようにしました。

# 1.kustomizeのフォルダ構成

ファイル構造は以下のように作成しました。
baseにベースのデプロイメントを配置し、
overlaysに本番、ステージング、開発環境などで適用する差分データを保管するようなイメージになります。

```
kustomize-iag
├── base
　　　  └─deployment.yaml
　　　  └─kustomization.yaml
　  　　└─sealed-secret.yaml　　#SealedSecretで暗号化した後のSecret
　 　　 └─service.yaml
　  　　└─route.yaml
　  　　└─files
　　　  　　└─demo-sso.yaml　　　#IBM Application Gatewayの設定ファイル
　　　  　　└─cert.pem　　　 　　#SealedSecretの公開鍵（.gitignoreファイルの設定でGithubの同期対象から除外）
　　　  　　└─secret.yaml　　　　#SealedSecretで暗号化する前のSecret（.gitignoreファイルの設定でGithubの同期対象から除外）
└── overlays
　　　├── prod　#本番環境向けの差分設定
 　　　　    └─kustomization.yaml
 　　　　    └─deployment.yaml
 　　　　    └─route.yaml
　　　└── stage　#ステージング環境向けの差分設定
 　　　　    └─kustomization.yaml
 　　　　    └─deployment.yaml
 　　　　    └─route.yaml
　　　└── dev　#開発環境向けの差分設定
 　　　　    └─kustomization.yaml
 　　　　    └─deployment.yaml
 　　　　    └─route.yaml
```

# 2. 各Manifestの内容
Baseフォルダ配下のファイルです。

kustomization.yamlでは、ConfigMapGeneratorを設定して、Configmapを登録するようにします。
```kustomization.yaml
resources:
- deployment.yaml
- service.yaml
- route.yaml
- sealed-secret.yaml
configMapGenerator:
  - name: iag-config
    files:
      - files/demo-sso.yaml
  - name: iag
    literals:
    - DEMOAPP_HOSTNAME=resource-server.au-syd.mybluemix.net
    - DEMOAPP_PORT="443"
    - OIDC_CLIENT_ID=XXX‐XXX-XXX-XXX-XXX
    - OIDC_DISCOVERY_ENDPOINT=https://xxx.verify.ibm.com/oidc/endpoint/default/.well-known/openid-configuration
```

deployment.yaml
```deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
    name: iag
    labels:
      app: iag
      name: iag
spec:
    progressDeadlineSeconds: 600
    replicas: 2
    revisionHistoryLimit: 10
    selector:
      matchLabels:
        app: iag
    strategy:
      rollingUpdate:
        maxSurge: 1
        maxUnavailable: 1
      type: RollingUpdate
    template:
      metadata:
        labels:
          app: iag
          name: iag
      spec:
        serviceAccountName: default
        affinity:
          podAntiAffinity:
            preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchExpressions:
                  - key: app
                    operator: In
                    values:
                    - iag
                topologyKey: kubernetes.io/hostname
        containers:
        - env:
          - name: LANG
            value: ja
          envFrom:
            - configMapRef:
                name: iag
            - secretRef:
                name: iag
          image: docker.io/ibmcom/ibm-application-gateway:21.12
          imagePullPolicy: IfNotPresent
          name: iag
          ports:
          - containerPort: 8443
            protocol: TCP
          resources: 
            requests:
              cpu: 100m
              memory: 256Mi
            limits:
              memory: 256Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          livenessProbe:
            exec:
              command:
              - /sbin/health_check.sh
            initialDelaySeconds: 120
            periodSeconds: 10
          readinessProbe:
            exec:
              command:
              - /sbin/health_check.sh
            initialDelaySeconds: 5
            periodSeconds: 10
          volumeMounts:
          - mountPath: /var/iag/config
            name: iag-config
          - mountPath: /var/iag/config/secret_files
            name: iag-secret-files
          - mountPath: /var/iag/config/env_files
            name: iag-env-files
        dnsPolicy: ClusterFirst
        restartPolicy: Always
        schedulerName: default-scheduler
        terminationGracePeriodSeconds: 30
        volumes:
        - name: iag-config
          configMap:
            name: iag-config
        - name: iag-secret-files
          secret:
            secretName: iag
        - name: iag-env-files
          configMap:
            name: iag
```

service.yaml
```service.yaml
apiVersion: v1
kind: Service
metadata:
  name: iag
  labels:
    app: iag
    name: iag
spec:
  ports:
  - name: iag
    port: 443
    protocol: TCP
    targetPort: 8443
  selector:
    name: iag
  sessionAffinity: ClientIP
  sessionAffinityConfig:
    clientIP:
      timeoutSeconds: 10800
  type: ClusterIP
status:
  loadBalancer: {}
```

route.yaml
```route.yaml
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  labels:
    name: iag
    app: iag
  name: iag
spec:
  port:
    targetPort: iag
  tls:
    insecureEdgeTerminationPolicy: Redirect
    termination: passthrough
  to:
    kind: Service
    name: iag
    weight: 100
  wildcardPolicy: None
```

sealed-secret.yaml
```sealed-secret.yaml
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
  creationTimestamp: null
  name: iag
  namespace: iag-kustomize
spec:
  encryptedData:
    S_OIDC_CLIENT_SECRET: AgC1rlMqTfWWqrxJCpJK07fYUnKmPT3Ikks94hY20pvKFbOuH5OvK0JL9uXfIMgMRcCUS3Rdz8/GQRBstkBgXbK3TxQ12UT/jpBgyUCdzKgxRJpyQakoIBQL0LZBc417HUJzdVEx3Tc6/21KBAc2tnGuDm6OWCDazX20qZQAqAYVAcn3w5TwQ3Zkv34HkZRFuGOiZ/4Ee4O3vvDG/PyipblpSMvhIRaqqStMqlqOLGruHWvyCJX0LLt6KUx4LfNGDneOO/1CLvJafJWo2BLLWseQDdAzzdRp8qDXfe/uQrrbf3zzVYoYU/2opy+OOKnf1VdVwnXlBPFSc339wm3RXvsKP+LhKTJ1f04APE3D5c3uGVAq/F4WCgesHMjK/1K9s0DyO2j0hJ+m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dmAnT22uvLG0=
    iag.failover.key: AgC2dFqPv1Gc2KseTFbGMiie795MB/jtkMs2SH0roMrhF7AV2YvdDY9lve0Z7WzwL3RHCy+lvaISJ9kewBoMjm9OEHTMPyj2NCPhnkrkLbXdI8mx33ZXeYKtBLVznzLP79zd4dpHjAmGhjmDpvnqPEjVxKDpbfqeS9D7TEk6tX+22vklFCmDllq7787lHXAZliw889byGX26mPIUEGdmjpET3BgkGt7qel3IOyAIIJ4F3XoK3dMauHtp83eZVALE6ASpYyKGWYH3saRAW4qLb0C6ajqUT3jtA8/HiRn/peVH9gmmeXQvIRpht2NFpT3sjN+n607c1mWxJsj9ky5AmNvzG8FGXH897LF06FvHXflXgS+ak7vgKswgz/TLQj+s86EmC9SOkX/B6uOEzRc8kc7mgf7+ILCxsQIFq2vj1hRmCQKu5u2K0CLSYwVQSqZd0gh0j4s389VWVYO2JTymupmq80BKSg8v1G19Zcy05oLPjtKqyWp5jkvOCQTejE5wrbGHll9bR9oY07828byv2QcIDEgj8ck16wGljS4mfr8cHEZ0jqKRsxZr1yka08IrfAQAOsGklfWHTi1aPHGS99lozEaGNuqh975gW00nkgkN9g/DFMZXdh8cYgmto+U6ENvwsaodMNP/0e/BiitOVf8q7ciN0Ybl4MB7dNMRhLGD4AuY53bYyD4ohXKUYkprFIRrj/2tzTsZEe3ZTws3kkF9SYH24ED4j4bG5saDb9yMwhJtCFw9PxVmCFawrC10uDjE7TvUQt7QuVx8V1bCqYQ9
  template:
    data: null
    metadata:
      creationTimestamp: null
      name: iag
      namespace: iag-kustomize
    type: Opaque
```

# 3. OpenShift GitOps(Argo CD)を使って、アプリをデプロイする

こちらの記事で設定したOpenShift GitOps環境を使ってデプロイしていきます。
[【IBM Application Gateway】OpenShift GitOps(Argo CD)を使ってアプリをデプロイする](https://qiita.com/fitz/items/5449f07b2f708b549b84)

Argo CDにログインして、New appをクリックします。
![qiita (1).png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/678692/e96676e2-5a4a-d341-3f3a-1748f483b844.png)

アプリデプロイのための設定を入力してCreateボタンをクリックします。
![qiita (2).png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/678692/a78eb163-489f-0281-d447-6bf8896c7b4c.png)
![qiita (3).png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/678692/aa8ef388-4c43-33c3-c69e-0bf24b3bc4ec.png)
![qiita (5).png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/678692/4e892f43-68e1-4291-8c3d-f8b251fafc1a.png)


アプリケーションをクリックして、詳細を確認します。
![qiita (6).png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/678692/76cd0c2d-52ae-9822-9bb7-9dfcb6b7ebe4.png)

configmap/secretが登録されて、Podが起動していることを確認します。
![qiita (7).png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/678692/bcde9105-85f0-32f0-25d0-1be403aacf04.png)

# 最後に
今回は、Kustomizeを利用して、IBM Application Gatewayをデプロイしてみました。

Qiitaの記事をいろいろ参考にさせて頂きました。ありがとうございました。
https://qiita.com/Morix1500/items/d08a09b6c6e43efa191d
https://qiita.com/Sho2010@github/items/548582996d5ebfc63b1d
https://qiita.com/syogun/items/9362b74545d1d5c88e38