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

Primary cluster 생성을 위한 workflow template 추가 #151

Merged
merged 9 commits into from
Apr 6, 2023

Conversation

intelliguy
Copy link
Contributor

@intelliguy intelliguy commented Apr 5, 2023

내부적으로 기존 lma 설치로직에서 호출하며 각 수정은 다음을 포함한다.

tks-lma-federation

  • 자신의 조직(org)의 현황에 따라 분기 필요
  • 없으면 자기가 primary가 되야 하고 set-primary-cluster 호출
  • 이미 primary가 있다면 자신의 설정 중 loki 부분을 변경해야 함

tks-primary-cluster

  • 입력 파라미터는
    • primary_cluster
    • member_clusters
  • 활용하는 workflow변수는
    • organization_id
    • cluster id
    • tks_info_host
  • 일단 상태관련 내역은 추후로 미뤄두고 → 이건 state machine 정의하고 컨세서스 이룬후 진행하는 것이 맞음 (현재 상태는 echo만)
  • 들어오면 namespace 만들어주고
  • sub-set-primay-cluster-on-tks-info
    • tks-info에 자신을 등록하고.
  • sub-change-logging-target
    • 필요한 endpoint를 primary에서 구해내고
    • 상황에 맞게 update 수행
    • 입력변수로 primay_cluster와 member_clusters를 받는데 member_clusters를 조절함으로써 primary가 정해진 상황에서 만들어지는 클러스터에서도 해당 함수를 활용
      • tks-lma-federation에서 다음 함수 참조
      - - name: organization-level-update
              template: primayCluster
              arguments:
                parameters:
                - name: primary_cluster
                  value: '{{steps.get-clusters-in-contract.outputs.parameters.primary_cluster}}'
                - name: member_clusters
                  value: '{{workflow.parameters.cluster_id}}'
              when: "{{steps.get-clusters-in-contract.outputs.parameters.primary_cluster}} != null && {{workflow.parameters.cluster_id}} != {{steps.get-clusters-in-contract.outputs.parameters.primary_cluster}}"

@gitguardian
Copy link

gitguardian bot commented Apr 5, 2023

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id Secret Commit Filename
6177710 GitHub Access Token b1a684d deploy_apps/tks-primary-cluster.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@intelliguy intelliguy force-pushed the primary_cluster branch 3 times, most recently from aeed3b8 to 4c6989b Compare April 5, 2023 23:45
@intelliguy intelliguy changed the title WIP) Primary cluster 생성을 위한 workflow template 추가 Primary cluster 생성을 위한 workflow template 추가 Apr 6, 2023
@intelliguy
Copy link
Contributor Author

마지막 commit만 변경내역입니다.
앞의 내용들은 rest 작업 관련하여 별도의 pr이 될듯 합니다.
따라서 최종 merge는 앞의 내역이 완료된 후 수행합니다.

@ktkfree
Copy link
Contributor

ktkfree commented Apr 6, 2023

@intelliguy
아래와 같은 lint 에러가 발생합니다.
✖ in "tks-primary-cluster" (WorkflowTemplate): templates.set-primary-cluster.steps[2].change-target templates.sub-change-logging-target: failed to resolve {{workflow.parameters.github_account}}

@intelliguy
Copy link
Contributor Author

@intelliguy
아래와 같은 lint 에러가 발생합니다.
✖ in "tks-primary-cluster" (WorkflowTemplate): templates.set-primary-cluster.steps[2].change-target templates.sub-change-logging-target: failed to resolve {{workflow.parameters.github_account}}

위에꺼 해결하고나니 decapod-flow에서 발생한 것과 동일한 lint error를 만나네요

@intelliguy intelliguy merged commit 14dfca5 into main Apr 6, 2023
@intelliguy intelliguy deleted the primary_cluster branch April 6, 2023 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants