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

Provision cluster and bootstrap flux #6

Closed
wants to merge 30 commits into from

Conversation

rossf7
Copy link
Contributor

@rossf7 rossf7 commented Nov 7, 2023

This is provisions the Equinix infra using OpenTofu and K3s and bootstraps Flux.

These secrets need to be added to the repo.

  • AWS_ACCESS_KEY_ID for S3 bucket to store state
  • AWS_SECRET_ACCESS_KEY
  • EQUINIX_AUTH_TOKEN the Equinix project API key
  • EQUINIX_PROJECT_ID the Equinix project ID
  • FLUX_GITHUB_TOKEN the GitHub token used to bootstrap Flux
  • K3S_TOKEN the K3s token for joining nodes
  • SSH_PUBLIC_KEY added as an Equinix project SSH key
  • SSH_PRIVATE_KEY needed so tofu can access nodes

Issue

@leonardpahlke
Copy link
Member

leonardpahlke commented Nov 16, 2023

@nikimanoledaki has now access to add repo secrets

@nikimanoledaki
Copy link
Contributor

nikimanoledaki commented Dec 14, 2023

I'm going to pre-empt a review comment already - could you enable GPG so that signed commits are verified and then rebase, please? Thank you!

@dipankardas011
Copy link
Contributor

I am using gpg keys but not sure why its not giving a verified tag in every commit?

@rossf7 rossf7 marked this pull request as ready for review December 14, 2023 13:46
@rossf7 rossf7 marked this pull request as draft December 14, 2023 13:46
@rossf7
Copy link
Contributor Author

rossf7 commented Dec 14, 2023

I am using gpg keys but not sure why its not giving a verified tag in every commit?

I'm also using gpg keys so not sure either. This is still blocked on the S3 bucket but we're getting closer.

Once access is sorted will rebase or even create a new branch and cherry pick to have cleaner history.

@nikimanoledaki
Copy link
Contributor

Yes, nearly there! 🤞 Ross, cp sounds good 👍
Could it be a mismatch with the email address used to sign the commit vs the one used for the gpg key? 🤔

@rossf7 rossf7 changed the title WIP: Provision cluster with OpenTofu and K3s Provision cluster and bootstrap flux Dec 20, 2023
@rossf7 rossf7 marked this pull request as ready for review December 20, 2023 11:44
rossf7 and others added 9 commits December 20, 2023 13:07
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

* Provision cluster with OpenTofu

Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>

* feat: Remove ansible and add worker node

Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>

* fix: Add -enable to tofu init

Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>

* fix: User data

* first iteration adding k3s for k8s clusters bootstrap

todo: need to test the script

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

* comment to point out where is the kubeconfig

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

* added var for k3s.version

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

* removed deps for k3s agent token to use terraform/random

NOTE: value will be added via env vars

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

---------

Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>
Co-authored-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
workerplane vm depend on controlplane vm's k3s.service to be running

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
used cilium cli

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>
Co-authored-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
@rossf7
Copy link
Contributor Author

rossf7 commented Dec 20, 2023

@nikimanoledaki @dipankardas011 I've rebased and edited all commits so they are signed.

Copy link
Contributor

@dipankardas011 dipankardas011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice ready for merge 👍🏼

dipankardas011 and others added 3 commits January 9, 2024 12:15
Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

now kepler serviceMonitor is visible to promtheus

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

removed the kube-prometheus fluxcd manifest refer pr cncf-tags#12

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>

refactored the comments in the manifest

Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>
Co-authored-by: Ross Fairbanks <rossf7@users.noreply.github.com>
Co-authored-by: Niki Manoledaki <niki.manoledaki@grafana.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
@rossf7
Copy link
Contributor Author

rossf7 commented Jan 9, 2024

I made some "final final" changes and renamed some of the vars. The PR description is updated with the new secret names.

Just needs the S3 bucket and then the secrets can be added and this can be merged.

FYI @nikimanoledaki @dipankardas011

Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
nikimanoledaki and others added 17 commits January 19, 2024 12:45
Signed-off-by: nikimanoledaki <niki.manoledaki@grafana.com>
Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>
Signed-off-by: Dipankar Das <dipankardas0115@gmail.com>
Signed-off-by: Antonio Di Turi <anto.dituri@gmail.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
Signed-off-by: nikimanoledaki <niki.manoledaki@grafana.com>
Signed-off-by: nikimanoledaki <niki.manoledaki@grafana.com>
Signed-off-by: nikimanoledaki <niki.manoledaki@grafana.com>
Signed-off-by: nikimanoledaki <niki.manoledaki@grafana.com>
Signed-off-by: Ross Fairbanks <ross@rossfairbanks.com>
@rossf7
Copy link
Contributor Author

rossf7 commented Jan 19, 2024

Going to create a fresh branch and cp to clean the history a bit. Please ignore for now. 🙏

@rossf7
Copy link
Contributor Author

rossf7 commented Jan 19, 2024

Closing in favor of #28

@rossf7 rossf7 closed this Jan 19, 2024
@rossf7 rossf7 deleted the wip-opentofu-spike branch January 19, 2024 12:02
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.

[Action] Bootstrap Kubernetes cluster with IaC tooling
6 participants