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

Move RequestAuthentication policy creation to iap-enabler for gitops friendliness #364

Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 4 additions & 4 deletions kubeflow/common/iap-ingress/base/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ data:
[ -z ${SERVICE} ] && echo Error SERVICE must be set && exit 1
[ -z ${INGRESS_NAME} ] && echo Error INGRESS_NAME must be set && exit 1

__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

PROJECT=$(curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/project/project-id)
if [ -z ${PROJECT} ]; then
echo Error unable to fetch PROJECT from compute metadata
Expand Down Expand Up @@ -100,10 +102,8 @@ data:
echo BACKEND_ID=${BACKEND_ID}

JWT_AUDIENCE="/projects/${PROJECT_NUM}/global/backendServices/${BACKEND_ID}"

# Use kubectl patch.
echo patch JWT audience: ${JWT_AUDIENCE}
kubectl patch RequestAuthentication ingress-jwt -n ${NAMESPACE} --type json -p '[{"op": "replace", "path": "/spec/jwtRules/0/audiences/0", "value": "'${JWT_AUDIENCE}'"}]'
echo "Upsert RequestAuthentication with JWT audience: ${JWT_AUDIENCE}"
sed "s|TO_BE_PATCHED|${JWT_AUDIENCE}|" ${__dir}/policy.yaml | kubectl apply -n ${NAMESPACE} -f -

echo "Clearing lock on service annotation"
kubectl patch svc "${SERVICE}" -n istio-system -p "{\"metadata\": { \"annotations\": {\"backendlock\": \"\" }}}"
Expand Down
6 changes: 5 additions & 1 deletion kubeflow/common/iap-ingress/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ resources:
- deployment.yaml
- iap-ingress-config.yaml
- ingress.yaml
- policy.yaml
- service-account.yaml
- service.yaml
- stateful-set.yaml
Expand All @@ -27,6 +26,11 @@ images:
- name: gcr.io/ml-pipeline/cloud-solutions-group/esp-sample-app
newName: gcr.io/ml-pipeline/cloud-solutions-group/esp-sample-app
newTag: 1.0.0
configMapGenerator:
- name: envoy-config
behavior: merge
files:
- policy.yaml
# TODO(Bobgy): migrate kustomize vars to kpt setters?
vars:
- name: appName
Expand Down