Skip to content

Commit

Permalink
Merge pull request #80 from snyk/fix/typo-in-ingress
Browse files Browse the repository at this point in the history
fix: ingress name updating avoiding single ns collision
  • Loading branch information
aarlaud authored Sep 27, 2023
2 parents d16b861 + c0bd893 commit abf2d26
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 23 deletions.
2 changes: 1 addition & 1 deletion charts/snyk-broker/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: snyk-broker
version: 2.0.0
version: 2.0.1
description: A Helm chart for Kubernetes
type: application
5 changes: 3 additions & 2 deletions charts/snyk-broker/templates/broker_ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{{- $ingressPath := .Values.brokerIngress.path -}}
{{- $ingressPathType := .Values.brokerIngress.pathType -}}
{{- $extraPaths := .Values.brokerIngress.extraPaths -}}
{{- $releaseName := .Release.Name -}}
apiVersion: {{ include "snyk-broker.ingress.apiVersion" . }}
kind: Ingress
metadata:
Expand Down Expand Up @@ -48,11 +49,11 @@ spec:
backend:
{{- if $ingressApiIsStable }}
service:
name: {{ $scmType }}-broker-service-{{ .Release.Name }}
name: {{ $scmType }}-broker-service-{{ $releaseName }}
port:
number: {{ $servicePort }}
{{- else }}
serviceName: {{ $scmType }}-broker-service-{{ .Release.Name }}
serviceName: {{ $scmType }}-broker-service-{{ $releaseName }}
servicePort: {{ $servicePort }}
{{- end }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -111,7 +111,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -153,7 +153,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: RELEASE-NAME-snyk-broker-cacert-configmap-RELEASE-NAME
namespace: NAMESPACE
4: |
Expand All @@ -172,7 +172,7 @@ cacert:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
cacertfile:
Expand All @@ -184,7 +184,7 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -280,7 +280,7 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand All @@ -301,7 +301,7 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: RELEASE-NAME-snyk-broker-cacert-configmap-RELEASE-NAME
namespace: NAMESPACE
4: |
Expand All @@ -320,6 +320,6 @@ cacertfile:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
ingress:
1: |
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
template:
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
spec:
containers:
- env:
- name: BROKER_SERVER_URL
value: https://broker.test.snyk.io
- name: BROKER_HEALTHCHECK_PATH
value: /healthcheck
- name: BROKER_SYSTEMCHECK_PATH
value: /systemcheck
- name: BROKER_TOKEN
valueFrom:
secretKeyRef:
key: github-com-broker-token-key
name: github-com-broker-token-RELEASE-NAME
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
key: github-com-token-key
name: github-com-token-RELEASE-NAME
- name: PORT
value: "8000"
- name: BROKER_CLIENT_URL
value: http://brokerclient
- name: LOG_LEVEL
value: info
- name: LOG_ENABLE_BODY
value: "false"
- name: ACCEPT_CODE
value: "true"
- name: ACCEPT_IAC
value: tf,yaml,yml,json,tpl
- name: BROKER_DISPATCHER_BASE_URL
value: https://api.test.snyk.io
image: snyk/broker:github-com
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthcheck
port: 8000
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 1
name: github-com-broker-RELEASE-NAME
ports:
- containerPort: 8000
name: http
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthcheck
port: 8000
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 1
resources:
limits:
cpu: 1
memory: 256Mi
requests:
cpu: 1
memory: 256Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
volumeMounts: null
securityContext: {}
serviceAccountName: snyk-broker-RELEASE-NAME
volumes: null
2: |
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.1
name: RELEASE-NAME-snyk-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
rules:
- host: <ENTER_BROKER_CLIENT_URL>
http:
paths:
- backend:
serviceName: github-com-broker-service-RELEASE-NAME
servicePort: 8000
path: /
3: |
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
ports:
- port: 8000
targetPort: 8000
selector:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
type: ClusterIP
4: |
apiVersion: v1
data:
github-com-broker-token-key: MTIz
kind: Secret
metadata:
name: github-com-broker-token-RELEASE-NAME
type: Opaque
5: |
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.1
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ HA mode on:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -105,7 +105,7 @@ HA mode on:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand All @@ -132,7 +132,7 @@ HA mode on:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
HA mode on with 4 replicas:
Expand All @@ -144,7 +144,7 @@ HA mode on with 4 replicas:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -242,7 +242,7 @@ HA mode on with 4 replicas:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand All @@ -269,7 +269,7 @@ HA mode on with 4 replicas:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
default values:
Expand All @@ -281,7 +281,7 @@ default values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -377,7 +377,7 @@ default values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand All @@ -404,7 +404,7 @@ default values:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
preflight checks off:
Expand All @@ -416,7 +416,7 @@ preflight checks off:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand Down Expand Up @@ -514,7 +514,7 @@ preflight checks off:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: github-com-broker-service-RELEASE-NAME
namespace: NAMESPACE
spec:
Expand All @@ -541,6 +541,6 @@ preflight checks off:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: snyk-broker-RELEASE-NAME
helm.sh/chart: snyk-broker-2.0.0
helm.sh/chart: snyk-broker-2.0.1
name: snyk-broker-RELEASE-NAME
namespace: NAMESPACE
16 changes: 16 additions & 0 deletions charts/snyk-broker/tests/broker_deployment_ingress_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
suite: test broker deployment with ingress
templates:
- broker_deployment.yaml
- broker_service.yaml
- secrets.yaml
- serviceaccount.yaml
- broker_ingress.yaml

tests:
- it: ingress
values:
- ./fixtures/default_values_with_ingress.yaml
asserts:
- matchSnapshot: {}


Loading

0 comments on commit abf2d26

Please sign in to comment.