Browse Source

remove wg0 on scale down

Stavros kois 2 years ago
parent
commit
c5abad592a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      test/wg-easy/1.0.0/templates/deployment.yaml

+ 7 - 0
test/wg-easy/1.0.0/templates/deployment.yaml

@@ -106,6 +106,13 @@ spec:
                       ip route del {{ $ip }}/$netmask || echo "Route deletion failed..."
                     fi
                     echo "Routes deleted..."
+                    interface=$(ip a | grep wg0)
+                    if [ ! "$interface" == "" ]; then
+                      echo "Removing wg0 interface..."
+                      ip link delete wg0
+                      echo "Removed wg0 interface..."
+                    fi
+
 {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
       volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
       {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}