Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move operator to a separate deployment to run without promxy secret #41

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions charts/kof-mothership/templates/promxy/operator-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{{- if .Values.promxy.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "chart.fullname" . }}-promxy-operator
namespace: {{ .Release.Namespace }}
labels:
{{- include "chart.labels" . | nindent 4 }}
{{- if .Values.promxy.operator.extraLabels}}
{{ toYaml .Values.promxy.operator.extraLabels | nindent 4 }}
{{- end}}
{{- with .Values.promxy.operator.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
gmlexx marked this conversation as resolved.
Show resolved Hide resolved
spec:
replicas: {{ .Values.promxy.operator.replicaCount }}
{{- if (.Values.promxy.operator.deployment | default dict).strategy }}
strategy:
{{- toYaml .Values.promxy.operator.deployment.strategy | nindent 4 }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}-operator
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}-operator
{{- if .Values.promxy.operator.extraLabels}}
{{ toYaml .Values.promxy.operator.extraLabels | nindent 8 }}
{{- end}}
spec:
{{- with .Values.promxy.operator.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
gmlexx marked this conversation as resolved.
Show resolved Hide resolved
serviceAccountName: {{ include "chart.serviceAccountName" . }}
{{- if .Values.promxy.operator.nodeSelector }}
nodeSelector:
{{- toYaml .Values.promxy.operator.nodeSelector | nindent 8 }}
{{- end }}
{{- with .Values.promxy.operator.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
gmlexx marked this conversation as resolved.
Show resolved Hide resolved
{{- if .Values.promxy.operator.affinity }}
affinity:
{{- toYaml .Values.promxy.operator.affinity | nindent 8 }}
{{- end }}
containers:
- name: operator
command:
- "/manager"
env:
- name: "PROMXY_RELOAD_ENDPOINT"
value: "http://{{ .Release.Name }}-promxy:{{ .Values.promxy.service.servicePort }}/-/reload"
image: "{{ .Values.promxy.operator.image.repository }}:{{ .Values.promxy.operator.image.tag }}"
imagePullPolicy: {{ .Values.promxy.operator.image.pullPolicy }}
livenessProbe:
failureThreshold: 6
httpGet:
path: /healthz
port: http
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
failureThreshold: 120
httpGet:
path: /readyz
port: http
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
ports:
- containerPort: 8081
name: http
resources:
{{- toYaml .Values.promxy.operator.resources | nindent 12 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,6 @@ spec:
{{ toYaml .Values.promxy.affinity | indent 8 }}
{{- end }}
containers:
- name: operator
command:
- "/manager"
image: "{{ .Values.promxy.operator.image.repository }}:{{ .Values.promxy.operator.image.tag }}"
imagePullPolicy: {{ .Values.promxy.operator.image.pullPolicy }}
livenessProbe:
failureThreshold: 6
httpGet:
path: /healthz
port: operator-http
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
readinessProbe:
failureThreshold: 120
httpGet:
path: /readyz
port: operator-http
scheme: HTTP
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
ports:
- containerPort: 8081
name: operator-http
resources:
{{- toYaml .Values.promxy.operator.resources | nindent 12 }}
- name: promxy
args:
- "--config=/etc/promxy/config.yaml"
Expand Down
18 changes: 0 additions & 18 deletions charts/kof-mothership/templates/promxy/secret.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions promxy-operator/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ func main() {
opts.BindFlags(flag.CommandLine)
flag.Parse()

if endpoint, ok := os.LookupEnv("PROMXY_RELOAD_ENDPOINT"); ok {
promxyReloadEnpoint = endpoint
}

ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

// if the enable-http2 flag is false (the default), http/2 should be disabled
Expand Down
Loading