Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
flux2
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
fluxcd
flux2
Commits
0fc582d6
Unverified
Commit
0fc582d6
authored
3 years ago
by
Stefan Prodan
Browse files
Options
Downloads
Patches
Plain Diff
Add user stories for publishing and reconciling OCI artifacts
Signed-off-by:
Stefan Prodan
<
stefan.prodan@gmail.com
>
parent
c7a6ed53
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rfcs/kubernetes-oci/README.md
+90
-1
90 additions, 1 deletion
rfcs/kubernetes-oci/README.md
with
90 additions
and
1 deletion
rfcs/kubernetes-oci/README.md
+
90
−
1
View file @
0fc582d6
...
@@ -125,7 +125,96 @@ spec:
...
@@ -125,7 +125,96 @@ spec:
### User Stories
### User Stories
TODO
#### Story 1
> As a developer I want to publish my app Kubernetes manifests to the same GHCR registry
> where I publish my app containers.
First login to GHCR with Docker:
```
sh
docker login ghcr.io
-u
${
GITHUB_USER
}
-p
${
GITHUB_TOKEN
}
```
Build your app container image and push it to GHCR:
```
sh
docker build
-t
ghcr.io/org/my-app:v1.0.0
.
docker push ghcr.io/org/my-app:v1.0.0
```
Edit the app deployment manifest and set the new image tag.
Then push the Kubernetes manifests to GHCR:
```
sh
flux push artifact ghcr.io/org/my-app-config:v1.0.0
-f
./deploy
```
Sign the config image with cosign:
```
sh
cosign sign
--key
cosign.key ghcr.io/org/my-app-config:v1.0.0
```
#### Story 2
> As a developer I want to deploy my app using Kubernetes manifests published as OCI artifacts to GHCR.
First create a secret using a GitHub token that allows access to GHCR:
```
sh
kubectl create secret docker-registry my-app-regcred
\
--docker-server
=
ghcr.io
\
--docker-username
=
$GITHUB_USER
\
--docker-password
=
$GITHUB_TOKEN
```
Then create a secret with your cosgin public key:
```
sh
kubectl create secret generic my-app-cosgin-key
\
--from-file
=
cosign.pub
=
cosign/my-key.pub
```
Then define an
`OCIRepository`
to fetch and verify the latest app config version:
```
yaml
apiVersion
:
source.toolkit.fluxcd.io/v1beta2
kind
:
OCIRepository
metadata
:
name
:
app-config
namespace
:
default
spec
:
interval
:
10m
url
:
ghcr.io/org/my-app-config
ref
:
semver
:
"
1.x"
secretRef
:
name
:
my-app-regcred
verify
:
provider
:
cosign
secretRef
:
name
:
my-app-cosgin-key
```
And finally, create a Flux Kustomization to reconcile the app on the cluster:
```
yaml
apiVersion
:
kustomize.toolkit.fluxcd.io/v1beta2
kind
:
Kustomization
metadata
:
name
:
app
namespace
:
default
spec
:
interval
:
10m
sourceRef
:
kind
:
OCIRepository
name
:
app-config
path
:
./
prune
:
true
wait
:
true
timeout
:
2m
```
### Alternatives
### Alternatives
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment