Skip to content

Commit

Permalink
Provide platform ca to monitoring operator (#128)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored May 9, 2024
1 parent b637f76 commit 50b55f3
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 14 deletions.
2 changes: 2 additions & 0 deletions apis/installer/v1alpha1/monitoring_operator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ type MonitoringOperatorSpec struct {
type PlatformSpec struct {
BaseURL string `json:"baseURL"`
Token string `json:"token"`
// +optional
CABundle string `json:"caBundle"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
4 changes: 2 additions & 2 deletions charts/grafana-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: grafana-operator
description: A Helm chart for Grafana Operator by AppsCode
type: application
version: v0.0.5
appVersion: v0.0.5
version: v0.0.6
appVersion: v0.0.6
home: https://github.com/open-viz/grafana-operator
icon: https://cdn.appscode.com/images/products/searchlight/icons/android-icon-192x192.png
sources:
Expand Down
10 changes: 5 additions & 5 deletions charts/grafana-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
```bash
$ helm repo add appscode https://charts.appscode.com/stable/
$ helm repo update
$ helm search repo appscode/grafana-operator --version=v0.0.5
$ helm upgrade -i grafana-operator appscode/grafana-operator -n kubeops --create-namespace --version=v0.0.5
$ helm search repo appscode/grafana-operator --version=v0.0.6
$ helm upgrade -i grafana-operator appscode/grafana-operator -n kubeops --create-namespace --version=v0.0.6
```

## Introduction
Expand All @@ -24,7 +24,7 @@ This chart deploys a Grafana operator on a [Kubernetes](http://kubernetes.io) cl
To install/upgrade the chart with the release name `grafana-operator`:

```bash
$ helm upgrade -i grafana-operator appscode/grafana-operator -n kubeops --create-namespace --version=v0.0.5
$ helm upgrade -i grafana-operator appscode/grafana-operator -n kubeops --create-namespace --version=v0.0.6
```

The command deploys a Grafana operator on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
Expand Down Expand Up @@ -80,12 +80,12 @@ The following table lists the configurable parameters of the `grafana-operator`
Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:

```bash
$ helm upgrade -i grafana-operator appscode/grafana-operator -n kubeops --create-namespace --version=v0.0.5 --set replicaCount=1
$ helm upgrade -i grafana-operator appscode/grafana-operator -n kubeops --create-namespace --version=v0.0.6 --set replicaCount=1
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while
installing the chart. For example:

```bash
$ helm upgrade -i grafana-operator appscode/grafana-operator -n kubeops --create-namespace --version=v0.0.5 --values values.yaml
$ helm upgrade -i grafana-operator appscode/grafana-operator -n kubeops --create-namespace --version=v0.0.6 --values values.yaml
```
4 changes: 2 additions & 2 deletions charts/monitoring-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: monitoring-operator
description: A Helm chart for monitoring-operator by AppsCode
type: application
version: v0.0.5
appVersion: v0.0.5
version: v0.0.6
appVersion: v0.0.6
home: https://github.com/kubeops/monitoring-operator
icon: https://cdn.appscode.com/images/products/kubeops/icons/android-icon-192x192.png
sources:
Expand Down
11 changes: 6 additions & 5 deletions charts/monitoring-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
```bash
$ helm repo add appscode https://charts.appscode.com/stable/
$ helm repo update
$ helm search repo appscode/monitoring-operator --version=v0.0.5
$ helm upgrade -i monitoring-operator appscode/monitoring-operator -n kubeops --create-namespace --version=v0.0.5
$ helm search repo appscode/monitoring-operator --version=v0.0.6
$ helm upgrade -i monitoring-operator appscode/monitoring-operator -n kubeops --create-namespace --version=v0.0.6
```

## Introduction
Expand All @@ -24,7 +24,7 @@ This chart deploys a Grafana UI Server on a [Kubernetes](http://kubernetes.io) c
To install/upgrade the chart with the release name `monitoring-operator`:

```bash
$ helm upgrade -i monitoring-operator appscode/monitoring-operator -n kubeops --create-namespace --version=v0.0.5
$ helm upgrade -i monitoring-operator appscode/monitoring-operator -n kubeops --create-namespace --version=v0.0.6
```

The command deploys a Grafana UI Server on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
Expand Down Expand Up @@ -81,17 +81,18 @@ The following table lists the configurable parameters of the `monitoring-operato
| 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> |
| platform.baseURL | | <code>""</code> |
| platform.token | | <code>""</code> |
| platform.caBundle | | <code>""</code> |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:

```bash
$ helm upgrade -i monitoring-operator appscode/monitoring-operator -n kubeops --create-namespace --version=v0.0.5 --set replicaCount=1
$ helm upgrade -i monitoring-operator appscode/monitoring-operator -n kubeops --create-namespace --version=v0.0.6 --set replicaCount=1
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while
installing the chart. For example:

```bash
$ helm upgrade -i monitoring-operator appscode/monitoring-operator -n kubeops --create-namespace --version=v0.0.5 --values values.yaml
$ helm upgrade -i monitoring-operator appscode/monitoring-operator -n kubeops --create-namespace --version=v0.0.6 --values values.yaml
```
13 changes: 13 additions & 0 deletions charts/monitoring-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ spec:
- --use-kubeapiserver-fqdn-for-aks={{ .Values.apiserver.useKubeapiserverFqdnForAks }}
- --baseURL={{ .Values.platform.baseURL }}
- --token=$(PLATFORM_API_TOKEN)
{{- if .Values.platform.caBundle }}
- --platform-ca-file=/var/platform-ca/tls.crt
{{- end }}
ports:
- containerPort: 8443
env:
Expand Down Expand Up @@ -85,11 +88,21 @@ spec:
volumeMounts:
- mountPath: /var/serving-cert
name: serving-cert
{{- if .Values.platform.caBundle }}
- mountPath: /var/platform-ca
name: platform-ca
{{- end }}
volumes:
- name: serving-cert
secret:
defaultMode: 420
secretName: {{ include "monitoring-operator.fullname" . }}-apiserver-cert
{{- if .Values.platform.caBundle }}
- name: platform-ca
secret:
defaultMode: 420
secretName: {{ include "monitoring-operator.fullname" . }}-platform-ca
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if or .Values.tolerations $criticalAddon }}
Expand Down
11 changes: 11 additions & 0 deletions charts/monitoring-operator/templates/platform-ca-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.platform.caBundle }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "monitoring-operator.fullname" . }}-platform-ca
namespace: {{ .Release.Namespace }}
labels:
{{- include "monitoring-operator.labels" . | nindent 4 }}
data:
tls.crt: {{ .Values.platform.caBundle }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/monitoring-operator/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,8 @@ properties:
properties:
baseURL:
type: string
caBundle:
type: string
token:
type: string
required:
Expand Down
2 changes: 2 additions & 0 deletions charts/monitoring-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ monitoring:
platform:
baseURL: ""
token: ""
caBundle: ""

0 comments on commit 50b55f3

Please sign in to comment.