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

Fixes #580: change k3s to /usr/local/bin/k3s #202

Closed
wants to merge 1 commit into from
Closed
Changes from all 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
29 changes: 15 additions & 14 deletions policies/policy-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@

set -x
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need the debugging option ?

[ $(id -u) -eq 0 ] || exec sudo $0 $@
K3S=/usr/local/bin/k3s

counter=1
while [[ $(k3s kubectl get namespaces | grep karavi | wc -l) -ne 1 ]]
while [[ $($K3S kubectl get namespaces | grep karavi | wc -l) -ne 1 ]]
do
if [[ "$counter" -eq 30 ]]
then
Expand All @@ -29,22 +30,22 @@ done

cd "$(dirname "$0")"

if [[ $(k3s kubectl get secret karavi-storage-secret -n karavi | grep karavi-storage-secret | wc -l) -ne 1 ]]
if [[ $($K3S kubectl get secret karavi-storage-secret -n karavi | grep karavi-storage-secret | wc -l) -ne 1 ]]
then
echo "Creating karavi storage secret"
k3s kubectl apply -f ./karavi-storage-secret.yaml
$K3S kubectl apply -f ./karavi-storage-secret.yaml
fi

if [[ $(k3s kubectl get configmap common -n karavi | grep common | wc -l) -ne 1 ]]
if [[ $($K3S kubectl get configmap common -n karavi | grep common | wc -l) -ne 1 ]]
then
k3s kubectl create configmap common -n karavi --from-file=./common.rego --save-config --dry-run=client -o yaml | k3s kubectl apply -f -
$K3S kubectl create configmap common -n karavi --from-file=./common.rego --save-config --dry-run=client -o yaml | $K3S kubectl apply -f -
fi
k3s kubectl create configmap powermax-volumes-create -n karavi --from-file=./volumes_powermax_create.rego --save-config --dry-run=client -o yaml | k3s kubectl apply -f -
k3s kubectl create configmap powerscale-volumes-create -n karavi --from-file=./volumes_powerscale_create.rego --save-config --dry-run=client -o yaml | k3s kubectl apply -f -
k3s kubectl create configmap volumes-create -n karavi --from-file=./volumes_create.rego --save-config --dry-run=client -o yaml | k3s kubectl apply -f -
k3s kubectl create configmap volumes-delete -n karavi --from-file=./volumes_delete.rego --save-config --dry-run=client -o yaml | k3s kubectl apply -f -
k3s kubectl create configmap volumes-unmap -n karavi --from-file=./volumes_unmap.rego --save-config --dry-run=client -o yaml | k3s kubectl apply -f -
k3s kubectl create configmap volumes-map -n karavi --from-file=./volumes_map.rego --save-config --dry-run=client -o yaml | k3s kubectl apply -f -
k3s kubectl create configmap powerflex-urls -n karavi --from-file=./url.rego --save-config --dry-run=client -o yaml | k3s kubectl apply -f -
k3s kubectl create configmap powermax-urls -n karavi --from-file=./powermax_url.rego --save-config --dry-run=client -o yaml | k3s kubectl apply -f -
k3s kubectl create configmap powerscale-urls -n karavi --from-file=./powerscale_url.rego --save-config --dry-run=client -o yaml | k3s kubectl apply -f -
$K3S kubectl create configmap powermax-volumes-create -n karavi --from-file=./volumes_powermax_create.rego --save-config --dry-run=client -o yaml | $K3S kubectl apply -f -
$K3S kubectl create configmap powerscale-volumes-create -n karavi --from-file=./volumes_powerscale_create.rego --save-config --dry-run=client -o yaml | $K3S kubectl apply -f -
$K3S kubectl create configmap volumes-create -n karavi --from-file=./volumes_create.rego --save-config --dry-run=client -o yaml | $K3S kubectl apply -f -
$K3S kubectl create configmap volumes-delete -n karavi --from-file=./volumes_delete.rego --save-config --dry-run=client -o yaml | $K3S kubectl apply -f -
$K3S kubectl create configmap volumes-unmap -n karavi --from-file=./volumes_unmap.rego --save-config --dry-run=client -o yaml | $K3S kubectl apply -f -
$K3S kubectl create configmap volumes-map -n karavi --from-file=./volumes_map.rego --save-config --dry-run=client -o yaml | $K3S kubectl apply -f -
$K3S kubectl create configmap powerflex-urls -n karavi --from-file=./url.rego --save-config --dry-run=client -o yaml | $K3S kubectl apply -f -
$K3S kubectl create configmap powermax-urls -n karavi --from-file=./powermax_url.rego --save-config --dry-run=client -o yaml | $K3S kubectl apply -f -
$K3S kubectl create configmap powerscale-urls -n karavi --from-file=./powerscale_url.rego --save-config --dry-run=client -o yaml | $K3S kubectl apply -f -