Skip to content

Commit

Permalink
cluster2
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisns committed May 13, 2022
1 parent e72a36f commit d346e1a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,23 @@ jobs:
- name: Apply Policy
run: |
kubectl apply -k "github.com/policy-as-versioned-code/policy/kubernetes/kyverno?ref=1.0.0"
kubectl apply -k "github.com/policy-as-versioned-code/policy/kubernetes/kyverno?ref=2.0.0"
kubectl apply -k "github.com/policy-as-versioned-code/policy/kubernetes/kyverno?ref=2.1.0"
kubectl apply -k "github.com/policy-as-versioned-code/policy/kubernetes/kyverno?ref=2.1.1"
- name: Wait for policy to be available
run: |
while [[ $(kubectl get -k "github.com/policy-as-versioned-code/policy/kubernetes/kyverno?ref=1.0.0" -o 'jsonpath={..status.ready}') != "true" ]]; do sleep 1; done
while [[ $(kubectl get -k "github.com/policy-as-versioned-code/policy/kubernetes/kyverno?ref=2.0.0" -o 'jsonpath={..status.ready}') != "true true" ]]; do sleep 1; done
while [[ $(kubectl get -k "github.com/policy-as-versioned-code/policy/kubernetes/kyverno?ref=2.1.0" -o 'jsonpath={..status.ready}') != "true true" ]]; do sleep 1; done
while [[ $(kubectl get -k "github.com/policy-as-versioned-code/policy/kubernetes/kyverno?ref=2.1.1" -o 'jsonpath={..status.ready}') != "true true" ]]; do sleep 1; done
- name: Deploy apps
run: |
kubectl apply -k github.com/policy-as-versioned-code/app1
kubectl apply -k github.com/policy-as-versioned-code/app2
kubectl apply -k github.com/policy-as-versioned-code/app3
- name: Check all apps are deployed
run: |
kubectl wait --for=condition=available --timeout=600s \
deployment/app1 \
deployment/app2 \
deployment/app3
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# All versions of policy co-existing on a single Kubernetes Cluster
# >=2.0.0 versions of policy co-existing on a single Kubernetes Cluster

## Demo

Expand Down Expand Up @@ -26,10 +26,6 @@ customresourcedefinition.apiextensions.k8s.io/clusterpolicies.kyverno.io created
...[etc]...
deployment.apps/kyverno created

# Apply Policy 1.0.0
$ kubectl apply -k "github.com/policy-as-versioned-code/policy/kubernetes/kyverno?ref=1.0.0"
clusterpolicy.kyverno.io/require-department-label-1.0.0 created

# Apply Policy 2.0.0
$ kubectl apply -k "github.com/policy-as-versioned-code/policy/kubernetes/kyverno?ref=2.0.0"
clusterpolicy.kyverno.io/require-department-label-2.0.0 created
Expand All @@ -45,10 +41,6 @@ $ kubectl apply -k "github.com/policy-as-versioned-code/policy/kubernetes/kyvern
clusterpolicy.kyverno.io/require-department-label-2.1.1 created
clusterpolicy.kyverno.io/require-known-department-label-2.1.1 created

# Deploy app1
$ kubectl apply -k github.com/policy-as-versioned-code/app1
deployment.apps/app1 created

# Deploy app2
$ kubectl apply -k github.com/policy-as-versioned-code/app2
deployment.apps/app2 created
Expand All @@ -59,7 +51,6 @@ deployment.apps/app3 created

# Check all apps are deployed
$ kubectl wait --for=condition=available --timeout=600s \
deployment/app1 \
deployment/app2 \
deployment/app3
deployment.apps/app1 condition met
Expand Down

0 comments on commit d346e1a

Please sign in to comment.