Skip to content

Commit

Permalink
Merge pull request #33 from Axway/git-pull-fed
Browse files Browse the repository at this point in the history
Added support for the new merge directoy
  • Loading branch information
Chris Wiechmann authored Apr 7, 2022
2 parents 6623777 + d981dca commit 43e6154
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 4 deletions.
67 changes: 67 additions & 0 deletions APIM/Helmchart/examples/aws-eks/aws-eks-example-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,29 @@ anm:
# 302 is also accepted, as Kibana is performing a redirect
alb.ingress.kubernetes.io/success-codes: 200,302

# As of API management version 7.7.0.20220228, you can provide the necessary configuration (e.g. policies, settings)
# externally instead of having to bake it into the image.
# This init container downloads a provided FED file and places it under /merge/fed before the ANM starts.
#
# Please note that the image must be built with the EMT script: apigw-emt-scripts-2.4.0-20220222.150412-10.tar.gz or newer.
#
# You can choose any method how the configuration is loaded. For example via git clone
# which is recommended for a YAML entity store as you can store the whole merge dir structure directly in git.
extraInitContainers:
- name: init-fed
image: busybox:1.33
volumeMounts:
- name: merge-dir
mountPath: /merge
# command: [ "sh", "-c", "tail -f /dev/null" ]
command:
- sh
- -c
- |
#!/bin/sh
echo "Download API-Gateway config from: https://raw.githubusercontent.com/cwiechmann/axway-api-management-automated/main/gateway-config/apigateway/fed/apigateway.fed"
wget -O /merge/fed https://raw.githubusercontent.com/cwiechmann/axway-api-management-automated/main/gateway-config/apigateway/fed/apigateway.fed
##################################################################################################################################
# API MANAGER
##################################################################################################################################
Expand All @@ -44,6 +67,28 @@ apimgr:
# 302 is also accepted, as Kibana is performing a redirect
alb.ingress.kubernetes.io/success-codes: 200,302

# As of API management version 7.7.0.20220228, you can provide the necessary configuration (e.g. policies, settings)
# externally instead of having to bake it into the image.
# This init container downloads a provided FED file and places it under /merge/fed before the API Gateway instance starts.
# Please note that the image must be built with the EMT script: apigw-emt-scripts-2.4.0-20220222.150412-10.tar.gz or newer.
#
# You can choose any method how the configuration is loaded. For example via git clone
# which is recommended for a YAML entity store as you can store the whole merge dir structure directly in git.
extraInitContainers:
- name: init-fed
image: busybox:1.33
volumeMounts:
- name: merge-dir
mountPath: /merge
# command: [ "sh", "-c", "tail -f /dev/null" ]
command:
- sh
- -c
- |
#!/bin/sh
echo "Download API-Gateway config from: https://raw.githubusercontent.com/cwiechmann/axway-api-management-automated/main/gateway-config/apigateway/fed/apigateway.fed"
wget -O /merge/fed https://raw.githubusercontent.com/cwiechmann/axway-api-management-automated/main/gateway-config/apigateway/fed/apigateway.fed
##################################################################################################################################
# API TRAFFIC
##################################################################################################################################
Expand All @@ -67,6 +112,28 @@ apitraffic:
# alb.ingress.kubernetes.io/healthcheck-path: /healthcheck
# alb.ingress.kubernetes.io/success-codes: 200

