Skip to content

Commit

Permalink
Merge pull request #2 from metalstormbass/mike-dev
Browse files Browse the repository at this point in the history
Fixed Bugs in Secrets / Updated Documentation
  • Loading branch information
yeforriak authored Apr 21, 2022
2 parents 81b23fa + d206495 commit 2c9dbeb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 51 deletions.
41 changes: 3 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This is a Helm Chart to deploy the [Snyk Broker](https://github.com/snyk/broker)
## Usage

To add this chart, you can add the repo:
```helm repo add snyk-broker https://metalstormbass.github.io/snyk-broker-helm/```
```helm repo add snyk-broker https://snyk.github.io/snyk-broker-helm/```

In which case instead of ```helm install snyk-broker-chart .``` you would instead use ```helm install snyk-broker-chart snyk-broker``` for all the commands below.

Expand Down Expand Up @@ -156,12 +156,12 @@ helm install snyk-broker-chart . \
--set scmToken=<ENTER_SCM_TOKEN> \
--set gitlab=<ENTER_GITLAB_URL> \
--set acceptJsonFile=accept.json \
--set brokerClientUrl=http://<ENTER_SCM_TYPE>-broker-service:8000 \
--set brokerClientUrl=http://<BROKER_CLIENT_URL> \
--set enableCodeAgent=true \
--set snykToken=<ENTER_SNYK_TOKEN> \
-n snyk-broker --create-namespace
```
<b>Note: Leave the ```brokerClientUrl``` value as it is. Also, the accept.json must be in the same directory as the helm chart</b>
<b>Note: The ```brokerClientUrl``` is going to be the address of the Broker Container. The default port for the broker container is ```8000```. See the values file for more information. Also, the accept.json must be in the same directory as the helm chart</b>

## Adding accept.json

Expand Down Expand Up @@ -256,41 +256,6 @@ data:
<ENTER_SCM_TYPE>-token-key: <BASE64_ENCODED_SECRET>
```

### Bitbucket Password

```
apiVersion: v1
kind: Secret
metadata:
name: bitbucketpassword
type: Opaque
data:
"bitbucketPassword": <BASE64_ENCODED_SECRET>
```

### Jira Password

```
apiVersion: v1
kind: Secret
metadata:
name: jirapassword
type: Opaque
data:
"jiraPassword": <BASE64_ENCODED_SECRET>
```

### Container Registry Secret

```
apiVersion: v1
kind: Secret
metadata:
name: crpassword
type: Opaque
data:
"crPassword": <BASE64_ENCODED_SECRET>
```

## Service Accounts

Expand Down
2 changes: 1 addition & 1 deletion charts/snyk-broker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.6
version: 1.1.7

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
12 changes: 6 additions & 6 deletions charts/snyk-broker/templates/broker_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ spec:
- name: BITBUCKET_PASSWORD
valueFrom:
secretKeyRef:
name: bitbucketpassword
key: bitbucketPassword
name: {{ .Values.scmType}}-token
key: "{{ .Values.scmType}}-token-key"
- name: BITBUCKET
value: {{ .Values.bitbucket }}
- name: BITBUCKET_API
Expand Down Expand Up @@ -190,8 +190,8 @@ spec:
- name: JIRA_PASSWORD
valueFrom:
secretKeyRef:
name: jirapassword
key: jiraPassword
name: {{ .Values.scmType}}-token
key: "{{ .Values.scmType}}-token-key"
- name: JIRA_HOSTNAME
value: {{ .Values.jiraHostname }}
- name: PORT
Expand All @@ -217,8 +217,8 @@ spec:
- name: CR_PASSWORD
valueFrom:
secretKeyRef:
name: crpassword
key: crPassword
name: {{ .Values.scmType}}-token
key: "{{ .Values.scmType}}-token-key"
- name: PORT
value: {{ .Values.deployment.container.containerPort | squote }}
- name: BROKER_CLIENT_URL
Expand Down
22 changes: 16 additions & 6 deletions charts/snyk-broker/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,40 @@ data:
apiVersion: v1
kind: Secret
metadata:
name: bitbucketpassword
name: {{ .Values.scmType}}-token
type: Opaque
data:
"bitbucketPassword": {{ .Values.bitbucketPassword | b64enc | quote }}
"{{ .Values.scmType}}-token-key": {{ .Values.bitbucketPassword | b64enc | quote }}
---
{{- end }}
{{- if .Values.azureReposToken }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.scmType}}-token
type: Opaque
data:
"{{ .Values.scmType}}-token-key": {{ .Values.azureReposToken | b64enc | quote }}
---
{{- end }}
{{- if .Values.jiraPassword }}
apiVersion: v1
kind: Secret
metadata:
name: jirapassword
name: {{ .Values.scmType}}-token
type: Opaque
data:
"jiraPassword": {{ .Values.jiraPassword | b64enc | quote }}
"{{ .Values.scmType}}-token-key": {{ .Values.jiraPassword | b64enc | quote }}
---
{{- end }}
{{- if .Values.crPassword }}
apiVersion: v1
kind: Secret
metadata:
name: crpassword
name: {{ .Values.scmType}}-token
type: Opaque
data:
"crPassword": {{ .Values.crPassword | b64enc | quote }}
"{{ .Values.scmType}}-token-key": {{ .Values.crPassword | b64enc | quote }}
---
{{- end }}
{{- if .Values.snykToken }}
Expand Down

0 comments on commit 2c9dbeb

Please sign in to comment.