You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Process types in the Cloud Native Buildpacks Buildpack specification are less restrictive than the RFC 1123 2.1 host name definition. Therefore, CNB process types may not be compatible with internet routing or kubernetes resource naming. This RFC proposes to restrict CNB process types to meet RFC 1123 2.1 and increase usage compatibility with other CNCF / OSS usage.
14
+
Process types in the Cloud Native Buildpacks buildpack specification are less restrictive than the RFC 1123 DNS label definition. Therefore, CNB process types may not be compatible with internet routing or kubernetes resource naming. This RFC proposes to restrict CNB process types to meet RFC 1123 and increase usage compatibility with other CNCF / OSS usage.
15
15
16
16
# Definitions
17
17
18
-
RFC 1123 Requirements for Internet Hosts Section 2.1: The IETF ["Requirements for Internet Hosts" RFC](https://datatracker.ietf.org/doc/html/rfc1123#section-2.1) describes the syntax for host names on the internet.
19
-
Kubernetes Resource Names: Many resource names are restricted to RFC 1123, as outlined [here](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names).
20
-
Process Types: The name of a process in a Cloud Native Buildpacks result as [described in `launch.toml`](https://github.com/buildpacks/spec/blob/main/buildpack.md#launchtoml-toml).
18
+
**RFC 1123**: The IETF ["Requirements for Internet Hosts" RFC](https://datatracker.ietf.org/doc/html/rfc1123#section-2.1) describes the syntax for DNS host names, domain names, and labels.
19
+
**Kubernetes Resource Names**: Many resource names are restricted to RFC 1123, as outlined [here](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names).
20
+
**Process Types**: The name of a process in a Cloud Native Buildpacks result as [described in `launch.toml`](https://github.com/buildpacks/spec/blob/main/buildpack.md#launchtoml-toml).
21
21
22
22
# Motivation
23
23
24
24
The images resulting from CNB builds are often deployed to internet connected environments, where it's useful to connect or manage the image lifecycle with a domain name.
25
25
26
-
For example, after building a web service image with Cloud Native Buildpacks, developers might want to expose various processes to the internet like static-assets.myapp.com and api.myapp.com. However, process types may currently include `_`, `.`, and/or `[A-Z]`, making process types like `Static_Assets` allowed, but not internet routable -- `Static_Assets.myapp.com` is not a valid domain name.
26
+
For example, after building a web service image with Cloud Native Buildpacks, developers might want to expose various processes to the internet like static-assets.myapp.com and api.myapp.com. However, process types may currently include `_`, making process types like `Static_Assets` allowed, but not internet routable -- `Static_Assets.myapp.com` is not a valid domain name.
27
27
28
28
Or, developers might want to manage Kubernetes resources dynamically using process types defined in the resulting image:
29
29
@@ -37,33 +37,27 @@ However, while CNB allows a `Static_Assets` process type, Kubernetes rejects it
37
37
object name does not conform to Kubernetes naming requirements: "Static_Assets"
38
38
```
39
39
40
-
These incompatibilities make using process types in dynamic scenarios challenging and/or impossible.
40
+
These incompatibilities make using process types in dynamic scenarios challenging.
41
41
42
42
# What it is
43
43
44
44
The current Buildpack specification defines these process type restrictions:
45
45
46
46
> MUST only contain numbers, letters, and the characters ., \_, and -.
47
47
48
-
While RFC 1123 uses a stricter syntax with these notable differences:
48
+
While DNS Labels as defined in RFC 1123 are more restrictive. Some notable differences:
49
49
50
50
- Underscores (`_`) are not allowed
51
51
- Periods (`.`) are not allowed
52
52
- Dashes ('-') are not allowed as the first or last character
53
53
- Uppercase and lowercase letters are not differentiated
54
-
- Must be 63 characters or less
54
+
- Must be less than 63 characters
55
55
56
-
The buildpack specification will be modified to match RFC 1123 2.1.
56
+
The buildpack specification will be modified to match RFC 1123 for DNS Labels.
57
57
58
58
# How it Works
59
59
60
-
The platform specification will be changed to reject process types that do not comply with RFC 1123 2.1. For maximum compatibility with Kubernetes resource names, the Kubernetes regular expression will be used:
When a process type fails to meet this expression, appropriate error messaging may be given by the platform, for example:
60
+
The platform specification will be changed to reject process types that do not comply with RFC 1123 DNS Labels. When a process type fails to meet this expression, appropriate error messaging may be given by the platform, for example:
67
61
68
62
```
69
63
The "Static_Assets" process type must comply with RFC 1123 host name syntax. Underscores are not allowed. Uppercase letters are not allowed."
@@ -83,6 +77,20 @@ This may require buildpacks to change the way process types are defined. For bui
83
77
84
78
# Alternatives
85
79
80
+
## Enforce RFC 1123 host names
81
+
82
+
Instead of enforcing the DNS label syntax, enforce the host name syntax. This would allow periods (in correct postions) and allow up to 254 characters.
83
+
84
+
Pros:
85
+
86
+
- Less restrictive
87
+
- would allow internet routing and kubernetes compatibility.
88
+
89
+
Cons:
90
+
91
+
- Buildpacks are unlikely to know/set the correct fully qualified domain for an image that might be deployed many places
92
+
- Deployment platforms couldn't use use process types as a subdomain (since the buildpack may have chosen a 254 character process type)
93
+
86
94
## Do Nothing
87
95
88
96
If we do nothing, developers in our ecosystem will not be able to use process types for internet routing or kubernetes resource names.
0 commit comments