-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from openinfradev/TACODEV-909_bugfix
TACODEV-909: integrate postjobs, update version and so on
- Loading branch information
Showing
10 changed files
with
89 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
README.md | ||
artifacts/Dockerfile | ||
artifacts/helm | ||
artifacts/gh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# cluster-api-aws | ||
This chart creates a kubernetes resource for the Cluster API for AWS (CAPA). | ||
Since CAPA implementation is not a fully supported specification, this chart also includes several workaround tasks. | ||
There are also some useful features, such as cluster registration of argocd servers. | ||
|
||
## Resouce List | ||
- AWSCluster | ||
- AWSMachineTemplate | ||
- Cluster | ||
- ConfigMap | ||
- Job | ||
- Job-post | ||
- KubeadmControlPlane | ||
- RoleBinding | ||
- Role | ||
- ServiceAccount | ||
|
||
## Job List | ||
- CheckJob: Wait until kubconfig of the new cluster is created. | ||
- PostJob: Depend on the configured value, create machine pools, set labels, and register to the argocd server. | ||
|
||
## Configuration | ||
|
||
|Parameter|Description|Default| | ||
|---|---|---| | ||
|sshKeyName|sshkey to use to access the VMs|default| | ||
|cluster.name|cluster name|capi-quickstart| | ||
|cluster.region|cluster region|ap-northeast-2| | ||
|cluster.kubernetesVersion|kubernetes version|v1.18.16| | ||
|cluster.bastion.enabled|whether or not to use bastion for the cluster|false| | ||
|kubeadmControlPlane.replicas|the number of masters|3| | ||
|machinePool|define machinepools as a worker node, see annoations in the value file|[]| | ||
|machineDeployment.enabled|whether or not to use a machine deployment|false| | ||
|job.taconode.enabled|whether or not to initialize nodes for taco|false| | ||
|job.argo.enabled|whether or not to register to the argocd server|false| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,40 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
# echo "> Wait for awsmachinepoool $1-$2-mp-0 generated" | ||
# while [ $(kubectl get awsmachinepool -n $3 $1-$2-mp-0 --ignore-not-found | wc -l) == 0 ] | ||
# do | ||
# echo "> Wait for awsmachinepools deployed (20s)" | ||
# sleep 20 | ||
# done | ||
# kubectl wait awsmachinepool -n $3 $1-$2-mp-0 --for condition=Ready=true --timeout=600s | ||
# if taconode is set | ||
if [ $4 = 'true' ]; then | ||
echo "> Wait for machinepoool $1-$2-mp-0 generated" | ||
while [ $(kubectl get machinepool -n $3 $1-$2-mp-0 --ignore-not-found | wc -l) == 0 ] | ||
do | ||
echo "> Wait for machinepools deployed (60s)" | ||
sleep 60 | ||
done | ||
|
||
echo "> Wait for machinepoool $1-$2-mp-0 generated" | ||
while [ $(kubectl get machinepool -n $3 $1-$2-mp-0 --ignore-not-found | wc -l) == 0 ] | ||
do | ||
echo "> Wait for machinepools deployed (30s)" | ||
sleep 30 | ||
done | ||
replicas=$( kubectl get machinepool -n $3 $1-$2-mp-0 -o jsonpath='{.spec.replicas}' ) | ||
while [ $(kubectl get machinepool -n $3 $1-$2-mp-0 -o=jsonpath='{.status.nodeRefs}'|jq|grep uid|wc -l) != $replicas ] | ||
do | ||
echo "> Wait for instance is ready (20s)" | ||
sleep 20 | ||
done | ||
|
||
TACO_MP_REPLICAS=$(kubectl get mp -n $3 $1-$2-mp-0 -o=jsonpath='{.spec.replicas}') | ||
for node in $(kubectl get machinepool -n $3 $1-$2-mp-0 -o=jsonpath='{.status.nodeRefs}'|jq | grep '"name":'| awk -F \" '{print $4}') | ||
do | ||
kubectl --kubeconfig=/kube.config label node $node taco-lma=enabled taco-ingress-gateway=enabled taco-egress-gateway=enabled servicemesh=enabled --overwrite | ||
done | ||
|
||
while [ $(kubectl get machinepool -n $3 $1-$2-mp-0 -o=jsonpath='{.status.nodeRefs}' | wc -c) != $TACO_MP_REPLICAS ] | ||
do | ||
echo "> Wait for instance is ready (20s)" | ||
sleep 20 | ||
done | ||
cat <<EOF >/taco-system.yaml | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
name: taco-system | ||
name: taco-system | ||
EOF | ||
|
||
./node_label.py $1 $2 $3 | ||
kubectl --kubeconfig=/kube.config apply -f /taco-system.yaml | ||
fi | ||
|
||
kubectl --kubeconfig=/kube.config create ns taco-system | ||
kubectl --kubeconfig=/kube.config label ns taco-system name=taco-system | ||
# if argo-registeration is set | ||
if [ $5 = 'true' ]; then | ||
/argo-register.sh $1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters