lehrig / kubeflow-ppc64le-manifests

A repository for Kustomize manifests for Kubeflow on ppc64le
Apache License 2.0
3 stars 7 forks source link

Add scripts for managing httpd users #5

Open lehrig opened 2 years ago

lehrig commented 2 years ago

Add scripts for:

lehrig commented 2 years ago

When creating a namespace for new users, vanilla k8s also needs to create such resources, so users can execute pipelines from within NB servers:

cat << EOF | kubectl apply -f -
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
 name: bind-ml-pipeline-nb-kubeflow-user-example-com
 namespace: kubeflow
spec:
 selector:
   matchLabels:
     app: ml-pipeline
 rules:
 - from:
   - source:
       principals: ["cluster.local/ns/kubeflow-user-example-com/sa/default-editor"]
---
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: add-header
  namespace: kubeflow-user-example-com
spec:
  configPatches:
  - applyTo: VIRTUAL_HOST
    match:
      context: SIDECAR_OUTBOUND
      routeConfiguration:
        vhost:
          name: ml-pipeline.kubeflow.svc.cluster.local:8888
          route:
            name: default
    patch:
      operation: MERGE
      value:
        request_headers_to_add:
        - append: true
          header:
            key: kubeflow-userid
            value: user@example.com
EOF

In OpenShift, this is already automated using the namespace configuration operator.

lehrig commented 2 years ago

See #4