-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(kraken): push to kube-manifests repository #147
base: master
Are you sure you want to change the base?
Changes from 1 commit
6782cb2
01ad54b
0547c72
bf486bf
34bd9af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,20 @@ export class DeployJob extends CheckoutJob { | |
runsOn: 'ubuntu-latest', | ||
if: `github.ref == 'refs/heads/${fullConfig.defaultBranch}'`, | ||
steps: [ | ||
{ | ||
name: 'Checkout kube-manifests', | ||
uses: 'actions/checkout@v2', | ||
with: { | ||
repository: 'pennlabs/kube-manifests', | ||
token: '${{ secrets.BOT_GITHUB_PAT }}', | ||
path: 'kube-manifests', | ||
} | ||
}, | ||
{ | ||
name: 'Configure git', | ||
run: dedent`git config --global user.name github-actions | ||
git config --global user.email github-actions[bot]@users.noreply.github.com"` | ||
}, | ||
{ | ||
id: 'synth', | ||
name: 'Synth cdk8s manifests', | ||
|
@@ -60,21 +74,14 @@ export class DeployJob extends CheckoutJob { | |
}, | ||
}, | ||
{ | ||
name: 'Deploy', | ||
run: dedent`aws eks --region us-east-1 update-kubeconfig --name production --role-arn arn:aws:iam::\${AWS_ACCOUNT_ID}:role/kubectl | ||
|
||
# get repo name from synth step | ||
RELEASE_NAME=\${{ steps.synth.outputs.RELEASE_NAME }} | ||
|
||
# Deploy | ||
kubectl apply -f k8s/dist/ -l app.kubernetes.io/component=certificate | ||
kubectl apply -f k8s/dist/ --prune -l app.kubernetes.io/part-of=$RELEASE_NAME`, | ||
env: { | ||
AWS_ACCOUNT_ID: '${{ secrets.AWS_ACCOUNT_ID }}', | ||
AWS_ACCESS_KEY_ID: '${{ secrets.GH_AWS_ACCESS_KEY_ID }}', | ||
AWS_SECRET_ACCESS_KEY: '${{ secrets.GH_AWS_SECRET_ACCESS_KEY }}', | ||
}, | ||
}, | ||
name: 'Push to kube-manifests repository', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can push manifests to another repo, but we should still keep & run the deployment steps:
Or did you plan for this to be ran as a part of the github actions for the Also, can you update the snapshots? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea behind this PR is migrating to use argocd to manage our deployments rather than manually kubectl applying to the cluster. We can push yaml files to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added the eks deploy step back in for now. It's likely easier to deploy to kube-manifests and kubectl deploying while the Argo deployment is getting ironed out and then removing the kubectl deploy step afterwards. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using both argo and the direct kubectl apply feels like we may end up with some weird race condition. It may make sense to remove the kubectl apply here,, finish the kittyhawk rollout, then migrate over to argo. |
||
run: dedent`cd kube-manifests | ||
mkdir -p \${{ github.repository }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we make a directory with I feel like the latter might make more sense since everything will be prefixed by pennlabs anyways. |
||
cp -r ../k8s/dist/ \${{ github.repository }} | ||
git add \${{ github.repository }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question here as above ^^ (since we either change both or keep both) |
||
git commit -m "chore(k8s): deploy $RELEASE_NAME" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a suggestion, but if we change the commit message to be something like "deploy pennlabs/repo-name@git-sha", we'll get a direct link to the commit that's being deployed. It might be a small QoL improvement. |
||
git push` | ||
} | ||
], | ||
...overrides, | ||
}); | ||
|
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.
RELEASE_NAME=\${{ steps.synth.outputs.RELEASE_NAME }}
is necessary to use the$RELEASE_NAME
env variable in thegit commit -m "chore(k8s): deploy $RELEASE_NAME"
line you addedThere 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.
Wups, thanks