-
Notifications
You must be signed in to change notification settings - Fork 13
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
Streamline k8s deploy process #3205
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
f191f01
feat(ci): streamline Kubernetes preview and deploy workflows
themightychris f482c85
fix(ci): apply diff formatting to markdown content
themightychris 02802ba
feat(ci): add support for including secret helm values when diffing
themightychris 72847d9
fix(ci): capture activeDeadlineSeconds already applied to cluster
themightychris 5edb2b1
fix(ci): configure sentry to use existing secret
themightychris 5d38e27
fix(ci): move diff newline
themightychris 7b1eb8c
fix(ci): remove sentry secrets that aren't needed
themightychris 1c62621
fix(ci): update workflow title
themightychris 1ae2bc4
fix(ci): bio download path
themightychris 09a8de0
fix(ci): configure git user
themightychris 34dad83
fix(ci): correct diff filename
themightychris 90a0d34
fix(ci): remove deprecated RELEASE_CHANNEL variable
themightychris 0c0e462
docs(ci): move k8s GitOps to kubernetes/README.md
themightychris d56e81b
docs(ci): fix header
themightychris aee3805
fix(ci): update holobranch name
themightychris 761a79d
fix(ci): delete workflow for cleaning up deprecated candidate branches
themightychris fd33f78
docs(ci): update github workflows docs
themightychris 6c75ed2
docs(ci): update hologit docs
themightychris 1279cc3
fix(ci): update workflow step name
themightychris d8aa877
fix(ci): exclude hooks from helm diff
themightychris 865b0c3
fix(docs): update links to gitops
themightychris c5383b8
fix(ci): update path filters for new workflows
themightychris 20e7d16
docs(ci): add warnings about diff limitations
themightychris 8007660
feat(ci): add deploy-kubernetes workflow
themightychris a508bf2
chore(ci): delint inline comments
themightychris 0d557cc
chore(ci): delint trailing comma
themightychris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Generate diff of Kubernetes changes | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- '.holo/config.toml' | ||
- '.holo/sources/jarvus-cluster-template.toml' | ||
- '.holo/branches/releases/**' | ||
- '.github/workflows/*-kubernetes.yml' | ||
- 'ci/**' | ||
- 'kubernetes/apps/**' | ||
- 'kubernetes/system/**' | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} | ||
|
||
jobs: | ||
preview-kubernetes: | ||
runs-on: ubuntu-latest | ||
env: | ||
CLOUDSDK_CORE_PROJECT: cal-itp-data-infra | ||
GKE_NAME: data-infra-apps | ||
GKE_REGION: us-west1 | ||
USE_GKE_GCLOUD_AUTH_PLUGIN: True | ||
steps: | ||
# Setup | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: 'google-github-actions/auth@v2' | ||
with: | ||
credentials_json: '${{ secrets.GCP_SA_KEY }}' | ||
- uses: google-github-actions/setup-gcloud@v2 | ||
- run: gcloud components install gke-gcloud-auth-plugin | ||
- uses: google-github-actions/get-gke-credentials@v1 | ||
with: | ||
cluster_name: ${{ env.GKE_NAME }} | ||
location: ${{ env.GKE_REGION }} | ||
- run: curl -sSL https://install.python-poetry.org | python - | ||
- name: Set up hologit | ||
env: | ||
BIO_RELEASE: 1.6.821 | ||
run: | | ||
curl -LO "https://github.com/biome-sh/biome/releases/download/v${BIO_RELEASE}/bio-${BIO_RELEASE}-x86_64-linux.tar.gz" | ||
tar xzvf "bio-${BIO_RELEASE}-x86_64-linux.tar.gz" | ||
sudo mv bio /usr/local/bin/bio | ||
sudo bio pkg install --binlink jarvus/hologit | ||
|
||
git config user.name "Github Action $GITHUB_JOB" | ||
git config user.email "$(whoami)@$(uname -n)" | ||
|
||
# Render Kubernetes content with parent underlay and checkout | ||
- run: git holo project kubernetes-workspace --commit-to=kubernetes | ||
- run: git checkout kubernetes | ||
|
||
# Diff and write back to PR | ||
- id: diff | ||
name: Run poetry invoke | ||
shell: bash | ||
working-directory: ci | ||
run: | | ||
poetry install | ||
poetry run invoke secrets -f "./channels/prod.yaml" | ||
poetry run invoke release -f "./channels/prod.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...anches/release-candidate/_data-infra.toml → ...hes/kubernetes-workspace/_data-infra.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[holomapping] | ||
files = [ "ci/**", "kubernetes/apps/**", "kubernetes/system/**", ".github/workflows/service-*" ] | ||
files = [ "ci/**", "kubernetes/apps/**", "kubernetes/system/**", ".github/workflows/*-kubernetes.yml" ] | ||
before = "*" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to fork a version of this into Cal-ITP controlled space eventually - probably not actionable right this second, but worth creating a follow-up Issue for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm not sure about the best strategy there. This is a repository we actively maintain for many public/community/client consumers. Cal-ITP is pinned to a specific tagged version and it's a public open repo so it's ensured to stay static until someone bumps to a newer version. Eventually dependencies will need to be updated and at that point whoever is maintaining the infra can either fork the template or bump up to a new version. Most likely Jarvus will have already tested and documented the upgrade path to newer dependency mixes.
While there is a goal to minimize Jarvus dependencies, the project is depending on a lot of random public/community GitHub repositories for lots of things like GitHub actions and helm charts and it would be an anti-pattern to go through and fork every dependency. In cases where a Jarvus repository is linked that's just a fork of something else or a single-use repository, I'd agree with prioritizing eliminating that external dependency, but in this case this is a first-class maintained community project so I'm not sure it makes sense as a goal to just fork it into ITP preemptively
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SorenSpicknall That said it would be a good issue to search for "Jarvus" throughout the codebase and make sure if any forks of community repos are being linked against, we're doing work to get any needed patches moved upstream so we can move the link back to targeting the upstream directly