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

[RFC-0003] Add commands for managing OCI artifacts #2856

Merged
merged 33 commits into from
Aug 11, 2022
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e927d39
Add OCI internal package
stefanprodan Jun 21, 2022
9503eca
Add artifact commands
stefanprodan Jun 21, 2022
12a491f
Update controllers to OCI preview images
stefanprodan Jun 22, 2022
2d8db4f
Implement OCIRepository commands
stefanprodan Jun 22, 2022
2f35367
Add list artifacts command
stefanprodan Jun 23, 2022
e4fb8e7
Add e2e tests for artifact commands
stefanprodan Jun 23, 2022
b6a78f4
Update SC with OCI semver support
stefanprodan Jun 23, 2022
30e5389
Run e2e tests for PRs against oci branch
stefanprodan Jul 1, 2022
adc7981
Add tests for source oci command
somtochiama Jun 30, 2022
8049634
Add `oci://` prefix
stefanprodan Jul 6, 2022
6b98590
Add `--cert-ref` to `flux create source oci`
stefanprodan Jul 8, 2022
7dd7369
Use OCI standard annotations
stefanprodan Jul 11, 2022
1b327e9
Show artifact digest in list output
stefanprodan Jul 11, 2022
3e15e83
Add test for tag/list/build/pull/push artifacts
somtochiama Jul 8, 2022
b78bbd5
fill test files
somtochiama Jul 8, 2022
9e76787
working golden files
somtochiama Jul 11, 2022
009413a
Add test for annotations
somtochiama Jul 11, 2022
030b6bc
Update source-controller with OCI metadata
stefanprodan Jul 13, 2022
8031045
Add `make build-dev` command
stefanprodan Jul 13, 2022
70d30fd
Update golden files to latest digest
stefanprodan Jul 13, 2022
4c576bf
Add create oci secret command
somtochiama Jul 18, 2022
fe4b659
Update cli description
somtochiama Jul 19, 2022
fcd38c9
Fix cli description
somtochiama Jul 19, 2022
41aac68
Add link to kubectl repo
somtochiama Jul 19, 2022
69e26ca
Pull artifact not push artifact
Aug 2, 2022
08401f6
Add OCI provider arg
stefanprodan Aug 3, 2022
7c7e76f
Use fluxcd/pkg/oci/client
stefanprodan Aug 3, 2022
ac9b3d1
Update controllers with OCI support
stefanprodan Aug 8, 2022
d4718f6
Improve artifact commands docs
stefanprodan Aug 9, 2022
d4c5a13
Add examples for pushing artifacts with GH Actions
stefanprodan Aug 9, 2022
75a879c
OCI docs improvements
stefanprodan Aug 10, 2022
b810aea
Make `flux trace` work with OCIRepository
makkes Aug 10, 2022
7e2d235
Merge pull request #2971 from fluxcd/trace-ocirepo
makkes Aug 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 81 additions & 1 deletion action/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You can download a specific version with:
- name: Setup Flux CLI
uses: fluxcd/flux2/action@main
with:
version: 0.8.0
version: 0.32.0
```

### Automate Flux updates
Expand Down Expand Up @@ -74,6 +74,86 @@ jobs:
${{ steps.update.outputs.flux_version }}
```

### Push Kubernetes manifests to container registries

Example workflow for publishing Kubernetes manifests bundled as OCI artifacts to GitHub Container Registry:

```yaml
name: push-artifact-staging

on:
push:
branches:
- 'main'

permissions:
packages: write # needed for ghcr.io access

env:
OCI_REPO: "oci://ghcr.io/my-org/manifests/${{ github.event.repository.name }}"
stefanprodan marked this conversation as resolved.
Show resolved Hide resolved

jobs:
kubernetes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
stefanprodan marked this conversation as resolved.
Show resolved Hide resolved
- name: Setup Flux CLI
uses: fluxcd/flux2/action@main
- name: Generate manifests
run: |
kustomize build ./manifests/staging > ./deploy/app.yaml
stefanprodan marked this conversation as resolved.
Show resolved Hide resolved
- name: Push manifests
run: |
flux push artifact $OCI_REPO:$(git rev-parse --short HEAD) \
--path="./deploy" \
--source="$(git config --get remote.origin.url)" \
--revision="$(git branch --show-current)/$(git rev-parse HEAD)"
- name: Deploy manifests to staging
run: |
flux tag artifact $OCI_REPO:$(git rev-parse --short HEAD) --tag staging
```

Example workflow for publishing Kubernetes manifests bundled as OCI artifacts to Docker Hub:

```yaml
name: push-artifact-production

on:
push:
tags:
- '*'

env:
OCI_REPO: "oci://docker.io/my-org/app-config"

jobs:
kubernetes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
stefanprodan marked this conversation as resolved.
Show resolved Hide resolved
- name: Setup Flux CLI
uses: fluxcd/flux2/action@main
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
stefanprodan marked this conversation as resolved.
Show resolved Hide resolved
- name: Generate manifests
run: |
kustomize build ./manifests/production > ./deploy/app.yaml
- name: Push manifests
run: |
flux push artifact $OCI_REPO:$(git tag --points-at HEAD) \
--path="./deploy" \
--source="$(git config --get remote.origin.url)" \
--revision="$(git tag --points-at HEAD)/$(git rev-parse HEAD)"
- name: Deploy manifests to production
run: |
flux tag artifact $OCI_REPO:$(git tag --points-at HEAD) --tag production
```

### End-to-end testing

Example workflow for running Flux in Kubernetes Kind:
Expand Down