Skip to content

Commit e98f2d6

Browse files
authored
Merge pull request #101 from edenlabllc/release/v1.0.0
Release/v1.0.0
2 parents 35a6b38 + 946ee1b commit e98f2d6

16 files changed

Lines changed: 475 additions & 230 deletions
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
readonly NAMESPACE="${1}"
6+
readonly RELEASE_NAME="${2}"
7+
readonly LIMIT="${3:-1200}"
8+
9+
readonly GO_TEMPLATE='
10+
{{- range .items -}}
11+
{{- if eq .kind "Cluster" -}}
12+
{{- if ne .status.phase "Provisioned" }}0{{- end }}
13+
{{- if not .status.controlPlaneReady }}0{{- end }}
14+
{{- if not .status.infrastructureReady }}0{{- end }}
15+
{{- end -}}
16+
{{- if eq .kind "AWSManagedCluster" -}}
17+
{{- if not .status.ready }}0{{- end }}
18+
{{- end -}}
19+
{{- if eq .kind "AWSManagedControlPlane" -}}
20+
{{- if not .status.ready }}0{{- end }}
21+
{{- if not .status.initialized }}0{{- end }}
22+
{{- end -}}
23+
{{- if eq .kind "AWSManagedMachinePool" -}}
24+
{{- if not .status.ready }}0{{- end -}}
25+
{{- end -}}
26+
{{- if eq .kind "MachinePool" -}}
27+
{{- if ne .status.phase "Running" }}0{{- end }}
28+
{{- if not .status.bootstrapReady }}0{{- end }}
29+
{{- if not .status.infrastructureReady }}0{{- end }}
30+
{{- end -}}
31+
{{- end -}}
32+
'
33+
34+
COUNT=1
35+
while true; do
36+
STATUS="$(kubectl --namespace "${NAMESPACE}" get cluster-api \
37+
--selector "app.kubernetes.io/instance=${RELEASE_NAME}" \
38+
--output "go-template=${GO_TEMPLATE}")"
39+
if [[ "${STATUS}" != "" && "${COUNT}" -le "${LIMIT}" ]]; then
40+
sleep 1
41+
(( ++COUNT ))
42+
elif [[ "${COUNT}" -gt "${LIMIT}" ]]; then
43+
>&2 echo "Limit exceeded."
44+
exit 1
45+
else
46+
echo
47+
kubectl --namespace "${NAMESPACE}" get cluster-api --selector "app.kubernetes.io/instance=${RELEASE_NAME}"
48+
break
49+
fi
50+
done
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
readonly NAMESPACE="${1}"
6+
readonly RELEASE_NAME="${2}"
7+
readonly LIMIT="${3:-120}"
8+
9+
readonly GO_TEMPLATE='
10+
{{- range .items -}}
11+
{{- if not .status }}0{{- end }}
12+
{{- if ne .status.phase "Provisioned" }}0{{- end }}
13+
{{- end -}}
14+
'
15+
16+
COUNT=1
17+
while true; do
18+
STATUS="$(kubectl --namespace "${NAMESPACE}" get awsiamprovision \
19+
--selector "app.kubernetes.io/instance=${RELEASE_NAME}" \
20+
--output "go-template=${GO_TEMPLATE}")"
21+
if [[ "${STATUS}" != "" && "${COUNT}" -le "${LIMIT}" ]]; then
22+
sleep 1
23+
(( ++COUNT ))
24+
elif [[ "${COUNT}" -gt "${LIMIT}" ]]; then
25+
>&2 echo "Limit exceeded."
26+
exit 1
27+
else
28+
echo
29+
kubectl --namespace "${NAMESPACE}" get awsiamprovision --selector "app.kubernetes.io/instance=${RELEASE_NAME}"
30+
break
31+
fi
32+
done
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
readonly NAMESPACE="${1}"
6+
readonly RELEASE_NAME="${2}"
7+
readonly LIMIT="${3:-1200}"
8+
9+
readonly GO_TEMPLATE='
10+
{{- range .items -}}
11+
{{- if eq .kind "Cluster" -}}
12+
{{- if ne .status.phase "Provisioned" }}0{{- end }}
13+
{{- if not .status.controlPlaneReady }}0{{- end }}
14+
{{- if not .status.infrastructureReady }}0{{- end }}
15+
{{- end -}}
16+
{{- if eq .kind "AzureManagedCluster" -}}
17+
{{- if not .status.ready }}0{{- end }}
18+
{{- end -}}
19+
{{- if eq .kind "AzureManagedControlPlane" -}}
20+
{{- if not .status.ready }}0{{- end }}
21+
{{- if not .status.initialized }}0{{- end }}
22+
{{- end -}}
23+
{{- if eq .kind "AzureManagedMachinePool" -}}
24+
{{- if not .status.ready }}0{{- end -}}
25+
{{- end -}}
26+
{{- if eq .kind "MachinePool" -}}
27+
{{- if ne .status.phase "Running" }}0{{- end }}
28+
{{- if not .status.bootstrapReady }}0{{- end }}
29+
{{- if not .status.infrastructureReady }}0{{- end }}
30+
{{- end -}}
31+
{{- end -}}
32+
'
33+
34+
COUNT=1
35+
while true; do
36+
STATUS="$(kubectl --namespace "${NAMESPACE}" get cluster-api \
37+
--selector "app.kubernetes.io/instance=${RELEASE_NAME}" \
38+
--output "go-template=${GO_TEMPLATE}")"
39+
if [[ "${STATUS}" != "" && "${COUNT}" -le "${LIMIT}" ]]; then
40+
sleep 1
41+
(( ++COUNT ))
42+
elif [[ "${COUNT}" -gt "${LIMIT}" ]]; then
43+
>&2 echo "Limit exceeded."
44+
exit 1
45+
else
46+
echo
47+
kubectl --namespace "${NAMESPACE}" get cluster-api --selector "app.kubernetes.io/instance=${RELEASE_NAME}"
48+
break
49+
fi
50+
done
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
readonly NAMESPACE="${1}"
6+
readonly RELEASE_NAME="${2}"
7+
readonly LIMIT="${3:-1200}"
8+
9+
readonly GO_TEMPLATE='
10+
{{- range .items -}}
11+
{{- if eq .kind "Cluster" -}}
12+
{{- if ne .status.phase "Provisioned" }}0{{- end }}
13+
{{- if not .status.controlPlaneReady }}0{{- end }}
14+
{{- if not .status.infrastructureReady }}0{{- end }}
15+
{{- end -}}
16+
{{- if eq .kind "GCPManagedCluster" -}}
17+
{{- if not .status.ready }}0{{- end }}
18+
{{- end -}}
19+
{{- if eq .kind "GCPManagedControlPlane" -}}
20+
{{- if not .status.ready }}0{{- end }}
21+
{{- if not .status.initialized }}0{{- end }}
22+
{{- end -}}
23+
{{- if eq .kind "GCPManagedMachinePool" -}}
24+
{{- if not .status.ready }}0{{- end -}}
25+
{{- end -}}
26+
{{- if eq .kind "MachinePool" -}}
27+
{{- if ne .status.phase "Running" }}0{{- end }}
28+
{{- if not .status.bootstrapReady }}0{{- end }}
29+
{{- if not .status.infrastructureReady }}0{{- end }}
30+
{{- end -}}
31+
{{- end -}}
32+
'
33+
34+
COUNT=1
35+
while true; do
36+
STATUS="$(kubectl --namespace "${NAMESPACE}" get cluster-api \
37+
--selector "app.kubernetes.io/instance=${RELEASE_NAME}" \
38+
--output "go-template=${GO_TEMPLATE}")"
39+
if [[ "${STATUS}" != "" && "${COUNT}" -le "${LIMIT}" ]]; then
40+
sleep 1
41+
(( ++COUNT ))
42+
elif [[ "${COUNT}" -gt "${LIMIT}" ]]; then
43+
>&2 echo "Limit exceeded."
44+
exit 1
45+
else
46+
echo
47+
kubectl --namespace "${NAMESPACE}" get cluster-api --selector "app.kubernetes.io/instance=${RELEASE_NAME}"
48+
break
49+
fi
50+
done
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
readonly NAMESPACE="${1}"
6+
readonly RELEASE_NAME="${2}"
7+
readonly LIMIT="${3:-3600}"
8+
9+
readonly GO_TEMPLATE='
10+
{{- range .items -}}
11+
{{- if eq .kind "Cluster" -}}
12+
{{- if ne .status.phase "Provisioned" }}0{{- end }}
13+
{{- if not .status.controlPlaneReady }}0{{- end }}
14+
{{- if not .status.infrastructureReady }}0{{- end }}
15+
{{- end -}}
16+
{{- if eq .kind "K3SCluster" -}}
17+
{{- if ne .status.phase "Provisioned" }}0{{- end }}
18+
{{- if not .status.ready }}0{{- end }}
19+
{{- end -}}
20+
{{- if eq .kind "K3SControlPlane" -}}
21+
{{- if ne .status.phase "Provisioned" }}0{{- end }}
22+
{{- if not .status.ready }}0{{- end }}
23+
{{- if not .status.initialized }}0{{- end }}
24+
{{- end -}}
25+
{{- if eq .kind "K3SRemoteMachine" -}}
26+
{{- if ne .status.phase "Installed" }}0{{- end }}
27+
{{- if not .status.ready }}0{{- end -}}
28+
{{- end -}}
29+
{{- if eq .kind "Machine" -}}
30+
{{- if not (or (eq .status.phase "Provisioned") (eq .status.phase "Running")) }}0{{- end }}
31+
{{- if not .status.infrastructureReady }}0{{- end }}
32+
{{- end -}}
33+
{{- end -}}
34+
'
35+
36+
COUNT=1
37+
while true; do
38+
STATUS="$(kubectl --namespace "${NAMESPACE}" get cluster-api \
39+
--selector "app.kubernetes.io/instance=${RELEASE_NAME}" \
40+
--output "go-template=${GO_TEMPLATE}")"
41+
if [[ "${STATUS}" != "" && "${COUNT}" -le "${LIMIT}" ]]; then
42+
sleep 1
43+
(( ++COUNT ))
44+
elif [[ "${COUNT}" -gt "${LIMIT}" ]]; then
45+
>&2 echo "Limit exceeded."
46+
exit 1
47+
else
48+
echo
49+
kubectl --namespace "${NAMESPACE}" get cluster-api --selector "app.kubernetes.io/instance=${RELEASE_NAME}"
50+
break
51+
fi
52+
done
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
readonly NAMESPACE="${1}"
6+
7+
kubectl delete namespace "${NAMESPACE}"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
readonly NAMESPACE="${1}"
6+
readonly RELEASE_NAME="${2}"
7+
readonly WAIT_FOR_CLUSTER_DELETION="${3:-false}"
8+
9+
kubectl --namespace "${NAMESPACE}" delete cluster-api --selector "app.kubernetes.io/instance=${RELEASE_NAME}" --wait="${WAIT_FOR_CLUSTER_DELETION}"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
readonly NAMESPACE="${1}"
6+
readonly RELEASE_NAME="${2}"
7+
readonly WAIT_FOR_CLUSTER_DELETION="${3:-false}"
8+
9+
kubectl --namespace "${NAMESPACE}" delete cluster-api --selector "app.kubernetes.io/instance=${RELEASE_NAME}" --wait="${WAIT_FOR_CLUSTER_DELETION}"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
readonly NAMESPACE="${1}"
6+
readonly RELEASE_NAME="${2}"
7+
readonly WAIT_FOR_CLUSTER_DELETION="${3:-false}"
8+
9+
kubectl --namespace "${NAMESPACE}" delete cluster-api --selector "app.kubernetes.io/instance=${RELEASE_NAME}" --wait="${WAIT_FOR_CLUSTER_DELETION}"
10+
11+
# Required for correct release removal of gcp-cluster via Helm
12+
sleep 3
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
readonly NAMESPACE="${1}"
6+
readonly RELEASE_NAME="${2}"
7+
readonly WAIT_FOR_CLUSTER_DELETION="${3:-false}"
8+
9+
kubectl --namespace "${NAMESPACE}" delete cluster-api --selector "app.kubernetes.io/instance=${RELEASE_NAME}" --wait="${WAIT_FOR_CLUSTER_DELETION}"

0 commit comments

Comments
 (0)