Skip to content

Commit

Permalink
BRH-301: Extend hatchery to launch prismacloud containers (#2061)
Browse files Browse the repository at this point in the history
  • Loading branch information
jawadqur authored Nov 1, 2022
1 parent da2478d commit 5c3ba19
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gen3/bin/kube-setup-hatchery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ if ! g3kubectl get sa "$saName" -o json | jq -e '.metadata.annotations | ."eks.a
gen3 awsrole attach-policy "arn:aws:iam::aws:policy/AWSResourceAccessManagerFullAccess" --role-name ${roleName} --force-aws-cli || exit 1
fi

if [[ -f "$(gen3_secrets_folder)/prisma/apikey.json" ]]; then
ACCESSKEYID=$(jq -r .AccessKeyID "$(gen3_secrets_folder)/prisma/apikey.json")
SECRETKEY=$(jq -r .SecretKey "$(gen3_secrets_folder)/prisma/apikey.json")
if [[ ! -z "$ACCESSKEYID" && ! -z "$SECRETKEY" ]]; then
gen3_log_info "Found prisma apikey, creating kubernetes secret so hatchery can do prismacloud stuff.."
g3kubectl delete secret prisma-secret --ignore-not-found
g3kubectl create secret generic prisma-secret --from-literal=AccessKeyId=$ACCESSKEYID --from-literal=SecretKey=$SECRETKEY
fi
fi

g3kubectl apply -f "${GEN3_HOME}/kube/services/hatchery/hatchery-service.yaml"
gen3 roll hatchery
Expand Down
12 changes: 12 additions & 0 deletions kube/services/hatchery/hatchery-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: PRISMA_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: prisma-secret
key: AccessKeyId
optional: true
- name: PRISMA_SECRET_KEY
valueFrom:
secretKeyRef:
name: prisma-secret
key: SecretKey
optional: true
volumeMounts:
- name: hatchery-config
readOnly: true
Expand Down

0 comments on commit 5c3ba19

Please sign in to comment.