Skip to content

Commit

Permalink
Configured istio initContainer
Browse files Browse the repository at this point in the history
Signed-off-by: biswajit-9776 <biswajitpatt139@gmail.com>
  • Loading branch information
biswajit-9776 committed Sep 16, 2024
1 parent 5743a1f commit 65ec9f7
Showing 1 changed file with 37 additions and 26 deletions.
63 changes: 37 additions & 26 deletions .github/workflows/pss_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,22 @@ jobs:
- name: Install kubectl
run: ./tests/gh-actions/install_kubectl.sh

- name: Install all deployments from static namespaces
- name: Install all istio-cni resources
run: |
kustomize build common/kubeflow-namespace/base | kubectl apply -f -
./tests/gh-actions/install_cert_manager.sh
./tests/gh-actions/install_istio-cni.sh
kustomize build common/istio-cni-1-22/kubeflow-istio-resources/base | kubectl apply -f -
- name: Configure istio init container with seccompProfile attribute
run: |
kubectl get cm istio-sidecar-injector -n istio-system -o yaml > temporary_patch.yaml
sed -i '0,/runAsNonRoot: true/{s//&\n seccompProfile:\n type: RuntimeDefault/}' temporary_patch.yaml
kubectl apply -f temporary_patch.yaml
rm temporary_patch.yaml
- name: Install all other deployments of static namespaces
run: |
kustomize build common/kubeflow-namespace/base | kubectl apply -f -
./tests/gh-actions/install_multi_tenancy.sh
kustomize build ./common/oauth2-proxy/overlays/m2m-self-signed | kubectl apply -f -
echo "Waiting for all oauth2-proxy pods to become ready..."
Expand All @@ -44,30 +54,31 @@ jobs:
- name: Install KF Pipelines
run: ./tests/gh-actions/install_pipelines.sh

- name: Apply Pod Security Standards baseline levels for dynamic namespaces
run: |
cat << EOF > ./kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- apps/profiles/upstream/overlays/kubeflow
components:
- contrib/security/PSS/dynamic/restricted
EOF
kubectl apply -k .
rm ./kustomization.yaml
kubectl -n kubeflow wait --for=condition=Ready pods -l kustomize.component=profiles --timeout 500s
- name: Create dynamic user namespace and check for PSS labels present
run: |
kustomize build common/user-namespace/base | kubectl apply -f -
LABELS=$(kubectl get namespace kubeflow-user-example-com --show-labels | awk 'NR==2 {print $NF}')
if [[ "$LABELS" == *pod-security.kubernetes.io/enforce=restricted* ]]; then
echo "PSS restricted label is present in dynamic namespace."
else
echo "PSS restricted label is absent in dynamic namespace."
exit 1
fi
# - name: Apply Pod Security Standards baseline levels for dynamic namespaces
# run: |
# cat << EOF > ./kustomization.yaml
# apiVersion: kustomize.config.k8s.io/v1beta1
# kind: Kustomization
# resources:
# - apps/profiles/upstream/overlays/kubeflow
# components:
# - contrib/security/PSS/dynamic/restricted
# EOF
# kubectl apply -k .
# rm ./kustomization.yaml
# kubectl -n kubeflow wait --for=condition=Ready pods -l kustomize.component=profiles --timeout 200s
# sleep 100

Check failure on line 71 in .github/workflows/pss_test.yaml

View workflow job for this annotation

GitHub Actions / format_YAML_files

71:1 [trailing-spaces] trailing spaces
# - name: Create dynamic user namespace and check for PSS labels present
# run: |
# kustomize build common/user-namespace/base | kubectl apply -f -
# LABELS=$(kubectl get namespace kubeflow-user-example-com --show-labels | awk 'NR==2 {print $NF}')
# if [[ "$LABELS" == *pod-security.kubernetes.io/enforce=restricted* ]]; then
# echo "PSS restricted label is present in dynamic namespace."
# else
# echo "PSS restricted label is absent in dynamic namespace."
# exit 1
# fi

- name: Apply patches to clear warnings
run: |
Expand Down

0 comments on commit 65ec9f7

Please sign in to comment.