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

Feat/argo events fixes #2336

Merged
merged 6 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 14 additions & 2 deletions gen3/bin/kube-setup-argo-events.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,22 @@ if ! kubectl get namespace argo-events > /dev/null 2>&1; then
kubectl create namespace argo-events
fi

# Check if target configmap exists
if ! kubectl get configmap environment -n argo-events > /dev/null 2>&1; then

# Get value from source configmap
VALUE=$(kubectl get configmap global -n default -o jsonpath="{.data.environment}")

# Create target configmap
kubectl create configmap environment -n argo-events --from-literal=environment=$VALUE

fi

if [[ "$ctxNamespace" == "default" || "$ctxNamespace" == "null" || "$override_namespace" == true ]]; then
if (! helm status argo -n argo-events > /dev/null 2>&1 ) || [[ "$force" == true ]]; then
helm repo add argo https://argoproj.github.io/argo-helm --force-update 2> >(grep -v 'This is insecure' >&2)
helm repo update 2> >(grep -v 'This is insecure' >&2)
helm upgrade --install argo argo/argo-events -n argo-events --version "2.1.3"
helm upgrade --install argo-events argo/argo-events -n argo-events --version "2.1.3"
else
gen3_log_info "argo-events Helm chart already installed. To force reinstall, run with --force"
fi
Expand All @@ -46,7 +57,7 @@ if [[ "$ctxNamespace" == "default" || "$ctxNamespace" == "null" || "$override_na
kubectl apply -f ${GEN3_HOME}/kube/services/argo-events/eventbus.yaml
fi
else
gen3_log_info "Not running in default namespace, will not install argo-events helm chart"
gen3_log_info "Not running in default namespace, will not install argo-events helm chart. This behavior can be overwritten with the --override-namespace flag"
fi

if [[ "$create_workflow_resources" == true ]]; then
Expand All @@ -57,4 +68,5 @@ if [[ "$create_workflow_resources" == true ]]; then
#Creating rolebindings to allow Argo Events to create jobs, and allow those jobs to manage Karpenter resources
kubectl create rolebinding argo-events-job-admin-binding --role=job-admin --serviceaccount=argo-events:default --namespace=argo-events
kubectl create clusterrolebinding karpenter-admin-binding --clusterrole=karpenter-admin --serviceaccount=argo-events:default
kubectl create clusterrolebinding argo-workflows-view-binding --clusterrole=argo-argo-workflows-view --serviceaccount=argo-events:default
fi
3 changes: 2 additions & 1 deletion kube/services/argo-events/eventbus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
name: default
namespace: argo-events
spec:
nats:
native:
# Optional, defaults to 3. If it is < 3, set it to 3, that is the minimal requirement.
replicas: 3
# Optional, authen strategy, "none" or "token", defaults to "none"
auth: token
auth: token
10 changes: 5 additions & 5 deletions kube/services/argo-events/workflows/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ data:
name: workflow-$WORKFLOW_NAME
spec:
subnetSelector:
karpenter.sh/discovery: vhdcperf
karpenter.sh/discovery: $ENVIRONMENT
securityGroupSelector:
karpenter.sh/discovery: vhdcperf-workflow
karpenter.sh/discovery: $ENVIRONMENT-workflow
tags:
Environment: vhdcperf
Name: eks-vhdcperf-workflow-karpenter
karpenter.sh/discovery: vhdcperf
Environment: $ENVIRONMENT
Name: eks-$ENVIRONMENT-workflow-karpenter
karpenter.sh/discovery: $ENVIRONMENT
workflowname: $WORKFLOW_NAME
gen3username: $GEN3_USERNAME
gen3service: argo-workflows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ spec:
eventTypes:
- ADD
filter:
afterStart: false
afterStart: true
22 changes: 13 additions & 9 deletions kube/services/argo-events/workflows/sensor-created.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,20 @@ spec:
- name: karpenter-resource-creator
image: quay.io/cdis/awshelper
command: ["/bin/sh"]
args:
- "-c"
- |
for file in /home/manifests/*.yaml; do envsubst < $file | kubectl apply -f -; done
args:
- "-c"
- |
for file in /home/manifests/*.yaml; do envsubst < $file | kubectl apply -f -; done
env:
- name: WORKFLOW_NAME
value: ""
- name: GEN3_USERNAME
value: ""
- name: WORKFLOW_NAME
value: ""
- name: GEN3_USERNAME
value: ""
- name: ENVIRONMENT
valueFrom:
configMapKeyRef:
name: environment
key: environment
volumeMounts:
- name: karpenter-templates-volume
mountPath: /home/manifests
Expand All @@ -73,4 +78,3 @@ spec:
configMap:
name: karpenter-templates
backoffLimit: 0