Skip to content

Commit

Permalink
Test operator monitoring (#164)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Apr 12, 2022
1 parent 9f7011e commit f07c0de
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 50 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
export KUBECONFIG="${HOME}/.kube/config"
CLUSTER_UID=$(kubectl get ns kube-system -o=jsonpath='{.metadata.uid}')
LICENSE_KEY=$(curl -X POST -d "name=1gtm&email=1gtm@appscode.com&product=kubevault-enterprise&cluster=${CLUSTER_UID}&tos=true&token=${BYTEBUILDERS_LICENSE_TOKEN}" https://license-issuer.appscode.com/issue-license)
echo "${LICENSE_KEY}" > /tmp/license.txt
# ref: https://github.com/mikefarah/yq/issues/230#issuecomment-487458629
yqq w -i ./charts/kubevault-operator/ci/ci-values.yaml license --tag '!!str' -- "${LICENSE_KEY}"
Expand All @@ -105,3 +106,22 @@ jobs:
export KUBECONFIG="${HOME}/.kube/config"
./hack/scripts/update-chart-dependencies.sh
./hack/scripts/ct.sh
- name: Test Monitoring
run: |
export LICENSE_FILE=/tmp/license.txt
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm upgrade -i kube-prometheus-stack prometheus-community/kube-prometheus-stack --wait \
--namespace monitoring --create-namespace \
--set grafana.defaultDashboardsEnabled=false
helm upgrade -i kubevault charts/kubevault --wait \
--namespace kubevault --create-namespace \
--set-file global.license=$LICENSE_FILE \
--set global.monitoring.agent=prometheus.io/operator \
--set global.monitoring.serviceMonitor.labels.release=kube-prometheus-stack
helm delete kubevault --namespace kubevault
helm upgrade -i kubevault charts/kubevault --wait \
--namespace kubevault --create-namespace \
--set-file global.license=$LICENSE_FILE \
--set global.monitoring.agent=prometheus.io/builtin
7 changes: 0 additions & 7 deletions apis/installer/v1alpha1/kubevault_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ type Kubevault struct {
type KubevaultSpec struct {
Global GlobalValues `json:"global"`

//+optional
CRDs KubevaultCrdsValues `json:"kubevault-crds"`

//+optional
Catalog KubevaultCatalogValues `json:"kubevault-catalog"`

Expand All @@ -56,10 +53,6 @@ type KubevaultSpec struct {
WebhookServer KubevaultWebhookServerValues `json:"kubevault-webhook-server"`
}

type KubevaultCrdsValues struct {
Enabled bool `json:"enabled"`
}

type KubevaultCatalogValues struct {
Enabled bool `json:"enabled"`
*KubevaultCatalogSpec `json:",inline"`
Expand Down
17 changes: 0 additions & 17 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions charts/kubevault-operator/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: "/metrics"
prometheus.io/port: {{ .Values.apiserver.port | quote }}
prometheus.io/scheme: "https"
prometheus.io/port: {{ .Values.monitoring.bindPort | quote }}
prometheus.io/scheme: "http"
{{- end }}
spec:
ports:
Expand Down
2 changes: 1 addition & 1 deletion charts/kubevault/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
repository: file://../kubevault-operator
version: v0.7.0
condition: kubevault-operator.enabled
- name: kubevault-operator
- name: kubevault-webhook-server
repository: file://../kubevault-webhook-server
version: v0.7.0
condition: kubevault-webhook-server.enabled
23 changes: 11 additions & 12 deletions charts/kubevault/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@ The command removes all the Kubernetes components associated with the chart and

The following table lists the configurable parameters of the `kubevault` chart and their default values.

| Parameter | Description | Default |
|-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| global.license | License for the product. Get a license by following the steps from [here](https://kubevault.com/docs/latest/setup/install/enterprise#get-a-trial-license). <br> Example: <br> `helm install appscode/kubevault \` <br> `--set-file global.license=/path/to/license/file` <br> `or` <br> `helm install appscode/kubevault \` <br> `--set global.license=<license file content>` | <code>""</code> |
| global.registry | Docker registry used to pull KubeVault related images | <code>""</code> |
| global.registryFQDN | Docker registry fqdn used to pull KubeVault related images. Set this to use docker registry hosted at ${registryFQDN}/${registry}/${image} | <code>""</code> |
| global.imagePullSecrets | Specify an array of imagePullSecrets. Secrets must be manually created in the namespace. <br> Example: <br> `helm template charts/kubevault \` <br> `--set global.imagePullSecrets[0].name=sec0 \` <br> `--set global.imagePullSecrets[1].name=sec1` | <code>[]</code> |
| global.monitoring.agent | Name of monitoring agent (one of "prometheus.io", "prometheus.io/operator", "prometheus.io/builtin") | <code>""</code> |
| global.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> |
| kubevault-crds.enabled | If enabled, installs the kubevault-crds chart | <code>false</code> |
| kubevault-catalog.enabled | If enabled, installs the kubevault-catalog chart | <code>true</code> |
| kubevault-operator.enabled | If enabled, installs the kubevault-operator chart | <code>true</code> |
| kubevault-webhook-server.enabled | If enabled, installs the kubevault-webhook-server chart | <code>false</code> |
| Parameter | Description | Default |
|-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|
| global.license | License for the product. Get a license by following the steps from [here](https://kubevault.com/docs/latest/setup/install/enterprise#get-a-trial-license). <br> Example: <br> `helm install appscode/kubevault \` <br> `--set-file global.license=/path/to/license/file` <br> `or` <br> `helm install appscode/kubevault \` <br> `--set global.license=<license file content>` | <code>""</code> |
| global.registry | Docker registry used to pull KubeVault related images | <code>""</code> |
| global.registryFQDN | Docker registry fqdn used to pull KubeVault related images. Set this to use docker registry hosted at ${registryFQDN}/${registry}/${image} | <code>""</code> |
| global.imagePullSecrets | Specify an array of imagePullSecrets. Secrets must be manually created in the namespace. <br> Example: <br> `helm template charts/kubevault \` <br> `--set global.imagePullSecrets[0].name=sec0 \` <br> `--set global.imagePullSecrets[1].name=sec1` | <code>[]</code> |
| global.monitoring.agent | Name of monitoring agent (one of "prometheus.io", "prometheus.io/operator", "prometheus.io/builtin") | <code>""</code> |
| global.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> |
| kubevault-catalog.enabled | If enabled, installs the kubevault-catalog chart | <code>true</code> |
| kubevault-operator.enabled | If enabled, installs the kubevault-operator chart | <code>true</code> |
| kubevault-webhook-server.enabled | If enabled, installs the kubevault-webhook-server chart | <code>true</code> |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:
Expand Down
7 changes: 0 additions & 7 deletions charts/kubevault/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ properties:
- registryFQDN
- skipDeprecated
type: object
kubevault-crds:
properties:
enabled:
type: boolean
required:
- enabled
type: object
kubevault-operator:
properties:
affinity:
Expand Down
5 changes: 1 addition & 4 deletions charts/kubevault/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ global:
# Only usable when monitoring agent is `prometheus.io/operator`.
labels: {}

kubevault-crds:
# If enabled, installs the kubevault-crds chart
enabled: false
kubevault-catalog:
# If enabled, installs the kubevault-catalog chart
enabled: true
Expand All @@ -49,4 +46,4 @@ kubevault-operator:
enabled: true
kubevault-webhook-server:
# If enabled, installs the kubevault-webhook-server chart
enabled: false
enabled: true

0 comments on commit f07c0de

Please sign in to comment.