Skip to content

Commit

Permalink
Merge pull request #322 from openinfradev/remove_endpoint_secret
Browse files Browse the repository at this point in the history
feture. remove creating tks-endpoint-secret
  • Loading branch information
zugwan authored Nov 13, 2023
2 parents 7bceb1a + 7337ab2 commit 3752985
Showing 1 changed file with 7 additions and 52 deletions.
59 changes: 7 additions & 52 deletions tks-cluster/create-usercluster-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,6 @@ spec:
]
when: "{{steps.tks-create-cluster-repo.outputs.parameters.infra_provider}} == byoh"

- - name: tks-create-config-secret
template: create-endpoint-secret
arguments:
parameters:
- name: cluster_info
value: "{{steps.tks-get-cluster-info.outputs.parameters.cluster_info}}"
- name: cluster_id
value: "{{ workflow.parameters.cluster_id }}"
when: "{{steps.tks-create-cluster-repo.outputs.parameters.infra_provider}} == byoh"

- - name: init-cluster-for-tks
template: init-cluster-for-tks
arguments:
Expand Down Expand Up @@ -222,6 +212,10 @@ spec:
]
when: "{{steps.tks-create-cluster-repo.outputs.parameters.managed_cluster}} == false"

- - name: suspend
template: suspend
when: "{{steps.tks-create-cluster-repo.outputs.parameters.infra_provider}} == byoh"

- - name: install-cluster-autoscaler
templateRef:
name: create-application
Expand Down Expand Up @@ -403,6 +397,9 @@ spec:
#######################
# Template Definition #
#######################
- name: suspend
suspend: {}

- name: init-cluster-for-tks
inputs:
parameters:
Expand Down Expand Up @@ -706,45 +703,3 @@ spec:
kubectl --kubeconfig kubeconfig_temp apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml -n kube-system
kubectl --kubeconfig kubeconfig_temp apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/master/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml -n kube-system
- name: create-endpoint-secret
inputs:
parameters:
- name: cluster_info
- name: cluster_id
container:
name: create-namespace
image: harbor.taco-cat.xyz/tks/hyperkube:v1.18.6
command:
- /bin/bash
- '-c'
- |
CLUSTER_ID={{inputs.parameters.cluster_id}}
CLUSTER_IP=$(echo $CLUSTER_INFO | jq -r '.byoClusterEndpointHost')
if [ "$CLUSTER_IP" = "" ]; then
echo "ERROR::Endpoint for the cluster is not given!!!"
exit -1
fi
cat <<EOF > tks-endpoint-secret.yaml
---
apiVersion: v1
kind: Secret
metadata:
name: tks-endpoint-secret
namespace: ${CLUSTER_ID}
data:
grafana: $(echo ${CLUSTER_IP}:30001 | base64) # 30001
loki: $(echo ${CLUSTER_IP}:30002 | base64) # 30002
minio: $(echo ${CLUSTER_IP}:30003 | base64) # 30003
prometheus: $(echo ${CLUSTER_IP}:30004 | base64) # 30004
thanos: $(echo ${CLUSTER_IP}:30005 | base64) # 30005 (queryfrontend만 합시다...)
kiali: $(echo ${CLUSTER_IP}:30011 | base64) # 30011
jaeger: $(echo ${CLUSTER_IP}:30012 | base64) # 30012
EOF
kubectl apply -f tks-endpoint-secret.yaml
env:
- name: CLUSTER_INFO
value: "{{inputs.parameters.cluster_info}}"

activeDeadlineSeconds: 30

0 comments on commit 3752985

Please sign in to comment.