-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor broker deployment
- Loading branch information
Showing
15 changed files
with
279 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v2 | ||
name: "wiz-broker-v2" | ||
description: Wiz Broker for tunneling http traffic to Wiz backend | ||
|
||
type: application | ||
|
||
version: 1.0.0 | ||
appVersion: "2.0.162274" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "wiz-broker.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "wiz-broker.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "wiz-broker.labels" -}} | ||
helm.sh/chart: {{ include "wiz-broker.chart" . }} | ||
{{ include "wiz-broker.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- if .Values.commonLabels }} | ||
{{- range $index, $content := .Values.commonLabels }} | ||
{{ $index }}: {{ tpl $content $ }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "wiz-broker.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "wiz-broker.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create Wiz broker properties to use | ||
*/}} | ||
|
||
{{- define "wiz-broker.wizConnectorSecretData" -}} | ||
{{- if not .Values.global.autoCreateConnector }} | ||
CONNECTOR_ID: {{ required "A valid .Values.global.wizConnector.connectorId entry required!" .Values.global.wizConnector.connectorId | quote}} | ||
CONNECTOR_TOKEN: {{ required "A valid .Values.global.wizConnector.connectorToken entry required!" .Values.global.wizConnector.connectorToken | quote }} | ||
TARGET_DOMAIN: {{ required "A valid .Values.global.wizConnector.targetDomain entry required!" .Values.global.wizConnector.targetDomain | quote }} | ||
TARGET_IP: {{ required "A valid .Values.global.wizConnector.targetIp entry required!" .Values.global.wizConnector.targetIp | quote }} | ||
TARGET_PORT: {{ required "A valid .Values.global.wizConnector.targetPort entry required!" .Values.global.wizConnector.targetPort | quote }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Secrets names | ||
*/}} | ||
|
||
{{- define "wiz-broker.apiTokenSecretName" -}} | ||
{{ coalesce (.Values.global.wizApiToken.secret.name) (printf "%s-api-token" .Release.Name) }} | ||
{{- end }} | ||
|
||
{{- define "wiz-broker.proxySecretName" -}} | ||
{{ coalesce (.Values.global.httpProxyConfiguration.secretName) (printf "%s-proxy-configuration" .Release.Name) }} | ||
{{- end }} | ||
|
||
{{- define "wiz-broker.connectorSecretName" -}} | ||
{{ coalesce (.Values.global.wizConnector.secretName) (printf "%s-connector" .Release.Name) }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.global.httpProxyConfiguration.enabled }} | ||
{{- if .Values.global.httpProxyConfiguration.create }} | ||
apiVersion: v1 | ||
kind: Secret | ||
type: Opaque | ||
metadata: | ||
name: {{ include "wiz-broker.proxySecretName" . | trim }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
{{- with .Values.global.httpProxyConfiguration.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
labels: | ||
{{- include "wiz-broker.labels" . | nindent 4 }} | ||
data: | ||
httpProxy: {{ .Values.global.httpProxyConfiguration.httpProxy | b64enc | quote }} | ||
httpsProxy: {{ .Values.global.httpProxyConfiguration.httpsProxy | b64enc | quote }} | ||
noProxyAddress: {{ .Values.global.httpProxyConfiguration.noProxyAddress | b64enc | quote }} | ||
{{- end }} | ||
{{- end }} |
6 changes: 3 additions & 3 deletions
6
...tor/templates/service-account-broker.yaml → wiz-broker-v2/templates/serviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Default values for wiz-broker. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
# override default application name | ||
nameOverride: "wiz-broker" | ||
|
||
serviceAccount: | ||
# Specifies whether a service account should be created | ||
create: true | ||
|
||
# Annotations to add to the service account | ||
annotations: {} | ||
|
||
# The name of the service account to use. | ||
# If not set and create is true, a name is generated using the fullname template | ||
name: "wiz-broker" | ||
|
||
# Create RBAC resources for our service account. | ||
# Needed to fetch kubernetes metadata from the api-server | ||
rbac: true | ||
|
||
image: | ||
registry: wiziopublic.azurecr.io/wiz-app | ||
repository: wiz-broker | ||
pullPolicy: IfNotPresent | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "" | ||
imagePullSecrets: [] | ||
|
||
broker: | ||
enabled: true | ||
targetIp: "" | ||
podCustomEnvironmentVariablesFile: "" | ||
|
||
customVolumes: [] | ||
customVolumeMounts: [] | ||
|
||
podAnnotations: {} | ||
|
||
podSecurityContext: | ||
runAsNonRoot: true | ||
runAsUser: 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.