Skip to content

Commit

Permalink
fix: apply authorization policy to fix istio traffic issues (#360)
Browse files Browse the repository at this point in the history
* fix: apply authorization policy with relaxed rule
  • Loading branch information
NohaIhab authored Oct 25, 2023
1 parent 9786912 commit 3bb5478
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charms/kfp-profile-controller/files/upstream/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,29 @@ def sync(self, parent, attachments):
}
}
},
# This AuthorizationPolicy was added from https://github.com/canonical/kfp-operators/pull/356
# to fix https://github.com/canonical/notebook-operators/issues/311
# and https://github.com/canonical/kfp-operators/issues/355.
# Remove when istio sidecars are implemented.
{
"apiVersion": "security.istio.io/v1beta1",
"kind": "AuthorizationPolicy",
"metadata": {"name": "ns-owner-access-istio-charmed", "namespace": namespace},
"spec": {
"rules": [
{
"when": [
{"key": "request.headers[kubeflow-userid]", "values": ["*"]}
]
},
{
"to": [
{"operation": {"methods": ["GET"], "paths": ["*/api/kernels"]}}
]
},
]
},
},
]
print('Received request:\n', json.dumps(parent, indent=2, sort_keys=True))
print('Desired resources except secrets:\n', json.dumps(desired_resources, indent=2, sort_keys=True))
Expand Down

0 comments on commit 3bb5478

Please sign in to comment.