Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
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
17 changes: 11 additions & 6 deletions deployment/kubernetes/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,22 @@ done
for i in $(find "$DIR" -name "*deployment.yaml"); do
len=$(echo $DIR | wc -m)
i1=$(echo ${i:${len}} | sed 's/-deployment.yaml//')

for j in $(kubectl get pod | awk '{print $1}' | sed -n '2, $p' | awk -F '-' '{$NF=""; $(NF-1)=""; gsub(" ", "");gsub(" ", "-"); print}'); do
if [ ${i1} == ${j} ]; then
kubectl delete -f "${i}"
fi
done
done

if [ -f "$DIR/ovc-self-certificates.yaml" ]; then
kubectl delete -f "$DIR/ovc-self-certificates.yaml"
fi
for i in $(find "$DIR" -name "*certificates.yaml"); do
len=$(echo $DIR | wc -m)
i1=$(echo ${i:${len}} | sed 's/.yaml//')
for j in $(kubectl get secret | awk '{print $1}' | sed -n '2, $p' | grep -v 'default-token'); do
if [ ${i1} == ${j} ] && [ -f "${i}" ]; then
kubectl delete -f "${i}"
fi
done
done

rm -rf $DIR/$EXT

Expand All @@ -70,9 +75,9 @@ try_command kompose convert -f "$yml" -o "$DIR"

try_command "$DIR/update_yaml.py" "$DIR"

try_command kubectl create secret generic ssl-key-secret --from-file=self.key="$DIR/../../self-certificates/self.key" --from-file=self.crt="$DIR/../../self-certificates/self.crt" --from-file=dhparam.pem="$DIR/../../self-certificates/dhparam.pem" --dry-run -o yaml > "$DIR/ovc-self-certificates.yaml"
try_command kubectl create secret generic ovc-ssl-certificates --from-file=self.key="$DIR/../../self-certificates/self.key" --from-file=self.crt="$DIR/../../self-certificates/self.crt" --from-file=dhparam.pem="$DIR/../../self-certificates/dhparam.pem" --dry-run -o yaml > "$DIR/ovc-ssl-certificates.yaml"

try_command kubectl apply -f "$DIR/ovc-self-certificates.yaml"
try_command kubectl apply -f "$DIR/ovc-ssl-certificates.yaml"

for i in $(find "$DIR" -path "$DIR/dashboard" -prune -o -type f -name "*service.yaml" -print); do
kubectl apply -f "$i"
Expand Down
13 changes: 9 additions & 4 deletions deployment/kubernetes/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,21 @@ done
for i in $(find "$DIR" -name "*deployment.yaml"); do
len=$(echo $DIR | wc -m)
i1=$(echo ${i:${len}} | sed 's/-deployment.yaml//')

for j in $(kubectl get pod | awk '{print $1}' | sed -n '2, $p' | awk -F '-' '{$NF=""; $(NF-1)=""; gsub(" ", "");gsub(" ", "-"); print}'); do
if [ ${i1} == ${j} ]; then
kubectl delete -f "${i}"
fi
done
done

if [ -f "$DIR/ovc-self-certificates.yaml" ]; then
kubectl delete -f "$DIR/ovc-self-certificates.yaml"
fi
for i in $(find "$DIR" -name "*certificates.yaml"); do
len=$(echo $DIR | wc -m)
i1=$(echo ${i:${len}} | sed 's/.yaml//')
for j in $(kubectl get secret | awk '{print $1}' | sed -n '2, $p' | grep -v 'default-token'); do
if [ ${i1} == ${j} ] && [ -f "${i}" ]; then
kubectl delete -f "${i}"
fi
done
done

rm -rf $DIR/$EXT
4 changes: 2 additions & 2 deletions deployment/kubernetes/yaml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def add_volumes(data, nfs_server, isCDN, cdn_directory):
'hostPath':
{'path': cdn_directory + '/volume/html'} },
{'name': 'secrets',
'secret': {'secretName': 'ssl-key-secret'} } ]
'secret': {'secretName': 'ovc-ssl-certificates'} } ]
elif isCDN:
volumes_caps = [ {'name': 'archive',
'nfs':
Expand All @@ -115,7 +115,7 @@ def add_volumes(data, nfs_server, isCDN, cdn_directory):
'hostPath':
{'path': cdn_directory + '/volume/html'} },
{'name': 'secrets',
'secret': {'secretName': 'ssl-key-secret'} } ]
'secret': {'secretName': 'ovc-ssl-certificates'} } ]
else:
volumes_caps = [ {'name': 'archive',
'nfs':
Expand Down