diff --git a/dockerfiles/Dockerfile.e2e-test b/dockerfiles/Dockerfile.e2e-test index 703f349a..2df7cd18 100644 --- a/dockerfiles/Dockerfile.e2e-test +++ b/dockerfiles/Dockerfile.e2e-test @@ -15,6 +15,10 @@ COPY tks /usr/local/bin/tks RUN curl -Lo /usr/bin/kubectl "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" RUN chmod +x /usr/bin/kubectl +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo +RUN sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo +RUN sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo + RUN yum install -y epel-release RUN yum install -y jq diff --git a/tks-cli/tks-cli.yaml b/tks-cli/tks-cli.yaml index d95162c6..53ac1f46 100644 --- a/tks-cli/tks-cli.yaml +++ b/tks-cli/tks-cli.yaml @@ -12,7 +12,7 @@ spec: - name: login-tks-api container: name: login-tks-api - image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.0 + image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.1 envFrom: - secretRef: name: "tks-api-secret" @@ -31,7 +31,7 @@ spec: - name: description container: name: create-organization - image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.0 + image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.1 envFrom: - secretRef: name: "tks-api-secret" @@ -92,9 +92,10 @@ spec: - name: cloud_service - name: cluster_endpoint - name: policy_ids + - name: cluster_domains container: name: create-usercluster - image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.0 + image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.1 envFrom: - secretRef: name: "tks-api-secret" @@ -120,6 +121,7 @@ spec: --description "{{inputs.parameters.description}}" \ --cloud-service "{{inputs.parameters.cloud_service}}" \ --cluster-endpoint "{{inputs.parameters.cluster_endpoint}}" \ + --domains "{{inputs.parameters.cluster_domains}}" \ --stack 1 \ --tks-cp-node $TKS_CP_NODE \ --tks-infra-node $TKS_INFRA_NODE \ @@ -164,7 +166,7 @@ spec: - name: organization_id container: name: install-usercluster - image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.0 + image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.1 envFrom: - secretRef: name: "tks-api-secret" @@ -217,7 +219,7 @@ spec: - name: cluster_id container: name: delete-usercluster - image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.0 + image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.1 envFrom: - secretRef: name: "tks-api-secret" @@ -260,7 +262,7 @@ spec: - name: description container: name: create-appgroup - image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.0 + image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.1 envFrom: - secretRef: name: "tks-api-secret" @@ -310,7 +312,7 @@ spec: - name: appgroup_id container: name: delete-appgroup - image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.0 + image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.1 envFrom: - secretRef: name: "tks-api-secret" @@ -350,7 +352,7 @@ spec: - name: name container: name: get-appgroup-id - image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.0 + image: harbor.taco-cat.xyz/tks/tks-e2e-test:v3.2.1 envFrom: - secretRef: name: "tks-api-secret" diff --git a/tks-cluster/create-usercluster-wftpl.yaml b/tks-cluster/create-usercluster-wftpl.yaml index f96c96f3..9fb81f55 100644 --- a/tks-cluster/create-usercluster-wftpl.yaml +++ b/tks-cluster/create-usercluster-wftpl.yaml @@ -116,6 +116,16 @@ 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_domains + value: "{{steps.tks-get-cluster-info.outputs.parameters.cluster_domains}}" + - 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: @@ -839,3 +849,48 @@ spec: value: "cluster-admin-delete" - name: group_list value: '["cluster-admin-delete"]' + + - name: create-endpoint-secret + inputs: + parameters: + - name: cluster_domains + - 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}} + + GRAFANA_URL=$(echo $CLUSTER_DOMAINS | jq -r '. | map(select(.domainType | contains("grafana"))|.url)'[]) + LOKI_URL=$(echo $CLUSTER_DOMAINS | jq -r '. | map(select(.domainType | contains("loki"))|.url)'[]) + MINIO_URL=$(echo $CLUSTER_DOMAINS | jq -r '. | map(select(.domainType | contains("minio"))|.url)'[]) + PROMETHEUS_URL=$(echo $CLUSTER_DOMAINS | jq -r '. | map(select(.domainType | contains("prometheus"))|.url)'[]) + THANOS_URL=$(echo $CLUSTER_DOMAINS | jq -r '. | map(select(.domainType | contains("thanos"))|.url)'[]) + KIALI_URL=$(echo $CLUSTER_DOMAINS | jq -r '. | map(select(.domainType | contains("kiali"))|.url)'[]) + JAEGER_URL=$(echo $CLUSTER_DOMAINS | jq -r '. | map(select(.domainType | contains("jaeger"))|.url)'[]) + + cat < tks-endpoint-secret.yaml + --- + apiVersion: v1 + kind: Secret + metadata: + name: tks-endpoint-secret + namespace: ${CLUSTER_ID} + data: + grafana: $(echo ${GRAFANA_URL} | base64) # 30001 + loki: $(echo ${LOKI_URL} | base64) # 30002 + minio: $(echo ${MINIO_URL} | base64) # 30003 + prometheus: $(echo ${PROMETHEUS_URL} | base64) # 30004 + thanos: $(echo ${THANOS_URL} | base64) # 30005 (queryfrontend만 합시다...) + kiali: $(echo ${KIALI_URL} | base64) # 30011 + jaeger: $(echo ${JAEGER_URL} | base64) # 30012 + EOF + kubectl apply -f tks-endpoint-secret.yaml + env: + - name: CLUSTER_DOMAINS + value: "{{inputs.parameters.cluster_domains}}" + + activeDeadlineSeconds: 30 diff --git a/tks-stack/tks-stack-create.yaml b/tks-stack/tks-stack-create.yaml index 884626b2..00992013 100644 --- a/tks-stack/tks-stack-create.yaml +++ b/tks-stack/tks-stack-create.yaml @@ -33,6 +33,8 @@ spec: value: "" - name: policy_ids value: "" + - name: cluster_domains + value: "" templates: - name: main @@ -68,6 +70,8 @@ spec: value: "{{workflow.parameters.cluster_endpoint}}" - name: policy_ids value: "{{workflow.parameters.policy_ids}}" + - name: cluster_domains + value: "{{workflow.parameters.cluster_domains}}" - - name: call-create-appgroup-for-LMA templateRef: diff --git a/tks_info/get-tks-cluster-wftpl.yaml b/tks_info/get-tks-cluster-wftpl.yaml index df7326f3..6def5d97 100644 --- a/tks_info/get-tks-cluster-wftpl.yaml +++ b/tks_info/get-tks-cluster-wftpl.yaml @@ -21,6 +21,9 @@ spec: - name: cluster_type valueFrom: path: /mnt/out/cluster_type.txt + - name: cluster_domains + valueFrom: + path: /mnt/out/cluster_domains.txt volumes: - name: out emptyDir: {} @@ -67,6 +70,7 @@ spec: print(res.text) clusterSiteValues = res.json()['clusterSiteValues'] + clusterDomains = clusterSiteValues['domains'] with open("/mnt/out/cluster_info.txt", "w") as f: #cluster_conf = str(clusterSiteValues) @@ -77,3 +81,7 @@ spec: cluster_type = clusterSiteValues['clusterType'] print(cluster_type) f.write(cluster_type) + with open("/mnt/out/cluster_domains.txt", "w") as f: + cluster_domains = json.dumps(clusterDomains) + print(cluster_domains) + f.write(cluster_domains)