Skip to content

Commit

Permalink
Convert exporters to use kubernetes deployments instead of openshift …
Browse files Browse the repository at this point in the history
…deploymentconfigs, which are deprecated

Signed-off-by: Eric Sauer <[email protected]>
  • Loading branch information
etsauer committed Sep 9, 2024
1 parent 858dc77 commit 0b6000f
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 102 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 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
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-09T15:49:19Z"
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 @@ -210,6 +210,15 @@ spec:
- clusterroles
verbs:
- '*'
- apiGroups:
- ""
resources:
- configmaps
- secrets
- serviceaccounts
- services
verbs:
- '*'
- apiGroups:
- rbac.authorization.k8s.io
resources:
Expand All @@ -218,9 +227,9 @@ spec:
verbs:
- '*'
- apiGroups:
- apps.openshift.io
- apps
resources:
- deploymentconfigs
- deployments
verbs:
- '*'
- apiGroups:
Expand All @@ -243,15 +252,6 @@ spec:
- routes
verbs:
- '*'
- apiGroups:
- ""
resources:
- configmaps
- secrets
- serviceaccounts
- services
verbs:
- '*'
- apiGroups:
- operators.coreos.com
resources:
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
22 changes: 11 additions & 11 deletions pelorus-operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ rules:
resources:
- "clusterrolebindings"
- "clusterroles"
- verbs:
- "*"
apiGroups:
- ""
resources:
- "configmaps"
- "secrets"
- "serviceaccounts"
- "services"
- verbs:
- "*"
apiGroups:
Expand All @@ -62,9 +71,9 @@ rules:
- verbs:
- "*"
apiGroups:
- "apps.openshift.io"
- "apps"
resources:
- "deploymentconfigs"
- "deployments"
- verbs:
- "*"
apiGroups:
Expand All @@ -85,14 +94,5 @@ rules:
- "route.openshift.io"
resources:
- "routes"
- verbs:
- "*"
apiGroups:
- ""
resources:
- "configmaps"
- "secrets"
- "serviceaccounts"
- "services"

#+kubebuilder:scaffold:rules
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-09T15:49:18.510009719Z"
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 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
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
2 changes: 1 addition & 1 deletion scripts/update_projects_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
PELORUS_CHARTS_FOLDER / "Chart.yaml": 2,
ROOT / "charts/operators/Chart.yaml": 1,
PELORUS_EXPORTERS_FOLDER / "Chart.yaml": 1,
PELORUS_EXPORTERS_FOLDER / "templates/_deploymentconfig.yaml": 1,
PELORUS_EXPORTERS_FOLDER / "templates/_deployment.yaml": 1,
PELORUS_EXPORTERS_FOLDER / "templates/_imagestream_from_image.yaml": 1,
}
DEVELOPMENT_FILE = ROOT / "docs/Development.md"
Expand Down

0 comments on commit 0b6000f

Please sign in to comment.