Getting Started
Getting Started
Deploy your first application with Kuberik. This guide assumes you have a cluster with FluxCD and Kuberik installed.
Configure Image Automation
Tell Flux where to find your container images.
image-automation.yaml
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageRepository
metadata:
name: hello-world-app
namespace: flux-system
spec:
image: ghcr.io/kuberik/hello-world/app
interval: 60s
---
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImagePolicy
metadata:
name: hello-world-app
namespace: flux-system
spec:
imageRepositoryRef:
name: hello-world-app
policy:
semver:
range: ">=0.1.0"kubectl apply -f image-automation.yamlCreate the Rollout
Define how Kuberik should manage versions.
rollout.yaml
apiVersion: kuberik.com/v1alpha1
kind: Rollout
metadata:
name: hello-world-app
namespace: default
spec:
releasesImagePolicy:
name: hello-world-appkubectl apply -f rollout.yamlDeploy with Kuberik
Apply the Flux Kustomization that uses Kuberik’s substitution.
kustomization.yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: hello-world-app
namespace: flux-system
annotations:
rollout.kuberik.com/substitute.HELLO_WORLD_VERSION.from: "hello-world-app"
spec:
interval: 10m0s
path: ./deployments/prod
sourceRef:
kind: GitRepository
name: hello-world
targetNamespace: hello-world
postBuild:
substitute:
HELLO_WORLD_VERSION: "0.1.0" # Placeholderkubectl apply -f kustomization.yamlEnsure your Deployment in ./deployments/prod uses the substitution variable:
deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
spec:
template:
spec:
containers:
- name: app
image: ghcr.io/kuberik/hello-world/app:${HELLO_WORLD_VERSION}Verify the Rollout
Check that Kuberik detected the new image and created a release.
kubectl describe rollout hello-world-app