Skip to content

Commit

Permalink
Add static install manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Jogeleit committed May 21, 2021
1 parent af1285c commit 889aaf5
Show file tree
Hide file tree
Showing 18 changed files with 787 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# 1.6.1
* Add .global.fullnameOverride as new configuration for Policy Reporter Helm Chart
* Add static manifests to install Policy Reporter without Helm or Kustomize

# 1.6.0
* Internal refactoring
* Unification of PolicyReports and ClusterPolicyReports processing, APIs still stable
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ helm repo update
helm install policy-reporter policy-reporter/policy-reporter -n policy-reporter --create-namespace
```

### Installation without Helm or Kustomize

To install Policy Reporter without Helm or Kustomize have a look at [manifests](https://github.com/fjogeleit/policy-reporter/tree/main/manifest).

## Policy Reporter UI

You can use the Policy Reporter as standalone Application along with the optional UI SubChart.
Expand Down
10 changes: 5 additions & 5 deletions charts/policy-reporter/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies:
- name: monitoring
repository: ""
version: 1.1.0
version: 1.2.0
- name: ui
repository: ""
version: 1.5.0
version: 1.6.0
- name: kyvernoPlugin
repository: ""
version: 0.1.1
digest: sha256:a80a1c39cbd48116dca9d4d70da23d00456c4e523914a176355c36f0d73ecd1b
generated: "2021-05-12T10:32:58.510553+02:00"
version: 0.2.0
digest: sha256:c32c38e295ebe08651a81937858ba920212bd075aa7605189919c20820067e85
generated: "2021-05-21T10:53:50.045598+02:00"
8 changes: 4 additions & 4 deletions charts/policy-reporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ description: |
It creates Prometheus Metrics and can send rule validation events to different targets like Loki, Elasticsearch, Slack or Discord
type: application
version: 1.6.0
version: 1.6.1
appVersion: 1.6.0

dependencies:
- name: monitoring
condition: monitoring.enabled
repository: ""
version: "1.1.0"
version: "1.2.0"
- name: ui
condition: ui.enabled
repository: ""
version: "1.5.0"
version: "1.6.0"
- name: kyvernoPlugin
condition: kyvernoPlugin.enabled
repository: ""
version: "0.1.1"
version: "0.2.0"
2 changes: 1 addition & 1 deletion charts/policy-reporter/charts/kyvernoPlugin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: kyvernoPlugin
description: Policy Reporter Kyverno Plugin

type: application
version: 0.1.1
version: 0.2.0
appVersion: 0.1.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ If release name contains chart name it will be used as a full name.
*/}}
{{- define "kyvernoplugin.fullname" -}}
{{- $name := "kyverno-plugin" }}
{{- if contains $name .Release.Name }}
{{- if .Values.global.fullnameOverride }}
{{- printf "%s-%s" .Values.global.fullnameOverride $name | trunc 63 | trimSuffix "-" }}
{{- else if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
Expand Down
2 changes: 1 addition & 1 deletion charts/policy-reporter/charts/monitoring/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: monitoring
description: Policy Reporter Monitoring with predefined ServiceMonitor and Grafana Dashboards

type: application
version: 1.1.0
version: 1.2.0
appVersion: 0.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ If release name contains chart name it will be used as a full name.
*/}}
{{- define "monitoring.fullname" -}}
{{- $name := .Chart.Name }}
{{- if contains $name .Release.Name }}
{{- if .Values.global.fullnameOverride }}
{{- printf "%s-%s" .Values.global.fullnameOverride $name | trunc 63 | trimSuffix "-" }}
{{- else if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
Expand Down
2 changes: 2 additions & 0 deletions charts/policy-reporter/charts/monitoring/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace: cattle-dashboards

fullnameOverride: ""

plugins:
kyverno: false

Expand Down
2 changes: 1 addition & 1 deletion charts/policy-reporter/charts/ui/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: ui
description: Policy Reporter UI

type: application
version: 1.5.0
version: 1.6.0
appVersion: 0.10.2
24 changes: 23 additions & 1 deletion charts/policy-reporter/charts/ui/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ If release name contains chart name it will be used as a full name.
*/}}
{{- define "ui.fullname" -}}
{{- $name := .Chart.Name }}
{{- if contains $name .Release.Name }}
{{- if .Values.global.fullnameOverride }}
{{- printf "%s-%s" .Values.global.fullnameOverride $name | trunc 63 | trimSuffix "-" }}
{{- else if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
Expand Down Expand Up @@ -53,3 +55,23 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "ui.kyvernoPluginServiceName" -}}
{{- $name := "kyverno-plugin" }}
{{- if .Values.global.fullnameOverride }}
{{- printf "%s-%s" .Values.global.fullnameOverride $name | trunc 63 | trimSuffix "-" }}
{{- else if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{- define "ui.policyReportServiceName" -}}
{{- $name := .Chart.Name }}
{{- if .Values.global.fullnameOverride }}
{{- .Values.global.fullnameOverride }}
{{- else }}
{{- .Values.global.backend }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/policy-reporter/charts/ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
args:
- -backend=http://{{ .Values.global.backend }}:{{ .Values.global.port }}
- -backend=http://{{ include "ui.policyReportServiceName" . }}:{{ .Values.global.port }}
- -log-size={{ .Values.log.size }}
{{- if or .Values.plugins.kyverno .Values.global.plugins.kyverno }}
- -kyverno-plugin=http://policy-reporter-kyverno-plugin:8080
- -kyverno-plugin=http://{{ include "ui.kyvernoPluginServiceName" . }}:8080
{{- end }}
ports:
- name: http
Expand Down
4 changes: 3 additions & 1 deletion charts/policy-reporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ If release name contains chart name it will be used as a full name.
*/}}
{{- define "policyreporter.fullname" -}}
{{- $name := .Chart.Name }}
{{- if contains $name .Release.Name }}
{{- if .Values.global.fullnameOverride }}
{{- .Values.global.fullnameOverride }}
{{- else if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
Expand Down
1 change: 1 addition & 0 deletions charts/policy-reporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ global:
backend: policy-reporter
# Service Port number
port: 8080
fullnameOverride: ""

# DEPRECTED - Can be removed
# Policy Reporter watches now for both existing versions by default
Expand Down
50 changes: 50 additions & 0 deletions manifest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Installation Manifests for Policy Reporter

You can use this manifests to install Policy Reporter without additional tools like Helm or Kustomize. The manifests are structured into three installations.

The installation requires a `policy-reporter` namespace. Because the installation includes RBAC resources which requires a serviceAccountName and a namespace configuration. The default namespace is `policy-reporter`. If this namespace will be created if it does not exist.

## Policy Reporter

The `policy-reporter` folder is the basic installation for Policy Reporter without the UI. Includes a basic Configuration Secret `policy-reporter-targets`, empty by default and the `http://policy-reporter:2112/metrics` Endpoint.

