Skip to content

Commit

Permalink
Convert exporter chart to use k8s deployments instead of openshift... (
Browse files Browse the repository at this point in the history
…#1159)

Signed-off-by: Eric Sauer <[email protected]>
  • Loading branch information
etsauer authored Sep 10, 2024
1 parent 858dc77 commit 18be149
Show file tree
Hide file tree
Showing 25 changed files with 45 additions and 121 deletions.
2 changes: 1 addition & 1 deletion charts/operators/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.0.13-rc.3
version: 2.0.13-rc.4
6 changes: 3 additions & 3 deletions charts/pelorus/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: exporters
repository: file://./charts/exporters
version: 2.0.13-rc.3
digest: sha256:742d458f384de076ddbb4a0cf2d4b4127ef1365c319212c7d64a315157fd94f5
generated: "2024-09-05T13:30:14.412659258Z"
version: 2.0.13-rc.4
digest: sha256:9044a4123b267fb9c42945ced5af31fcc02d8ff2000057662fbb40f72b027884
generated: "2024-09-09T15:49:18.189990808Z"
4 changes: 2 additions & 2 deletions charts/pelorus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.0.13-rc.3
version: 2.0.13-rc.4

dependencies:
- name: exporters
version: 2.0.13-rc.3
version: 2.0.13-rc.4
repository: file://./charts/exporters
2 changes: 1 addition & 1 deletion charts/pelorus/charts/exporters/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.0.13-rc.3
version: 2.0.13-rc.4
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
{{- define "exporters.deploymentconfig" }}
---
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: {{ .app_name }}
application: {{ .app_name }}
name: {{ .app_name }}
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app.kubernetes.io/name: {{ .app_name }}
app: {{ .app_name }}
deploymentconfig: {{ .app_name }}
strategy:
type: Rolling
matchLabels:
app.kubernetes.io/name: {{ .app_name }}
app: {{ .app_name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ .app_name }}
app: {{ .app_name }}
deploymentconfig: {{ .app_name }}
application: {{ .app_name }}
pelorus.dora-metrics.io/exporter-type: {{ .exporter_type | default "generic-exporter" }}
spec:
serviceAccount: pelorus-exporter
Expand All @@ -35,7 +30,7 @@ spec:
containers:
- name: {{ .app_name }}
imagePullPolicy: Always

image: quay.io/pelorus/pelorus-{{ .exporter_type }}-exporter:{{ .image_tag | default "v2.0.13-rc.4" }}
volumeMounts:
{{- range $config := .custom_certs }}
- name: custom-cert-volume-{{$config.map_name}}
Expand Down Expand Up @@ -67,7 +62,7 @@ spec:
value: {{ .image_name }}:{{ .image_tag | default "latest" }}
{{- end }}
{{- else }}
value: quay.io/pelorus/pelorus-{{ .exporter_type }}-exporter:{{ .image_tag | default "v2.0.13-rc.3" }}
value: quay.io/pelorus/pelorus-{{ .exporter_type }}-exporter:{{ .image_tag | default "v2.0.13-rc.4" }}
{{- end }}
{{- end }}

Expand All @@ -87,20 +82,4 @@ spec:
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- {{ .app_name }}
from:
kind: ImageStreamTag
{{- if or .source_ref .source_url }}
name: {{ .app_name }}:latest
{{- else }}
# default is an internal registry tag and must match the default from
# _imagestream_from_image.yaml
name: {{ .app_name }}:{{ .image_tag | default "stable" }}
{{- end }}
type: ImageChange
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
name: {{ .image_name }}:{{ .image_tag | default "latest" }}
{{- end }}
{{- else }}
name: quay.io/pelorus/pelorus-{{ .exporter_type }}-exporter:{{ .image_tag | default "v2.0.13-rc.3" }}
name: quay.io/pelorus/pelorus-{{ .exporter_type }}-exporter:{{ .image_tag | default "v2.0.13-rc.4" }}
# .image_name
{{- end }}
name: {{ .image_tag | default "stable" }}
Expand Down
15 changes: 0 additions & 15 deletions charts/pelorus/charts/exporters/templates/_route.yaml

This file was deleted.

1 change: 0 additions & 1 deletion charts/pelorus/charts/exporters/templates/_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ spec:
targetPort: 8080
selector:
app.kubernetes.io/name: {{ .app_name }}
deploymentconfig: {{ .app_name }}
type: ClusterIP
{{- end }}
1 change: 0 additions & 1 deletion charts/pelorus/charts/exporters/templates/exporters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
{{- end}}
{{ include "exporters.imagestream_from_image" $exporter }}
{{- end }}
{{ include "exporters.route" $exporter }}
{{ include "exporters.service" $exporter }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion docs/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ export TEST_EXPORTER_IMAGE="$REPOSITORY/rc-pelorus-exporter:{{ .image_tag | defa
sed -i "s,$DEFAULT_OPERATOR_IMAGE,$TEST_OPERATOR_IMAGE,g" bundle/manifests/pelorus-operator.clusterserviceversion.yaml
sed -i "s,$DEFAULT_EXPORTER_IMAGE,$TEST_EXPORTER_IMAGE,g" helm-charts/pelorus/charts/exporters/templates/_imagestream_from_image.yaml
sed -i "s,$DEFAULT_EXPORTER_IMAGE,$TEST_EXPORTER_IMAGE,g" helm-charts/pelorus/charts/exporters/templates/_deploymentconfig.yaml
sed -i "s,$DEFAULT_EXPORTER_IMAGE,$TEST_EXPORTER_IMAGE,g" helm-charts/pelorus/charts/exporters/templates/_deployment.yaml
sed -i "s,$CURRENT_OPERATOR_VERSION,$TEST_VERSION,g" Makefile
sed -i "s,pelorus-operator,rc-pelorus-operator,g" Makefile
find . -type f | xargs sed -i "s,$CURRENT_OPERATOR_VERSION,$CURRENT_OPERATOR_VERSION-$TEST_VERSION,g"
Expand Down
2 changes: 1 addition & 1 deletion pelorus-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 0.0.10-rc.3
VERSION ?= 0.0.10-rc.4

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ metadata:
capabilities: Basic Install
categories: |
Modernization & Migration,Developer Tools,Monitoring,Integration & Delivery
containerImage: quay.io/pelorus/pelorus-operator:0.0.10-rc.3
createdAt: "2024-09-05T18:53:43Z"
containerImage: quay.io/pelorus/pelorus-operator:0.0.10-rc.4
createdAt: "2024-09-10T13:59:23Z"
description: |
Tool that helps IT organizations measure their impact on the overall performance of their organization
operatorframework.io/suggested-namespace: pelorus
operators.operatorframework.io/builder: operator-sdk-v1.33.0
operators.operatorframework.io/project_layout: helm.sdk.operatorframework.io/v1
repository: https://github.com/dora-metrics/pelorus/
support: Pelorus Community
name: pelorus-operator.v0.0.10-rc.3
name: pelorus-operator.v0.0.10-rc.4
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -218,9 +218,9 @@ spec:
verbs:
- '*'
- apiGroups:
- apps.openshift.io
- apps
resources:
- deploymentconfigs
- deployments
verbs:
- '*'
- apiGroups:
Expand Down Expand Up @@ -385,7 +385,7 @@ spec:
- --metrics-bind-address=127.0.0.1:8080
- --leader-elect
- --leader-election-id=pelorus-operator
image: quay.io/pelorus/pelorus-operator:0.0.10-rc.3
image: quay.io/pelorus/pelorus-operator:0.0.10-rc.4
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -487,7 +487,7 @@ spec:
provider:
name: Red Hat
url: https://redhat.com
version: 0.0.10-rc.3
version: 0.0.10-rc.4
replaces: pelorus-operator.v0.0.9
skips:
- pelorus-operator.v0.0.9
Expand Down
2 changes: 1 addition & 1 deletion pelorus-operator/config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: quay.io/pelorus/pelorus-operator
newTag: 0.0.10-rc.3
newTag: 0.0.10-rc.4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
capabilities: Basic Install
categories: |
Modernization & Migration,Developer Tools,Monitoring,Integration & Delivery
containerImage: quay.io/pelorus/pelorus-operator:0.0.10-rc.3
containerImage: quay.io/pelorus/pelorus-operator:0.0.10-rc.4
description: |
Tool that helps IT organizations measure their impact on the overall performance of their organization
operatorframework.io/suggested-namespace: pelorus
Expand Down
4 changes: 2 additions & 2 deletions pelorus-operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ rules:
- verbs:
- "*"
apiGroups:
- "apps.openshift.io"
- "apps"
resources:
- "deploymentconfigs"
- "deployments"
- verbs:
- "*"
apiGroups:
Expand Down
6 changes: 3 additions & 3 deletions pelorus-operator/helm-charts/pelorus/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: exporters
repository: file://./charts/exporters
version: 2.0.13-rc.3
digest: sha256:742d458f384de076ddbb4a0cf2d4b4127ef1365c319212c7d64a315157fd94f5
generated: "2024-09-05T18:53:43.104094598Z"
version: 2.0.13-rc.4
digest: sha256:9044a4123b267fb9c42945ced5af31fcc02d8ff2000057662fbb40f72b027884
generated: "2024-09-10T13:59:23.151180653Z"
4 changes: 2 additions & 2 deletions pelorus-operator/helm-charts/pelorus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
dependencies:
- name: exporters
repository: file://./charts/exporters
version: 2.0.13-rc.3
version: 2.0.13-rc.4
description: A Helm chart for Kubernetes
name: pelorus
type: application
version: 2.0.13-rc.3
version: 2.0.13-rc.4
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.0.13-rc.3
version: 2.0.13-rc.4
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
{{- define "exporters.deploymentconfig" }}
---
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: {{ .app_name }}
application: {{ .app_name }}
name: {{ .app_name }}
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app.kubernetes.io/name: {{ .app_name }}
app: {{ .app_name }}
deploymentconfig: {{ .app_name }}
strategy:
type: Rolling
matchLabels:
app.kubernetes.io/name: {{ .app_name }}
app: {{ .app_name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ .app_name }}
app: {{ .app_name }}
deploymentconfig: {{ .app_name }}
application: {{ .app_name }}
pelorus.dora-metrics.io/exporter-type: {{ .exporter_type | default "generic-exporter" }}
spec:
serviceAccount: pelorus-exporter
Expand All @@ -35,7 +30,7 @@ spec:
containers:
- name: {{ .app_name }}
imagePullPolicy: Always

image: quay.io/pelorus/pelorus-{{ .exporter_type }}-exporter:{{ .image_tag | default "v2.0.13-rc.4" }}
volumeMounts:
{{- range $config := .custom_certs }}
- name: custom-cert-volume-{{$config.map_name}}
Expand Down Expand Up @@ -67,7 +62,7 @@ spec:
value: {{ .image_name }}:{{ .image_tag | default "latest" }}
{{- end }}
{{- else }}
value: quay.io/pelorus/pelorus-{{ .exporter_type }}-exporter:{{ .image_tag | default "v2.0.13-rc.3" }}
value: quay.io/pelorus/pelorus-{{ .exporter_type }}-exporter:{{ .image_tag | default "v2.0.13-rc.4" }}
{{- end }}
{{- end }}

Expand All @@ -87,20 +82,4 @@ spec:
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- {{ .app_name }}
from:
kind: ImageStreamTag
{{- if or .source_ref .source_url }}
name: {{ .app_name }}:latest
{{- else }}
# default is an internal registry tag and must match the default from
# _imagestream_from_image.yaml
name: {{ .app_name }}:{{ .image_tag | default "stable" }}
{{- end }}
type: ImageChange
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
name: {{ .image_name }}:{{ .image_tag | default "latest" }}
{{- end }}
{{- else }}
name: quay.io/pelorus/pelorus-{{ .exporter_type }}-exporter:{{ .image_tag | default "v2.0.13-rc.3" }}
name: quay.io/pelorus/pelorus-{{ .exporter_type }}-exporter:{{ .image_tag | default "v2.0.13-rc.4" }}
# .image_name
{{- end }}
name: {{ .image_tag | default "stable" }}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ spec:
targetPort: 8080
selector:
app.kubernetes.io/name: {{ .app_name }}
deploymentconfig: {{ .app_name }}
type: ClusterIP
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
{{- end}}
{{ include "exporters.imagestream_from_image" $exporter }}
{{- end }}
{{ include "exporters.route" $exporter }}
{{ include "exporters.service" $exporter }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions scripts/chart-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ fi
ct lint --remote "$REMOTE" --config ct.yaml || exit 1
rm -f charts/pelorus/charts/*.tgz

if ! grep "default \"v$CURRENT_CHART_VERSION\"" charts/pelorus/charts/exporters/templates/_deploymentconfig.yaml &> /dev/null; then
echo "ERROR: Version in charts/pelorus/charts/exporters/templates/_deploymentconfig.yaml differs!"
if ! grep "default \"v$CURRENT_CHART_VERSION\"" charts/pelorus/charts/exporters/templates/_deployment.yaml &> /dev/null; then
echo "ERROR: Version in charts/pelorus/charts/exporters/templates/_deployment.yaml differs!"
echo "$HELP_MESSAGE"
exit 1
fi
Expand Down
Loading

0 comments on commit 18be149

Please sign in to comment.