Skip to content

Publish an OCI Artifact and/or Image to ghcr.io #1208

@ba-work

Description

@ba-work

With k8s 1.33 OCI volume support hitting beta and kind releasing 1.33, it became trivially easy for me to test running the jmx exporter as an OCI volume and it worked great.

This would greatly simplify some CI and deployment stuff since it enables easy decoupling of the exporter's jar and the application's jar. For example, getting metrics out of keycloak:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: example
spec:
  selector:
    matchLabels:
      app: example
  template:
    metadata:
      labels:
        app: example
    spec:
      containers:
        - name: app
          image: quay.io/keycloak/keycloak
          args: ["start-dev"]
          env:
            - name: JAVA_OPTS_APPEND
              value: -javaagent:/exporter-jar/jmx-exporter.jar=12345:/exporter-config/config.yaml
          volumeMounts:
            - name: exporter-jar
              mountPath: /exporter-jar
            - name: exporter-config
              mountPath: /exporter-config
      volumes:
        - name: exporter-jar
          image:
            reference: localhost:5000/jmx-exporter:v1.2.0
        - name: exporter-config
          configMap:
            name: exporter-config
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: exporter-config
data:
  config.yaml: 'rules: [pattern: ".*"]'

The image I made for the exporter is this:

FROM scratch
ADD jmx-exporter.jar .

And I'm certain there is an oras incantation that could be used to make a "true" OCI artifact.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions