Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/__need-fix-to-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ permissions:
contents: read
issues: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@9a3d71ca9f68bc1061db8ea1442084ac31a0f8bf # 0.23.0
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
# FIXME: re-enable the following checks
linter-env: |
VALIDATE_KUBERNETES_KUBECONFORM=false
VALIDATE_CHECKOV=false
VALIDATE_JAVASCRIPT_PRETTIER=false

test-action-docker-build-image:
Expand Down
6 changes: 3 additions & 3 deletions actions/helm/parse-chart-uri/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ This action does not requires any permissions.

<!-- start inputs -->

| **Input** | **Description** | **Default** | **Required** |
| ---------------- | ------------------ | ----------- | ------------ |
| <code>uri</code> | Chart URI to parse | | **true** |
| **Input** | **Description** | **Default** | **Required** |
| ------------------ | ------------------ | ----------- | ------------ |
| <code>`uri`</code> | Chart URI to parse | | **true** |

<!-- end inputs -->
<!-- start outputs -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
kind: ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "app.fullname" . }}-config
namespace: {{ .Values.namespace }}
name: {{ include "app.fullname" . }}-config
namespace: {{ .Values.namespace | default "app-system" }}
labels:
{{- include "app.labels" . | nindent 4 }}
data:
{{- with .Values.application }}
{{- with .Values.app }}
DB_CONNECTION: {{ .dbConnection | quote }}
DB_HOST: {{ .dbHost | quote }}
DB_PORT: {{ .dbPort | quote }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "app.fullname" . }}
namespace: {{ .Values.namespace }}
namespace: {{ .Values.namespace | default "app-system" }}
labels:
{{- include "app.labels" . | nindent 4 }}
spec:
Expand Down Expand Up @@ -34,7 +34,11 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- if .Values.image.digest }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}@{{ .Values.image.digest }}"
{{- else }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- configMapRef:
Expand Down
11 changes: 8 additions & 3 deletions tests/charts/umbrella-application/charts/app/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
{{- if .Values.autoscaling.enabled }}
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "app.fullname" . }}
namespace: {{ .Values.namespace | default "app-system" }}
labels:
{{- include "app.labels" . | nindent 4 }}
spec:
Expand All @@ -18,12 +19,16 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ .Values.namespace | default "app-system" }}
labels:
{{- include "app.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{- if .Values.networkPolicy.enabled }}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "app.fullname" . }}
namespace: {{ .Values.namespace | default "app-system" }}
labels:
{{- include "app.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "app.selectorLabels" . | nindent 6 }}
policyTypes:
- Ingress
- Egress
ingress:
{{- if .Values.networkPolicy.ingress }}
{{- range .Values.networkPolicy.ingress }}
- {{- toYaml . | nindent 6 }}
{{- end }}
{{- else }}
# Default: Allow ingress from any pod in the same namespace on HTTP port
- from:
- namespaceSelector: {}
ports:
- protocol: TCP
port: 8080
{{- end }}
egress:
{{- if .Values.networkPolicy.egress }}
{{- range .Values.networkPolicy.egress }}
- {{- toYaml . | nindent 6 }}
{{- end }}
{{- else }}
# Default: Allow egress to DNS and MySQL
- to: []
ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
- to:
- podSelector:
matchLabels:
app.kubernetes.io/name: mysql
ports:
- protocol: TCP
port: 3306
# Allow HTTPS for external API calls
- to: []
ports:
- protocol: TCP
port: 443
- protocol: TCP
port: 80
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "app.fullname" . }}
namespace: {{ .Values.namespace }}
labels: {{- include "app.labels" . | nindent 4 }}
namespace: {{ .Values.namespace | default "app-system" }}
labels:
{{- include "app.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{- if .Values.serviceAccount.create -}}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "app.serviceAccountName" . }}
namespace: {{ .Values.namespace }}
namespace: {{ .Values.namespace | default "app-system" }}
labels:
{{- include "app.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
Expand Down
13 changes: 12 additions & 1 deletion tests/charts/umbrella-application/charts/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
---
# Namespace for the application (defaults to "app-system" if not specified)
namespace: "app-system"

app:
dbConnection: mysql
dbHost: "mysql"
Expand Down Expand Up @@ -88,14 +91,22 @@ autoscaling:
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity: {}

# Network Policy configuration
networkPolicy:
enabled: true
# Custom ingress rules (optional)
ingress: []
# Custom egress rules (optional)
egress: []

# chart dependencies
mysql:
fullnameOverride: mysql
Expand Down
Loading