-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e84b51
commit ec36344
Showing
8 changed files
with
182 additions
and
3 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 |
---|---|---|
|
@@ -52,6 +52,8 @@ jobs: | |
uses: helm/[email protected] | ||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
with: | ||
version: v0.24.0 | ||
- name: Run tests | ||
run: ./test.sh ${{ matrix.args }} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{- if .Values.networkPolicy.enabled }} | ||
{{- if eq "NodePort" .Values.service.type}} | ||
{{- fail "NetworkPolicy enforcement is not supported with NodePort services, as traffic reaches the Pod through the node itself, bypassing pod-level network controls." }} | ||
{{- end }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: {{ template "trino.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "trino.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: network-policy | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
{{- include "trino.selectorLabels" . | nindent 6 }} | ||
trino.io/network-policy-protection: enabled | ||
policyTypes: | ||
- Ingress | ||
{{- with .Values.networkPolicy.egress }} | ||
- Egress | ||
egress: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
ingress: | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
{{- include "trino.selectorLabels" . | nindent 14 }} | ||
trino.io/network-policy-protection: enabled | ||
namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: {{ .Release.Namespace }} | ||
{{- with .Values.networkPolicy.ingress }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- 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,28 @@ | ||
{{- if .Values.networkPolicy.enabled }} | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ include "trino.fullname" . }}-test-networkpolicy | ||
labels: | ||
{{- include "trino.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: test | ||
test: network-policy | ||
annotations: | ||
"helm.sh/hook": test | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
containers: | ||
- name: check-connection | ||
image: {{ include "trino.image" . }} | ||
command: [ "/bin/bash", "-c" ] | ||
args: | ||
- >- | ||
curl | ||
{{ include "trino.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.port }} | ||
--head | ||
--fail | ||
--connect-timeout 10 | ||
--max-time 10 | ||
2>&1 | grep -q "timed out" | ||
restartPolicy: Never | ||
{{- 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
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