Skip to content

Commit

Permalink
Update values and fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosmamorim committed Mar 31, 2024
1 parent 5631d11 commit 789e94f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
18 changes: 18 additions & 0 deletions helm/templates/service_metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.deploy -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "poolboy.name" . }}-metrics
namespace: {{ include "poolboy.namespaceName" . }}
labels:
{{- include "poolboy.labels" . | nindent 4 }}
spec:
type: {{ .Values.serviceMetrics.type }}
{{- with .Values.serviceMetrics.ports }}
ports:
{{- toYaml . | nindent 2 }}
{{- end }}
selector:
{{- include "poolboy.selectorLabels" . | nindent 4 }}
sessionAffinity: None
{{- end -}}
18 changes: 18 additions & 0 deletions helm/templates/service_monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "poolboy.name" . }}
namespace: {{ include "poolboy.namespaceName" . }}
labels:
{{- include "poolboy.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "poolboy.name" . }}
namespaceSelector:
matchNames:
- {{ include "poolboy.namespaceName" . }}
endpoints:
- port: {{ include "poolboy.name" . }}
interval: "30s"
path: /metrics
6 changes: 6 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ service:
port: 8000
protocol: TCP
targetPort: 8000
- name: metrics-service
port: 8000
protocol: web
targetPort: 8000
path: /metrics


resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down
3 changes: 0 additions & 3 deletions operator/poolboy_k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,6 @@ async def get_requester_from_namespace(namespace: str) -> tuple[Optional[Mapping
if not user_name:
return None, []

if user_name == 'system:admin':
user_name = 'mamorim-redhat.com'

try:
user = await Poolboy.custom_objects_api.get_cluster_custom_object(
'user.openshift.io', 'v1', 'users', user_name
Expand Down

0 comments on commit 789e94f

Please sign in to comment.