Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Byoh integration #257

Merged
merged 4 commits into from
Oct 18, 2023
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
2 changes: 1 addition & 1 deletion git-repo/create-cluster-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ spec:
path: /mnt/out/infra_provider.txt
- name: managed_cluster
valueFrom:
default: "Something wrong"
default: "false"
path: /mnt/out/managed_cluster.txt

- name: createRepoCredential
Expand Down
19 changes: 11 additions & 8 deletions tks-cli/tks-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
- name: login-tks-api
container:
name: login-tks-api
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.3
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.4
envFrom:
- secretRef:
name: "tks-api-secret"
Expand All @@ -31,7 +31,7 @@ spec:
- name: description
container:
name: create-organization
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.3
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.4
envFrom:
- secretRef:
name: "tks-api-secret"
Expand Down Expand Up @@ -90,9 +90,10 @@ spec:
- name: description
- name: infra_conf
- name: cloud_service
- name: cluster_endpoint
container:
name: create-usercluster
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.3
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.4
envFrom:
- secretRef:
name: "tks-api-secret"
Expand All @@ -109,13 +110,15 @@ spec:
TKS_USER_NODE=$(echo "{{inputs.parameters.infra_conf}}" | jq -r '.tksUserNode')

CL_NAME="{{inputs.parameters.cluster_name}}"

echo "* Create $CL_NAME cluster"
tks cluster create ${CL_NAME} \
--stack-template-id "{{inputs.parameters.stack_template_id}}" \
--organization-id "{{inputs.parameters.organization_id}}" \
--cloud-account-id "{{inputs.parameters.cloud_account_id}}" \
--description "{{inputs.parameters.description}}" \
--cloud-service "{{inputs.parameters.cloud_service}}" \
--cluster-endpoint "{{inputs.parameters.cluster_endpoint}}" \
--stack 1 \
--tks-cp-node $TKS_CP_NODE \
--tks-infra-node $TKS_INFRA_NODE \
Expand Down Expand Up @@ -159,7 +162,7 @@ spec:
- name: organization_id
container:
name: install-usercluster
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.3
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.4
envFrom:
- secretRef:
name: "tks-api-secret"
Expand Down Expand Up @@ -212,7 +215,7 @@ spec:
- name: cluster_id
container:
name: delete-usercluster
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.3
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.4
envFrom:
- secretRef:
name: "tks-api-secret"
Expand Down Expand Up @@ -255,7 +258,7 @@ spec:
- name: description
container:
name: create-appgroup
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.3
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.4
envFrom:
- secretRef:
name: "tks-api-secret"
Expand Down Expand Up @@ -305,7 +308,7 @@ spec:
- name: appgroup_id
container:
name: delete-appgroup
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.3
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.4
envFrom:
- secretRef:
name: "tks-api-secret"
Expand Down Expand Up @@ -345,7 +348,7 @@ spec:
- name: name
container:
name: get-appgroup-id
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.3
image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.1.4
envFrom:
- secretRef:
name: "tks-api-secret"
Expand Down
21 changes: 4 additions & 17 deletions tks-cluster/create-usercluster-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ spec:
"target_cluster": ""
}
]
when: >-
{{steps.tks-create-cluster-repo.outputs.parameters.infra_provider}} != byoh &&
{{steps.tks-create-cluster-repo.outputs.parameters.managed_cluster}} == false
when: "{{steps.tks-create-cluster-repo.outputs.parameters.infra_provider}} != byoh"

- - name: install-addons-common
templateRef:
Expand All @@ -235,18 +233,6 @@ spec:
"namespace": "taco-system",
"target_cluster": ""
},
{
"app_group": "tks-cluster",
"path": "metrics-server",
"namespace": "kube-system",
"target_cluster": ""
},
{
"app_group": "tks-cluster",
"path": "cluster-autoscaler",
"namespace": "kube-system",
"target_cluster": ""
},
zugwan marked this conversation as resolved.
Show resolved Hide resolved
{
"app_group": "tks-cluster",
"path": "argo-rollouts",
Expand Down Expand Up @@ -318,7 +304,7 @@ spec:
value: |
[
{
"app_group": "tks-cluster-byoh",
"app_group": "tks-cluster",
"path": "local-path-provisioner",
"namespace": "taco-system",
"target_cluster": ""
Expand Down Expand Up @@ -405,6 +391,7 @@ spec:
;;

byoh)
kcp_count=$(kubectl get kcp -n $CLUSTER_ID $CLUSTER_ID | grep -v NAME | wc -l)
kubectl wait --for=condition=Available --timeout=600s kcp -n $CLUSTER_ID $CLUSTER_ID

KUBECONFIG_WORKLOAD=$(kubectl get secret -n $CLUSTER_ID $CLUSTER_ID-kubeconfig -o jsonpath="{.data.value}" | base64 -d)
Expand Down Expand Up @@ -482,7 +469,7 @@ spec:
EOF
kubectl --kubeconfig kubeconfig_workload apply -f sc-taco-storage.yaml
else
echo "Wrong AWS Cluster type!"
echo "Wrong Cluster type!"
exit 1
fi
cat <<< $TKS_KUBECONFIG_WORKLOAD > tks_kubeconfig_workload
Expand Down
4 changes: 4 additions & 0 deletions tks-stack/tks-stack-create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ spec:
value: "s3"
- name: base_repo_branch
value: develop
- name: cluster_endpoint
value: ""

templates:
- name: main
Expand Down Expand Up @@ -60,6 +62,8 @@ spec:
value: "{{workflow.parameters.infra_conf}}"
- name: cloud_service
value: "{{workflow.parameters.cloud_service}}"
- name: cluster_endpoint
value: "{{workflow.parameters.cluster_endpoint}}"

- - name: call-create-appgroup-for-LMA
templateRef:
Expand Down