### Installation

```bash
kubectl apply -f ./manifest/policy-reporter/install.yaml
```

## Default Policy Reporter UI

The `default-policy-reporter-ui` folder is the extended Policy Reporter and the default Policy Reporter UI installation.

Enables:
* Policy Reporter REST API (`http://policy-reporter:8080`)
* Policy Reporter UI Endpoint (`http://policy-reporter-ui:8080`).

Configures Policy Reporter UI as Target for Policy Reporter.

### Installation

```bash
kubectl apply -f ./manifest/default-policy-reporter-ui/install.yaml
```

## Kyverno Policy Reporter UI

The `default-policy-reporter-ui` folder is the extended Policy Reporter, Policy Reporter Kyverno Plugin and the extended Policy Reporter UI installation.

Enables:
* Policy Reporter REST API (`http://policy-reporter:8080`)
* Policy Reporter Metrics API (`http://policy-reporter:2112/metrics`)
* Kyverno Plugin Rest API (`http://policy-reporter-kyverno-plugin:2112/policies`)
* Kyverno Plugin Metrics API (`http://policy-reporter-kyverno-plugin:2113/metrics`)
* Policy Reporter UI Endpoint (`http://policy-reporter-ui:8080`).

Configures Policy Reporter UI as Target for Policy Reporter and enables the Kyverno Dashboard.

### Installation

```bash
kubectl apply -f ./manifest/kyverno-policy-reporter-ui/install.yaml
```

0 comments on commit 889aaf5

Please sign in to comment.