This demo showcases how to install the prometheus operator with RukPak!
$ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.0/cert-manager.yaml
$ kubectl apply -f https://github.com/operator-framework/rukpak/releases/latest/download/rukpak.yaml
- Install the prometheus operator using a bundleDeployment
$ kubectl apply -f -<<EOF
apiVersion: core.rukpak.io/v1alpha1
kind: BundleDeployment
metadata:
name: prometheus
spec:
provisionerClassName: core-rukpak-io-plain
template:
metadata:
labels:
app: prometheus
spec:
provisionerClassName: core-rukpak-io-registry
source:
type: image
image:
ref: quay.io/agreene/prometheus:v1
EOF
bundledeployment.core.rukpak.io/prometheus created
- Check that the prometheus bundleDeployment was installed successfully:
$ kubectl get bundledeployments
NAME ACTIVE BUNDLE INSTALL STATE AGE
prometheus prometheus-z55c54 InstallationSucceeded 6m21s
- Check that the expected resources were created
$ kubectl get bundles
NAME TYPE PHASE AGE
prometheus-z55c54 image Unpacked 7m16s
$ kubectl get pods -n prometheus-system
NAME READY STATUS RESTARTS AGE
prometheus-operator-5bbbb6b6cf-tvpv4 1/1 Running 0 14s
$ kubectl get crds
NAME CREATED AT
alertmanagerconfigs.monitoring.coreos.com 2022-10-19T15:08:23Z
alertmanagers.monitoring.coreos.com 2022-10-19T15:08:23Z
bundledeployments.core.rukpak.io 2022-10-19T14:58:05Z
bundles.core.rukpak.io 2022-10-19T14:58:05Z
certificaterequests.cert-manager.io 2022-10-19T14:51:00Z
certificates.cert-manager.io 2022-10-19T14:51:00Z
challenges.acme.cert-manager.io 2022-10-19T14:51:00Z
clusterissuers.cert-manager.io 2022-10-19T14:51:00Z
issuers.cert-manager.io 2022-10-19T14:51:00Z
orders.acme.cert-manager.io 2022-10-19T14:51:00Z
podmonitors.monitoring.coreos.com 2022-10-19T15:08:23Z
probes.monitoring.coreos.com 2022-10-19T15:08:23Z
prometheuses.monitoring.coreos.com 2022-10-19T15:08:23Z
prometheusrules.monitoring.coreos.com 2022-10-19T15:08:23Z
servicemonitors.monitoring.coreos.com 2022-10-19T15:08:23Z
thanosrulers.monitoring.coreos.com 2022-10-19T15:08:23Z
$ kubectl get deployments -n prometheus-system
NAME READY UP-TO-DATE AVAILABLE AGE
prometheus-operator 1/1 1 1 56s
- Update the bundle referenced by the bundleDeployment
$ kubectl patch bundledeployment prometheus --type=merge -p '{"spec": {"template": {"spec":{"source": {"image": {"ref": "quay.io/agreene/prometheus:v2"}}}}}}'
bundledeployment.core.rukpak.io/prometheus patched
- Check that the bundle is being updated:
$ kubectl get bundles
NAME TYPE PHASE AGE
prometheus-dcdxz5 image Pending 1s
prometheus-z55c54 image Unpacked 25s
- Check that the deployment now points to the new bundle and confirm that the old bundle was deleted
$ kubectl get bundledeployment
NAME ACTIVE BUNDLE INSTALL STATE AGE
prometheus prometheus-dcdxz5 InstallationSucceeded 5m10s
$ kubectl get bundles
NAME TYPE PHASE AGE
prometheus-dcdxz5 image Unpacked 20s
- Uninstall the prometheus operator
$ kubect delete bundledeployment prometheus