first commit

This commit is contained in:
2025-11-13 23:47:20 +08:00
commit 900b9ca1f3
83 changed files with 8704 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
jfrog.yml
.gitlab-ci.yml
polaris.json

View File

@@ -0,0 +1,10 @@
apiVersion: v2
appVersion: 1.1.63
description: V7 traceability agent
maintainers:
- name: axway/beano
name: v7-traceability
sources:
- https://git.ecd.axway.org/apigov/v7_traceability_agent
type: application
version: 1.1.63

View File

@@ -0,0 +1,34 @@
## Prerequisites
Before the chart can be installed make sure to have the secrets installed/available.
i.e if you look at line 31(secrets) in the values.yaml file, you will notice we are referencing two files.
Required credentials can be applied by using the below format for the secret.
Make sure all the values are base64 encoded before applying it in the cluster.
kubectl apply -f <creds-FILENAME.yaml>
``` yaml
apiVersion: v1
kind: Secret
metadata:
name: traceability-creds
type: Opaque
stringData:
APIMANAGER_AUTH_USERNAME: ""
APIMANAGER_AUTH_PASSWORD: ""
APIGATEWAY_AUTH_USERNAME: ""
APIGATEWAY_AUTH_PASSWORD: ""
```
kubectl apply -f <keys-FILENAME.yaml>
``` yaml
apiVersion: v1
kind: Secret
metadata:
name: traceability-keys
data:
private_key: <PRIVATE_KEY_BASE64>
public_key: <PUBLIC_KEY_BASE64>
```

View File

@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "v7-traceability.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "v7-traceability.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "v7-traceability.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "v7-traceability.labels" -}}
helm.sh/chart: {{ include "v7-traceability.chart" . }}
{{ include "v7-traceability.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "v7-traceability.selectorLabels" -}}
app.kubernetes.io/name: {{ include "v7-traceability.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "v7-traceability.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "v7-traceability.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,148 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "v7-traceability.fullname" . }}
labels:
{{- include "v7-traceability.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "v7-traceability.selectorLabels" . | nindent 6 }}
{{- with .Values.additionalLabels }}
{{- range $key, $value := . }}
{{ default "none" $key }}: {{ default "none" $value | quote }}
{{- end }}
{{- end }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "v7-traceability.selectorLabels" . | nindent 8 }}
{{- with .Values.additionalLabels }}
{{- range $key, $value := . }}
{{ default "none" $key }}: {{ default "none" $value | quote }}
{{- end }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
- name: init
image: alpine
securityContext: {{- toYaml .Values.securityContext | nindent 12 }}
command:
- "sh"
- "-c"
- "chown {{ .Values.podSecurityContext.fsGroup }}:{{ .Values.podSecurityContext.fsGroup }} /data"
volumeMounts:
- name: data
mountPath: /data
serviceAccountName: {{ include "v7-traceability.serviceAccountName" . }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: probe-port
containerPort: {{ .Values.statusPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /status
port: probe-port
{{- with .Values.livenessProbe }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
readinessProbe:
httpGet:
path: /status
port: probe-port
{{- with .Values.readinessProbe }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
env:
{{- with .Values.env }}
{{- range $key, $value := . }}
{{- if and (not (eq (toString $value) "")) (not (eq (toString $key) "")) }} # ignore any items with empty key or value
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.env.APIGATEWAY_ONLY}}
{{- else}}
- name: APIMANAGER_AUTH_USERNAME
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.credentials }}
key: APIMANAGER_AUTH_USERNAME
- name: APIMANAGER_AUTH_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.credentials }}
key: APIMANAGER_AUTH_PASSWORD
{{- end}}
{{- if .Values.env.EVENT_LOG_INPUT}}
- name: APIGATEWAY_AUTH_USERNAME
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.credentials }}
key: APIGATEWAY_AUTH_USERNAME
- name: APIGATEWAY_AUTH_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.credentials }}
key: APIGATEWAY_AUTH_PASSWORD
{{- end}}
volumeMounts:
- name: "traceability-keys-secrets"
mountPath: /keys
- name: events
mountPath: {{ .Values.persistentVolumeClaimConfig.events.mountPath }}
- name: data
mountPath: /data
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: events
persistentVolumeClaim:
claimName: {{ .Values.persistentVolumeClaimConfig.events.name }}
- name: data
persistentVolumeClaim:
claimName: {{ .Values.persistentVolumeClaimConfig.data.name }}
- name: traceability-keys-secrets
secret:
secretName: {{ .Values.secrets.keys }}
items:
- key: private_key
path: private_key.pem
- key: public_key
path: public_key.pem
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.persistentVolumeClaimConfig.data.name }}
namespace: {{ .Release.Namespace }}
spec:
accessModes:
- ReadWriteOnce
storageClassName: {{ .Values.persistentVolumeClaimConfig.data.storageClass }}
resources:
requests:
storage: 2Gi

