Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e0be114
[feature]: Added support for external DNS using dns endpoint
sebasnallar Sep 22, 2025
ee523fd
[feature]: waiting on balancer recognition for route
sebasnallar Sep 22, 2025
44d4d89
[chore]: rename dns type to 'external_dns' in mninus
sebasnallar Sep 22, 2025
eae23d0
[chore]: merge beta
sebasnallar Sep 22, 2025
acf9491
[chore]: revert values.yaml
sebasnallar Sep 23, 2025
b4f040f
[chore]: get information from providers for gateways
sebasnallar Sep 23, 2025
3b5f118
[chore]: rework, we now apply the dns ednpoint only on scope creation
sebasnallar Sep 23, 2025
38fe2a8
[chore]: rework, we now apply the dns ednpoint only on scope creation
sebasnallar Sep 23, 2025
abf20f7
[chore]: pr review
sebasnallar Sep 25, 2025
ea66943
[feature] define a component name with maximum 63 characters based on…
fedemaleh Sep 26, 2025
e20732c
Merge pull request #56 from nullplatform/features/external-dns
sebasnallar Sep 29, 2025
9f4f1ba
feat: log improvements (#58)
javi-null Sep 29, 2025
0adcfed
[fixes][route53]: we create the record on both hosted zones
sebasnallar Sep 29, 2025
a9c81d3
Merge pull request #63 from nullplatform/fixes/dns-records-both-zones
sebasnallar Sep 30, 2025
0f502eb
[feature] ignore not found errors when deleting k8s objects
fedemaleh Oct 1, 2025
e22ded8
Merge pull request #66 from nullplatform/feature/safe-delete
fedemaleh Oct 1, 2025
d81b127
[feature] set default memory to 128 MB
fedemaleh Oct 1, 2025
ad81efd
Merge pull request #67 from nullplatform/config/default-memory
fedemaleh Oct 1, 2025
901ae15
Merge pull request #62 from nullplatform/feature/component-name
fedemaleh Oct 3, 2025
89a0026
[feature] Add missing labels to k8s objects + Allow to delete extra g…
fedemaleh Oct 6, 2025
c65fbbc
feat: add Pod Disruption Budget (PDB) support (#64)
sebasnallar Oct 6, 2025
c343b4f
[feature]: private and public domains (#65)
sebasnallar Oct 6, 2025
a80f5f9
[feature] add support for web sockets inbound traffic (#69)
fedemaleh Oct 7, 2025
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Logs
logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
Expand Down
69 changes: 55 additions & 14 deletions azure/specs/service-spec.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"fixed_instances",
"scheduled_stop",
"additional_ports",
"protocol",
"continuous_delivery"
],
"uiSchema":{
Expand Down Expand Up @@ -101,10 +102,6 @@
"type":"Control",
"scope":"#/properties/autoscaling/properties/target_cpu_utilization"
},
{
"type": "Control",
"scope": "#/properties/autoscaling/properties/target_memory_enabled"
},
{
"rule": {
"effect": "SHOW",
Expand Down Expand Up @@ -170,6 +167,19 @@
}
]
},
{
"type": "Category",
"label": "Protocol",
"elements": [
{
"type": "Control",
"scope": "#/properties/protocol",
"options": {
"format": "radio"
}
}
]
},
{
"type":"Category",
"label":"Continuous deployment",
Expand Down Expand Up @@ -333,7 +343,7 @@
}
],
"title":"RAM Memory",
"default":64,
"default":128,
"description":"Amount of RAM memory to allocate to the container (in MB)"
},
"visibility":{
Expand Down Expand Up @@ -382,17 +392,17 @@
"description":"CPU utilization threshold that triggers scaling"
},
"target_memory_enabled": {
"type": "boolean",
"title": "Scale by memory",
"default": false
"type": "boolean",
"title": "Scale by memory",
"default": false
},
"target_memory_utilization": {
"type": "integer",
"title": "Target memory utilization (%)",
"default": 70,
"maximum": 90,
"minimum": 30,
"description": "Memory utilization threshold that triggers scaling"
"type": "integer",
"title": "Target memory utilization (%)",
"default": 70,
"maximum": 90,
"minimum": 50,
"description": "Memory utilization threshold that triggers scaling"
}
}
},
Expand Down Expand Up @@ -539,6 +549,7 @@
],
"type":"string",
"title":"Port Type",
"default": "GRPC",
"description":"The protocol type for this port"
}
}
Expand Down Expand Up @@ -576,6 +587,36 @@
}
},
"description":"Configure automatic deployment from Git branches"
},
"custom_domains": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean",
"default": true
}
}
},
"protocol": {
"type": "string",
"oneOf": [
{
"const": "http",
"title": "HTTP connections",
"description": "Enable http web server"
},
{
"const": "web_sockets",
"title": "Web sockets",
"description": "Enable web sockets connections"
}
],
"title": "Protocol",
"default": "http",
"description": "Define the inbound traffic the application will accept"
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion k8s/apply_templates
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ while IFS= read -r TEMPLATE_FILE; do
echo "kubectl $ACTION $TEMPLATE_FILE"

if [[ "$DRY_RUN" == "false" ]]; then
kubectl "$ACTION" -f "$TEMPLATE_FILE"
IGNORE_NOT_FOUND=""

if [[ "$ACTION" == "delete" ]]; then
IGNORE_NOT_FOUND="--ignore-not-found=true"
fi

kubectl "$ACTION" -f "$TEMPLATE_FILE" $IGNORE_NOT_FOUND
fi

BASE_DIR="$(dirname "$TEMPLATE_FILE")"
Expand Down
20 changes: 18 additions & 2 deletions k8s/deployment/build_context
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,19 @@ fi
IMAGE_PULL_SECRETS="${IMAGE_PULL_SECRETS:-"{}"}"
IMAGE_PULL_SECRETS=$(echo "$IMAGE_PULL_SECRETS" | jq .)

TRAFFIC_CONTAINER_IMAGE=${TRAFFIC_CONTAINER_IMAGE:-"public.ecr.aws/nullplatform/k8s-traffic-manager:latest"}
SCOPE_TRAFFIC_PROTOCOL=$(echo "$CONTEXT" | jq -r .scope.capabilities.protocol)

TRAFFIC_CONTAINER_VERSION="latest"

if [[ "$SCOPE_TRAFFIC_PROTOCOL" == "web_sockets" ]]; then
TRAFFIC_CONTAINER_VERSION="websocket2"
fi

TRAFFIC_CONTAINER_IMAGE=${TRAFFIC_CONTAINER_IMAGE:-"public.ecr.aws/nullplatform/k8s-traffic-manager:$TRAFFIC_CONTAINER_VERSION"}

# Pod Disruption Budget configuration
PDB_ENABLED=${POD_DISRUPTION_BUDGET_ENABLED:-"false"}
PDB_MAX_UNAVAILABLE=${POD_DISRUPTION_BUDGET_MAX_UNAVAILABLE:-"25%"}

CONTEXT=$(echo "$CONTEXT" | jq \
--arg blue_deployment_id "$BLUE_DEPLOYMENT_ID" \
Expand All @@ -45,12 +57,16 @@ CONTEXT=$(echo "$CONTEXT" | jq \
--arg total_replicas "$REPLICAS" \
--arg traffic_image "$TRAFFIC_CONTAINER_IMAGE" \
--argjson pull_secrets "$IMAGE_PULL_SECRETS" \
--arg pdb_enabled "$PDB_ENABLED" \
--arg pdb_max_unavailable "$PDB_MAX_UNAVAILABLE" \
'. + {blue_deployment_id: $blue_deployment_id,
blue_replicas: $blue_replicas,
green_replicas: $green_replicas,
total_replicas: $total_replicas,
pull_secrets: $pull_secrets,
traffic_image: $traffic_image
traffic_image: $traffic_image,
pdb_enabled: $pdb_enabled,
pdb_max_unavailable: $pdb_max_unavailable
}')

DEPLOYMENT_ID=$(echo "$CONTEXT" | jq -r '.deployment.id')
Expand Down
16 changes: 15 additions & 1 deletion k8s/deployment/build_deployment
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ DEPLOYMENT_PATH="$OUTPUT_DIR/deployment-$SCOPE_ID-$DEPLOYMENT_ID.yaml"
SECRET_PATH="$OUTPUT_DIR/secret-$SCOPE_ID-$DEPLOYMENT_ID.yaml"
SCALING_PATH="$OUTPUT_DIR/scaling-$SCOPE_ID-$DEPLOYMENT_ID.yaml"
SERVICE_TEMPLATE_PATH="$OUTPUT_DIR/service-$SCOPE_ID-$DEPLOYMENT_ID.yaml"
PDB_PATH="$OUTPUT_DIR/pdb-$SCOPE_ID-$DEPLOYMENT_ID.yaml"
CONTEXT_PATH="$OUTPUT_DIR/context-$SCOPE_ID.json"

echo "$CONTEXT" | jq --arg replicas "$REPLICAS" --arg service_account_name "$SERVICE_ACCOUNT_NAME" '. + {replicas: $replicas, service_account_name: $service_account_name}' > "$CONTEXT_PATH"
Expand Down Expand Up @@ -94,7 +95,20 @@ gomplate -c .="$CONTEXT_PATH" \
TEMPLATE_GENERATION_STATUS=$?

if [[ $TEMPLATE_GENERATION_STATUS -ne 0 ]]; then
echo "Error building scaling template"
echo "Error building service template"
exit 1
fi

echo "Building Template: $PDB_TEMPLATE to $PDB_PATH"

gomplate -c .="$CONTEXT_PATH" \
--file "$PDB_TEMPLATE" \
--out "$PDB_PATH"

TEMPLATE_GENERATION_STATUS=$?

if [[ $TEMPLATE_GENERATION_STATUS -ne 0 ]]; then
echo "Error building PDB template"
exit 1
fi

Expand Down
10 changes: 10 additions & 0 deletions k8s/deployment/delete_cluster_objects
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

DEPLOYMENT_TO_CLEAN="$DEPLOYMENT_ID"

if [ "$DEPLOYMENT" = "blue" ]; then
DEPLOYMENT_TO_CLEAN=$(echo "$CONTEXT" | jq .scope.current_active_deployment -r)
fi

kubectl delete deployment,service,hpa,ingress,pdb,secret,configmap \
-l deployment_id="$DEPLOYMENT_TO_CLEAN" -n "$K8S_NAMESPACE" --cascade=foreground --wait=true
11 changes: 10 additions & 1 deletion k8s/deployment/templates/deployment.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ metadata:
labels:
name: d-{{ .scope.id }}-{{ .deployment.id }}
app.kubernetes.io/part-of: {{ .namespace.slug }}
account: {{ .account.slug }}
account_id: "{{ .account.id }}"
namespace: {{ .namespace.slug }}
namespace_id: "{{ .namespace.id }}"
application: {{ .application.slug }}
application_id: "{{ .application.id }}"
scope: {{ .scope.slug }}
scope_id: "{{ .scope.id }}"
deployment_id: "{{ .deployment.id }}"
spec:
replicas: {{ .replicas }}
selector:
Expand All @@ -39,7 +48,7 @@ spec:
metadata:
labels:
name: d-{{ .scope.id }}-{{ .deployment.id }}
app.kubernetes.io/part-of: {{ .namespace.slug }}-{{ .application.slug }}
app.kubernetes.io/part-of: {{ .component }}
nullplatform: "true"
account: "{{ .account.slug }}"
account_id: "{{ .account.id }}"
Expand Down
22 changes: 22 additions & 0 deletions k8s/deployment/templates/dns-endpoint.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
name: k-8-s-{{ .scope.slug }}-{{ .scope.id }}-dns
namespace: {{ .k8s_namespace }}
labels:
nullplatform: "true"
account: {{ .account.slug }}
account_id: "{{ .account.id }}"
namespace: {{ .namespace.slug }}
namespace_id: "{{ .namespace.id }}"
application: {{ .application.slug }}
application_id: "{{ .application.id }}"
scope: {{ .scope.slug }}
scope_id: "{{ .scope.id }}"
spec:
endpoints:
- dnsName: {{ .scope.domain }}
recordTTL: 60
recordType: A
targets:
- "{{ .gateway_ip }}"
2 changes: 1 addition & 1 deletion k8s/deployment/templates/istio/service.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: {{ .k8s_namespace }}
labels:
name: d-{{ .scope.id }}-{{ .deployment.id }}
app.kubernetes.io/part-of: {{ .namespace.slug }}-{{ .application.slug }}
app.kubernetes.io/part-of: {{ .component }}
app.kubernetes.io/component: application
app.kubernetes.io/instance: {{ .scope.slug }}
app.kubernetes.io/name: {{ .scope.slug }}
Expand Down
53 changes: 53 additions & 0 deletions k8s/deployment/templates/pdb.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{{if eq .pdb_enabled "true"}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: pdb-d-{{ .scope.id }}-{{ .deployment.id }}
namespace: {{ .k8s_namespace }}
labels:
name: pdb-d-{{ .scope.id }}-{{ .deployment.id }}
app.kubernetes.io/part-of: {{ .namespace.slug }}-{{ .application.slug }}
app.kubernetes.io/component: application
app.kubernetes.io/instance: {{ .scope.slug }}
app.kubernetes.io/name: {{ .scope.slug }}
{{- $global := index .k8s_modifiers "global" }}
{{- if $global }}
{{- $labels := index $global "labels" }}
{{- if $labels }}
{{ data.ToYAML $labels | indent 4 }}
{{- end }}
{{- end }}
{{- $pdb := index .k8s_modifiers "pdb" }}
{{- if $pdb }}
{{- $labels := index $pdb "labels" }}
{{- if $labels }}
{{ data.ToYAML $labels | indent 4 }}
{{- end }}
{{- end }}
annotations:
nullplatform.com/managed-by: nullplatform
nullplatform.com/account: {{ .account.slug }}
nullplatform.com/namespace: {{ .namespace.slug }}
nullplatform.com/application: {{ .application.slug }}
nullplatform.com/scope: {{ .scope.slug }}
nullplatform.com/deployment-id: "{{ .deployment.id }}"
{{- $global := index .k8s_modifiers "global" }}
{{- if $global }}
{{- $annotations := index $global "annotations" }}
{{- if $annotations }}
{{ data.ToYAML $annotations | indent 4 }}
{{- end }}
{{- end }}
{{- $pdb := index .k8s_modifiers "pdb" }}
{{- if $pdb }}
{{- $annotations := index $pdb "annotations" }}
{{- if $annotations }}
{{ data.ToYAML $annotations | indent 4 }}
{{- end }}
{{- end }}
spec:
maxUnavailable: {{ .pdb_max_unavailable }}
selector:
matchLabels:
app: d-{{ .scope.id }}-{{ .deployment.id }}
{{- end }}
12 changes: 12 additions & 0 deletions k8s/deployment/templates/scaling.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ kind: HorizontalPodAutoscaler
metadata:
name: hpa-d-{{ .scope.id }}-{{ .deployment.id }}
namespace: {{ .k8s_namespace }}
labels:
name: d-{{ .scope.id }}-{{ .deployment.id }}
app.kubernetes.io/part-of: {{ .namespace.slug }}
account: {{ .account.slug }}
account_id: "{{ .account.id }}"
namespace: {{ .namespace.slug }}
namespace_id: "{{ .namespace.id }}"
application: {{ .application.slug }}
application_id: "{{ .application.id }}"
scope: {{ .scope.slug }}
scope_id: "{{ .scope.id }}"
deployment_id: "{{ .deployment.id }}"
spec:
scaleTargetRef:
apiVersion: apps/v1
Expand Down
Loading