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

Added JMAP and Webadmin endpoints as env variables. #3

Merged
merged 3 commits into from
Aug 6, 2024
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
5 changes: 3 additions & 2 deletions apis/installer/v1alpha1/inbox_agent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ type InboxAgentApiserver struct {
}

type InboxServerInfo struct {
Endpoint string `json:"endpoint"`
Imtiaz246 marked this conversation as resolved.
Show resolved Hide resolved
Token string `json:"token"`
Imtiaz246 marked this conversation as resolved.
Show resolved Hide resolved
JMAPEndpoint string `json:"jmapEndpoint"`
WebadminEndpoint string `json:"webadminEndpoint"`
Token string `json:"token"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
3 changes: 2 additions & 1 deletion charts/inbox-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ The following table lists the configurable parameters of the `inbox-agent` chart
| apiserver.servingCerts.serverKey | Private key for the serving certificate used by webhook server. | <code>""</code> |
| monitoring.agent | Name of monitoring agent (either "prometheus.io/operator" or "prometheus.io/builtin") | <code>"none"</code> |
| monitoring.serviceMonitor.labels | Specify the labels for ServiceMonitor. Prometheus crd will select ServiceMonitor using these labels. Only usable when monitoring agent is `prometheus.io/operator`. | <code>{}</code> |
| inboxServer.endpoint | | <code>""</code> |
| inboxServer.jmapEndpoint | | <code>""</code> |
| inboxServer.webadminEndpoint | | <code>""</code> |
| inboxServer.token | | <code>""</code> |


Expand Down
5 changes: 3 additions & 2 deletions charts/inbox-agent/templates/operator/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ metadata:
{{- include "inbox-agent.labels" . | nindent 4 }}
type: Opaque
stringData:
endpoint: {{ .Values.inboxServer.endpoint }}
Imtiaz246 marked this conversation as resolved.
Show resolved Hide resolved
token: {{ .Values.inboxServer.token }}
jmapEndpoint: {{ .Values.inboxServer.jmapEndpoint }}
webadminEndpoint: {{ .Values.inboxServer.webadminEndpoint }}
token: {{.Values.inboxServer.token}}
25 changes: 18 additions & 7 deletions charts/inbox-agent/templates/operator/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,18 @@ spec:
securityContext:
{{- toYaml .Values.operator.securityContext | nindent 10 }}
args:
- operator
- --v={{ .Values.logLevel }}
- --secure-port=8443
- --audit-log-path=-
- --tls-cert-file=/var/serving-cert/tls.crt
- --tls-private-key-file=/var/serving-cert/tls.key
- operator
- --v={{ .Values.logLevel }}
- --secure-port=8443
- --audit-log-path=-
- --tls-cert-file=/var/serving-cert/tls.crt
- --tls-private-key-file=/var/serving-cert/tls.key
{{- if .Values.inboxServer.jmapEndpoint }}
- --jmapEndpoint={{ .Values.inboxServer.jmapEndpoint }}
{{- end }}
{{- if .Values.inboxServer.webadminEndpoint }}
- --webadminEndpoint={{ .Values.inboxServer.webadminEndpoint }}
{{- end }}
ports:
- containerPort: 8443
env:
Expand All @@ -78,7 +84,12 @@ spec:
valueFrom:
secretKeyRef:
name: {{ include "inbox-agent.fullname" . }}-config
key: endpoint
key: jmapEndpoint
- name: INBOX_SERVER_WEBADMIN_ENDPOINT
valueFrom:
secretKeyRef:
name: {{ include "inbox-agent.fullname" . }}-config
key: webadminEndpoint
- name: INBOX_SERVER_TOKEN
samiulsami marked this conversation as resolved.
Show resolved Hide resolved
valueFrom:
secretKeyRef:
Expand Down
17 changes: 14 additions & 3 deletions charts/inbox-agent/templates/webhook/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ spec:
securityContext:
{{- toYaml .Values.operator.securityContext | nindent 10 }}
args:
- webhook
- --webhook-name={{ include "inbox-agent.fullname" . }}
- webhook
- --webhook-name={{ include "inbox-agent.fullname" . }}
{{- if .Values.inboxServer.jmapEndpoint }}
- --jmapEndpoint={{ .Values.inboxServer.jmapEndpoint }}
{{- end }}
{{- if .Values.inboxServer.webadminEndpoint }}
- --webadminEndpoint={{ .Values.inboxServer.webadminEndpoint }}
{{- end }}
env:
- name: POD_NAME
valueFrom:
Expand All @@ -69,11 +75,16 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: INBOX_SERVER_WEBADMIN_ENDPOINT
valueFrom:
secretKeyRef:
name: {{ include "inbox-agent.fullname" . }}-config
key: webadminEndpoint
- name: INBOX_SERVER_JMAP_ENDPOINT
valueFrom:
secretKeyRef:
name: {{ include "inbox-agent.fullname" . }}-config
key: endpoint
key: jmapEndpoint
- name: INBOX_SERVER_TOKEN
Imtiaz246 marked this conversation as resolved.
Show resolved Hide resolved
valueFrom:
secretKeyRef:
Expand Down
7 changes: 5 additions & 2 deletions charts/inbox-agent/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -945,13 +945,16 @@ properties:
type: array
inboxServer:
properties:
endpoint:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use make gen fmt to generate.

jmapEndpoint:
type: string
token:
type: string
webadminEndpoint:
type: string
required:
- endpoint
- jmapEndpoint
- token
- webadminEndpoint
type: object
logLevel:
format: int32
Expand Down
3 changes: 2 additions & 1 deletion charts/inbox-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,6 @@ monitoring:
labels: {}

inboxServer:
endpoint: ""
jmapEndpoint: ""
webadminEndpoint: ""
token: ""
Loading