Skip to content

Commit

Permalink
Merge pull request #146 from openinfradev/use_calico_operator
Browse files Browse the repository at this point in the history
use tigera-operator for calico installation
  • Loading branch information
ktkfree authored Mar 28, 2023
2 parents 06e5bca + 6e60aac commit e9c6f4b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 19 deletions.
38 changes: 34 additions & 4 deletions tks-cluster/create-usercluster-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ spec:
- - name: install-volumesnapshot-crds
template: install-volumesnapshot-crds

- - name: install-addons-common
- - name: install-addons-cni-crds
templateRef:
name: create-application
template: installApps
Expand All @@ -152,12 +152,42 @@ spec:
- name: list
value: |
[
{
{
"app_group": "tks-cluster",
"path": "kubernetes-addons",
"path": "tigera-operator-crds",
"namespace": "taco-system",
"target_cluster": ""
},
}
]
when: "{{steps.tks-create-cluster-repo.outputs.parameters.managed_cluster}} == false"

- - name: install-addons-cni
templateRef:
name: create-application
template: installApps
arguments:
parameters:
- name: list
value: |
[
{
"app_group": "tks-cluster",
"path": "tigera-operator",
"namespace": "taco-system",
"target_cluster": ""
}
]
when: "{{steps.tks-create-cluster-repo.outputs.parameters.managed_cluster}} == false"

- - name: install-addons-common
templateRef:
name: create-application
template: installApps
arguments:
parameters:
- name: list
value: |
[
{
"app_group": "tks-cluster",
"path": "ingress-nginx",
Expand Down
26 changes: 11 additions & 15 deletions tks-cluster/remove-usercluster-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,16 @@ spec:
- - name: deleteCalicoController
template: deleteCalicoController
arguments:
parameters:
- name: target_namespace
value: "kube-system"
when: "{{steps.findInfraProvider.outputs.parameters.managed_cluster}} == false"

- - name: deleteAddonsApp
- - name: deleteCniAddons
templateRef:
name: delete-apps
template: DeleteAppsByName
arguments:
parameters:
- name: app_name
value: "{{workflow.parameters.app_prefix}}-kubernetes-addons"
value: "{{workflow.parameters.app_prefix}}-tigera-operator"

- - name: deleteClusterCR
template: deleteClusterCR
Expand Down Expand Up @@ -256,9 +252,6 @@ spec:
fi
- name: deleteCalicoController
inputs:
parameters:
- name: target_namespace
container:
name: delete-calico
image: harbor-cicd.taco-cat.xyz/tks/hyperkube:v1.18.6
Expand All @@ -272,17 +265,20 @@ spec:
kube_params+="--kubeconfig=/etc/kubeconfig"
kubectl $kube_params get deployment -n ${TARGET_NAMESPACE} | grep calico-kube-controller
kubectl $kube_params get apiserver.v1.operator.tigera.io | grep default
if [[ $? =~ 0 ]]; then
kubectl $kube_params delete deployment calico-kube-controllers -n ${TARGET_NAMESPACE}
kubectl $kube_params delete apiserver.v1.operator.tigera.io default
else
echo "Error: installations.v1.operator.tigera.io 'default' was NOT found."
exit 1
kubectl $kube_params get installations.v1.operator.tigera.io | grep default
if [[ $? =~ 0 ]]; then
kubectl $kube_params delete installations.v1.operator.tigera.io default
else
echo "Error: deployment 'calico-kube-controllers' was NOT found."
echo "Error: installations.v1.operator.tigera.io 'default' was NOT found."
exit 1
fi
env:
- name: TARGET_NAMESPACE
value: "{{inputs.parameters.target_namespace}}"
- name: deleteClusterCR
inputs:
Expand Down

0 comments on commit e9c6f4b

Please sign in to comment.