Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Aqua enforcer Add On #216

Merged
merged 7 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions eks-anywhere-common/Addons/Partner/Aqua/aqua-enforcer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: aqua-enforcer
namespace: aqua
spec:
chart:
spec:
chart: enforcer
reconcileStrategy: ChartVersion
sourceRef:
kind: HelmRepository
name: aqua-helm
namespace: flux-system
version: "2022.4.20"
interval: 30s
values:
global:
platform: eks
gateway:
port: 443
imageCredentials:
create: true
name:
repositoryUriPrefix: "registry.aquasec.com"
registry: "registry.aquasec.com"
serviceAccount:
create: true
nodeSelector: {}
tolerations: []
podAnnotations: {}
podLabels: {}
podSecurityContext: {}
affinity: {}
extraEnvironmentVars: {}
valuesFrom:
- kind: Secret
name: aqua-secrets-from-ps
valuesKey: aqua-geteway-address
targetPath: global.gateway.address
- kind: Secret
name: aqua-secrets-from-ps
valuesKey: aqua-enforcer-token
targetPath: enforcerToken
- kind: Secret
name: aqua-secrets-from-ps
valuesKey: aqua-image-username
targetPath: global.imageCredentials.username
- kind: Secret
name: aqua-secrets-from-ps
valuesKey: aqua-image-password
targetPath: global.imageCredentials.password

9 changes: 9 additions & 0 deletions eks-anywhere-common/Addons/Partner/Aqua/aqua-source.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: aqua-helm
namespace: flux-system
spec:
interval: 30s
url: https://helm.aquasec.com
29 changes: 29 additions & 0 deletions eks-anywhere-common/Addons/Partner/Aqua/external-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: aqua-secretstore-eksa
namespace: aqua
spec:
refreshInterval: 1m
secretStoreRef:
name: eksa-secret-store
kind: ClusterSecretStore
target:
name: aqua-secrets-from-ps # Specify the name for the Kubernetes Secret
data:
- secretKey: aqua-enforcer-token # Key in Kubernetes Secret
remoteRef:
key: /aqua-enforcer/enforcer-token # Key in AWS Parameter Store

- secretKey: aqua-image-username
remoteRef:
key: /aqua-enforcer/username
elamaran11 marked this conversation as resolved.
Show resolved Hide resolved

- secretKey: aqua-image-password
remoteRef:
key: /aqua-enforcer/password

- secretKey: aqua-geteway-address
remoteRef:
key: /aqua-enforcer/gateway

8 changes: 8 additions & 0 deletions eks-anywhere-common/Addons/Partner/Aqua/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: aqua
labels:
aws.conformance.vendor: aqua
aws.conformance.vendor-solution: aqua-enforcer
35 changes: 35 additions & 0 deletions eks-anywhere-common/Testers/Aqua/aqua-testJob.yaml
mikemcd3912 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: batch/v1
kind: Job
metadata:
name: aqua-enforcer-tester
namespace: aqua
spec:
template:
spec:
serviceAccountName: 'aqua-enforcer-sa'
containers:
- name: test-aqua-enforcer
image: 'alpine/k8s:1.26.2'
imagePullPolicy: Always
command:
- /bin/bash
args:
- '-c'
- >-
echo "1. Checking readiness probe"
aqua_enforcer_pod="";
while true;
do
aqua_enforcer_pod=$(kubectl get pod -n aqua -l app=aqua-enforcer-ds --field-selector=status.phase==Running -o jsonpath="{.items[0].metadata.name}{range .items[0].status.conditions[?(@.type=='Ready')]}");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking the status of a pod run does not qualify for a functional test. Please check our functional job requirements for detailed requirements. You can also check our Partner submission test jobs for more reference.

aqua_enforcer_pod_status=$(kubectl get pod $aqua_enforcer_pod -n aqua -o jsonpath="{.status.phase}");

if [[ $aqua_enforcer_pod_status != "Running" ]]; then
echo "LOG: Pod $aqua_enforcer_pod, $aqua_enforcer_pod_status";
sleep 15;
else
echo "LOG: Pod $aqua_enforcer_pod, Running";
exit 0;
fi;
done;
restartPolicy: Never
backoffLimit: 1