# As of API management version 7.7.0.20220228, you can provide the necessary configuration (e.g. policies, settings)
# externally instead of having to bake it into the image.
# This init container downloads a provided FED file and places it under /merge/fed before the API Gateway instance starts.
# Please note that the image must be built with the EMT script: apigw-emt-scripts-2.4.0-20220222.150412-10.tar.gz or newer.
#
# You can choose any method how the configuration is loaded. For example via git clone
# which is recommended for a YAML entity store as you can store the whole merge dir structure directly in git.
extraInitContainers:
- name: init-fed
image: busybox:1.33
volumeMounts:
- name: merge-dir
mountPath: /merge
# command: [ "sh", "-c", "tail -f /dev/null" ]
command:
- sh
- -c
- |
#!/bin/sh
echo "Download API-Gateway config from: https://raw.githubusercontent.com/cwiechmann/axway-api-management-automated/main/gateway-config/apigateway/fed/apigateway.fed"
wget -O /merge/fed https://raw.githubusercontent.com/cwiechmann/axway-api-management-automated/main/gateway-config/apigateway/fed/apigateway.fed
# If you want to include the Amplify agent or Filebeat for Elasticsearch integration as a side-car.
# Make sure that you use the latest images.
# extraContainers:
Expand Down
6 changes: 5 additions & 1 deletion APIM/Helmchart/templates/anm/anm-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ spec:
{{- end }}
terminationGracePeriodSeconds: {{ .Values.anm.terminationGracePeriod }}
volumes:
- name: merge-dir
{{ toYaml .Values.anm.mergeDirVolume | indent 10 }}
- name: events
{{- if .Values.pvcs.events.enabled }}
persistentVolumeClaim:
Expand Down Expand Up @@ -99,7 +101,7 @@ spec:
{{ toYaml .Values.anm.initResources | indent 10 }}
{{- end }}
{{- if .Values.anm.extraInitContainers }}
{{ tpl .Values.anm.extraInitContainers . | indent 6 }}
{{ toYaml .Values.anm.extraInitContainers | indent 6 }}
{{- end }}
containers:
- name: "{{ template "anm.name" . }}"
Expand Down Expand Up @@ -176,6 +178,8 @@ spec:
{{ toYaml .Values.anm.envFrom | indent 8 }}
{{- end }}
volumeMounts:
- name: merge-dir
mountPath: /merge
- name: events
mountPath: {{ default "/opt/Axway/apigateway/events" .Values.anm.volumeMountsPaths.events | quote }}
- name: audit
Expand Down
6 changes: 5 additions & 1 deletion APIM/Helmchart/templates/apimgr/apimgr-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
{{- end }}
terminationGracePeriodSeconds: {{ .Values.apimgr.terminationGracePeriod }}
volumes:
- name: merge-dir
{{ toYaml .Values.apimgr.mergeDirVolume | indent 10 }}
{{- if $licenseSecret }}
- name: license
secret:
Expand Down Expand Up @@ -104,7 +106,7 @@ spec:
resources:
{{ toYaml .Values.apimgr.initResources | indent 10 }}
{{- if .Values.apimgr.extraInitContainers }}
{{ tpl .Values.apimgr.extraInitContainers . | indent 6 }}
{{ toYaml .Values.apimgr.extraInitContainers | indent 6 }}
{{- end }}
containers:
- name: "{{ template "apimgr.name" . }}"
Expand Down Expand Up @@ -189,6 +191,8 @@ spec:
{{ toYaml .Values.apimgr.extraEnvs | indent 8 }}
{{- end }}
volumeMounts:
- name: merge-dir
mountPath: /merge
{{- if .Values.apimgr.jvm.enabled }}
- name: apimgr-jvmxml
mountPath: "/opt/Axway/apigateway/groups/emt-group/emt-service/conf/jvm.xml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ spec:
resources:
{{ toYaml .Values.apiportal.initResources | indent 10 }}
{{- if .Values.apiportal.extraInitContainers }}
{{ tpl .Values.apiportal.extraInitContainers . | indent 6 }}
{{ toYaml .Values.apiportal.extraInitContainers | indent 6 }}
{{- end }}
containers:
- name: "{{ template "apiportal.name" . }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
{{- end }}
terminationGracePeriodSeconds: {{ .Values.apitraffic.terminationGracePeriod }}
volumes:
- name: merge-dir
{{ toYaml .Values.apitraffic.mergeDirVolume | indent 10 }}
- name: events
{{- if .Values.pvcs.events.enabled }}
persistentVolumeClaim:
Expand Down Expand Up @@ -125,7 +127,7 @@ spec:
resources:
{{ toYaml .Values.apitraffic.initResources | indent 10 }}
{{- if .Values.apitraffic.extraInitContainers }}
{{ tpl .Values.apitraffic.extraInitContainers . | indent 6 }}
{{ toYaml .Values.apitraffic.extraInitContainers | indent 6 }}
{{- end }}
containers:
- name: "{{ template "apitraffic.name" . }}"
Expand Down Expand Up @@ -211,6 +213,8 @@ spec:
{{ toYaml .Values.apitraffic.extraEnvs | indent 8 }}
{{- end }}
volumeMounts:
- name: merge-dir
mountPath: /merge
{{- if .Values.apitraffic.jvm.enabled }}
- name: apitraffic-jvmxml
mountPath: "/opt/Axway/apigateway/groups/emt-group/emt-service/conf/jvm.xml"
Expand Down
30 changes: 30 additions & 0 deletions APIM/Helmchart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ anm:
# emtTraceLevel: INFO
# emtParentHost: "anm"

# This creates the volume merge-dir, which is always mounted to /merge to provide policy configuration and API-Gateway configuration to the container.
# By default, an empty-dir is used. For example, this can be used to obtain the necessary files through an extraInitContainer before the ANM POD starts.
# See the provided examples.
# If you want to use a PV or a ConfigMap, then you can configure it here accordingly.
# For more details please see: https://docs.axway.com/bundle/axway-open-docs/page/docs/apim_howto_guides/configuring_apigw_container/index.html
mergeDirVolume:
emptyDir: {}
# configMap:
# name: mergedir-config

# Allows you to add any environment variables
extraEnvs: []
# - name: MY_ENVIRONMENT_VAR
Expand Down Expand Up @@ -250,6 +260,16 @@ apimgr:
# emtTraceLevel: INFO
# emtParentHost: "api-manager"

# This creates the volume merge-dir, which is always mounted to /merge to provide policy configuration and API-Gateway configuration to the container.
# By default, an empty-dir is used. For example, this can be used to obtain the necessary files through an extraInitContainer before the API-Manager POD starts.
# See the provided examples.
# If you want to use a PV or a ConfigMap, then you can configure it here accordingly.
# For more details please see: https://docs.axway.com/bundle/axway-open-docs/page/docs/apim_howto_guides/configuring_apigw_container/index.html
mergeDirVolume:
emptyDir: {}
# configMap:
# name: mergedir-config

# Allows you to add any environment variables
extraEnvs: []
# - name: MY_ENVIRONMENT_VAR
Expand Down Expand Up @@ -439,6 +459,16 @@ apitraffic:
# emtTraceLevel: INFO
# emtParentHost: "api-gateway"

# This creates the volume merge-dir, which is always mounted to /merge to provide policy configuration and API-Gateway configuration to the container.
# By default, an empty-dir is used. For example, this can be used to obtain the necessary files through an extraInitContainer before the Traffic POD starts.
# See the provided examples.
# If you want to use a PV or a ConfigMap, then you can configure it here accordingly.
# For more details please see: https://docs.axway.com/bundle/axway-open-docs/page/docs/apim_howto_guides/configuring_apigw_container/index.html
mergeDirVolume:
emptyDir: {}
# configMap:
# name: mergedir-config

ingress:
enabled: true
# Please note: Only basic ingress settings are configured here.
Expand Down

0 comments on commit 43e6154

Please sign in to comment.