View File

@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "v7-traceability.serviceAccountName" . }}
labels:
{{- include "v7-traceability.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,96 @@
replicaCount: 1
image:
repository: axway.jfrog.io/ampc-public-docker-release/agent/v7-traceability-agent
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "1.1.63"
registry: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
# Health Check port
statusPort: 8990
# Info on how to fetch the values for the env parameters can ve found in the below doc.
# https://docs.axway.com/bundle/axway-open-docs/page/docs/central/connect-api-manager/gateway-administation/index.html#customizing-the-traceability-agent-environment-variable-file
# More environment value: https://docs.axway.com/bundle/axway-open-docs/page/docs/central/connect-api-manager/agent-variables/index.html#common-variables-to-both-agents
env:
LOG_LEVEL: info
CENTRAL_URL: "https://apicentral.axway.com"
CENTRAL_AUTH_URL: "https://login.axway.com/auth"
CENTRAL_DEPLOYMENT: "prod"
# EVENT_LOG_PATHS: "/opt/Axway/apigateway/events/axwaydemo_traffic-*.log"
EVENT_LOG_PATHS: "/events/*.log"
EVENT_LOG_INPUT: true
OPENTRAFFIC_LOG_INPUT: false
OPENTRAFFIC_LOG_PATHS: /events/*.log
TRACEABILITY_HOST: "ingestion.datasearch.axway.com:5044"
TRACEABILITY_PROTOCOL: "tcp"
TRACEABILITY_SAMPLING_PERCENTAGE: 10
TRACEABILITY_SAMPLING_REPORTALLERRORS: true
APIMANAGER_PORT: "443"
# flip to true if API manager is using a self signed certificate
APIMANAGER_SSL_INSECURESKIPVERIFY: false
APIGATEWAY_ONLY: false
APIGATEWAY_PORT: "443"
# flip to true if API gateway is using a self signed certificate
APIGATEWAY_SSL_INSECURESKIPVERIFY: false
APIGATEWAY_HEALTHCHECKPORT: 8090
APIGATEWAY_HEALTHCHECKPROTOCOL: "https"
APIGATEWAY_HEALTHCHECKURI: login
# The below secret are a pre-requisite. Please refer to the readme file for more info on it.
secrets:
credentials: "traceability-creds"
keys: "traceability-keys"
podAnnotations:
podSecurityContext:
fsGroup: 2500
supplementalGroups: [2500]
fsGroupChangePolicy: "OnRootMismatch"
securityContext:
tolerations:
affinity:
nodeSelector: {}
# Add additional labels to the agent deployment which may be required based on your configuration
additionalLabels:
# Add selector labels for deployment purposes
selectorLabels:
serviceAccount:
# Specifies whether a service account should be created
create: true
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
persistentVolumeClaimConfig:
data:
# storage class to persist contents of data directory in the agent - should be available in the cluster i.e gp2, gp2-csi, default
storageClass: gp2-csi
name: data-claim
events:
name: events-claim
mountPath: /events
livenessProbe:
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 3
readinessProbe:
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 3
global:
defaultRegistry: ""