Skip to content

Commit

Permalink
Merge pull request #3 from ops-center/remove-env-jwttoken
Browse files Browse the repository at this point in the history
Added JMAP and Webadmin endpoints as env variables.
  • Loading branch information
Imtiaz246 authored Aug 6, 2024
2 parents 6bc40c9 + 67e0549 commit 2423ac6
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 18 deletions.
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"`
Token string `json:"token"`
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 }}
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
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
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:
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: ""

0 comments on commit 2423ac6

Please sign in to comment.