Skip to content

Commit

Permalink
Add name in ports service & remove ownerId (Qovery#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe authored Nov 16, 2021
1 parent b22a750 commit 32107f8
Show file tree
Hide file tree
Showing 17 changed files with 9 additions and 51 deletions.
4 changes: 1 addition & 3 deletions lib/aws/charts/q-application/templates/deployment.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand All @@ -22,14 +21,12 @@ spec:
{% endif %}
selector:
matchLabels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
template:
metadata:
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down Expand Up @@ -67,6 +64,7 @@ spec:
{%- if private_port %}
ports:
- containerPort: {{ private_port }}
name: "p{{ private_port }}"
protocol: TCP
readinessProbe:
tcpSocket:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
name: {{ sanitized_name }}-default
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
appId: {{ id }}
app: {{ sanitized_name }}
envId: {{ environment_id }}
Expand All @@ -15,7 +14,6 @@ spec:
matchLabels:
appId: {{ id }}
app: {{ sanitized_name }}
ownerId: {{ owner_id }}
envId: {{ environment_id }}
policyTypes:
- Ingress
Expand All @@ -26,7 +24,6 @@ metadata:
name: {{ sanitized_name }}-app-access
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
appId: {{ id }}
app: {{ sanitized_name }}
envId: {{ environment_id }}
Expand All @@ -36,14 +33,12 @@ spec:
matchLabels:
appId: {{ id }}
app: {{ sanitized_name }}
ownerId: {{ owner_id }}
envId: {{ environment_id }}
ingress:
# Allow ingress from same environment
- from:
- podSelector:
matchLabels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}

# Allow ingress from everywhere but only to application port
Expand Down Expand Up @@ -76,7 +71,6 @@ metadata:
name: {{ sanitized_name }}-deny-aws-metadata-server
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
appId: {{ id }}
app: {{ sanitized_name }}
envId: {{ environment_id }}
Expand All @@ -85,7 +79,6 @@ spec:
matchLabels:
appId: {{ id }}
app: {{ sanitized_name }}
ownerId: {{ owner_id }}
envId: {{ environment_id }}
egress:
- to:
Expand Down
2 changes: 0 additions & 2 deletions lib/aws/charts/q-application/templates/pdb.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
spec:
minAvailable: 1
selector:
matchLabels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down
1 change: 0 additions & 1 deletion lib/aws/charts/q-application/templates/secret.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down
3 changes: 1 addition & 2 deletions lib/aws/charts/q-application/templates/service.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
appId: {{ id }}
app: {{ sanitized_name }}
envId: {{ environment_id }}
spec:
type: ClusterIP
ports:
- protocol: TCP
name: "p{{ private_port }}"
port: {{ private_port }}
targetPort: {{ private_port }}
selector:
ownerId: {{ owner_id }}
appId: {{ id }}
app: {{ sanitized_name }}
envId: {{ environment_id }}
Expand Down
6 changes: 1 addition & 5 deletions lib/aws/charts/q-application/templates/statefulset.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand All @@ -17,14 +16,12 @@ spec:
serviceName: {{ sanitized_name }}
selector:
matchLabels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
template:
metadata:
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down Expand Up @@ -62,6 +59,7 @@ spec:
{%- if private_port %}
ports:
- containerPort: {{ private_port }}
name: "p{{ private_port }}"
protocol: TCP
readinessProbe:
tcpSocket:
Expand Down Expand Up @@ -92,7 +90,6 @@ spec:
- metadata:
name: {{ s.id }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand All @@ -112,7 +109,6 @@ spec:
- metadata:
name: {{ s.id }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
diskId: {{ s.id }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand All @@ -22,14 +21,12 @@ spec:
{% endif %}
selector:
matchLabels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
template:
metadata:
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down Expand Up @@ -67,6 +64,7 @@ spec:
{%- if private_port %}
ports:
- containerPort: {{ private_port }}
name: "p{{ private_port }}"
protocol: TCP
readinessProbe:
tcpSocket:
Expand Down
2 changes: 0 additions & 2 deletions lib/digitalocean/charts/q-application/templates/pdb.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
spec:
minAvailable: 1
selector:
matchLabels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
appId: {{ id }}
app: {{ sanitized_name }}
envId: {{ environment_id }}
spec:
type: ClusterIP
ports:
- protocol: TCP
name: "p{{ private_port }}"
port: {{ private_port }}
targetPort: {{ private_port }}
selector:
ownerId: {{ owner_id }}
appId: {{ id }}
app: {{ sanitized_name }}
envId: {{ environment_id }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand All @@ -17,14 +16,12 @@ spec:
serviceName: {{ sanitized_name }}
selector:
matchLabels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
template:
metadata:
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down Expand Up @@ -62,6 +59,7 @@ spec:
{%- if private_port %}
ports:
- containerPort: {{ private_port }}
name: "p{{ private_port }}"
protocol: TCP
readinessProbe:
tcpSocket:
Expand Down Expand Up @@ -92,7 +90,6 @@ spec:
- metadata:
name: {{ s.id }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand All @@ -112,7 +109,6 @@ spec:
- metadata:
name: {{ s.id }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
diskId: {{ s.id }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand All @@ -22,13 +21,11 @@ spec:
{% endif %}
selector:
matchLabels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
template:
metadata:
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down Expand Up @@ -66,6 +63,7 @@ spec:
{%- if private_port %}
ports:
- containerPort: {{ private_port }}
name: "p{{ private_port }}"
protocol: TCP
readinessProbe:
tcpSocket:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
name: {{ sanitized_name }}-default
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
appId: {{ id }}
app: {{ sanitized_name }}
envId: {{ environment_id }}
Expand All @@ -15,7 +14,6 @@ spec:
matchLabels:
appId: {{ id }}
app: {{ sanitized_name }}
ownerId: {{ owner_id }}
envId: {{ environment_id }}
policyTypes:
- Ingress
Expand All @@ -26,7 +24,6 @@ metadata:
name: {{ sanitized_name }}-app-access
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
appId: {{ id }}
app: {{ sanitized_name }}
envId: {{ environment_id }}
Expand All @@ -36,14 +33,12 @@ spec:
matchLabels:
appId: {{ id }}
app: {{ sanitized_name }}
ownerId: {{ owner_id }}
envId: {{ environment_id }}
ingress:
# Allow ingress from same environment
- from:
- podSelector:
matchLabels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}

# Allow ingress from everywhere but only to application port
Expand Down
2 changes: 0 additions & 2 deletions lib/scaleway/charts/q-application/templates/pdb.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
spec:
minAvailable: 1
selector:
matchLabels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down
1 change: 0 additions & 1 deletion lib/scaleway/charts/q-application/templates/secret.j2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
name: {{ sanitized_name }}
namespace: {{ namespace }}
labels:
ownerId: {{ owner_id }}
envId: {{ environment_id }}
appId: {{ id }}
app: {{ sanitized_name }}
Expand Down
Loading

0 comments on commit 32107f8

Please sign in to comment.