Skip to content

Commit ba1fc96

Browse files
authored
Merge pull request #5 from PackmindHub/feat/api-dns-config
✨ feat(api): expose dnsConfig and dnsPolicy on the API pod
2 parents 50981b8 + 4bb0a7b commit ba1fc96

3 files changed

Lines changed: 50 additions & 1 deletion

File tree

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Packmind documentation is available [here](https://packmindhub.github.io/packmin
1313
- [Backup Considerations](#backup-considerations)
1414
- [Additional Secrets](#additional-secrets)
1515
- [Resource Configuration](#resource-configuration)
16+
- [DNS Configuration (Self-Hosted Kubernetes)](#dns-configuration-self-hosted-kubernetes)
1617

1718
## Version Selection
1819

@@ -248,4 +249,32 @@ api:
248249
secretName: my-openai-secret
249250
key: open-ai-key
250251
optional: false
251-
```
252+
```
253+
254+
## DNS Configuration (Self-Hosted Kubernetes)
255+
256+
The API image is Alpine-based (musl libc). Under Kubernetes' default pod DNS
257+
(`options ndots:5` plus cluster/corporate `search` domains), musl can fail to
258+
resolve external hosts such as `api.github.com`, producing
259+
`getaddrinfo ENOTFOUND` and breaking GitHub App registration. This happens
260+
because musl aborts the search-domain list on the first non-`NXDOMAIN` reply
261+
instead of falling back to the absolute name.
262+
263+
If you hit this, set `ndots:"1"` on the API pod so names with at least one dot
264+
resolve as absolute first:
265+
266+
```yaml
267+
api:
268+
dnsConfig:
269+
options:
270+
- name: ndots
271+
value: "1"
272+
```
273+
274+
Kubernetes merges these options onto the pod's default `resolv.conf`, so
275+
`dnsPolicy` does not need to change. `api.dnsPolicy` is also exposed if you
276+
need to override it (e.g. `"None"`, `"Default"`, `"ClusterFirst"`). Both keys
277+
are empty by default, so nothing is rendered unless you opt in.
278+
279+
See [PackmindHub/packmind#388](https://github.com/PackmindHub/packmind/issues/388)
280+
for details.

packmind/templates/deployment-api.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,11 @@ spec:
8080
tolerations:
8181
{{- toYaml . | nindent 8 }}
8282
{{- end }}
83+
{{- with .Values.api.dnsPolicy }}
84+
dnsPolicy: {{ . }}
85+
{{- end }}
86+
{{- with .Values.api.dnsConfig }}
87+
dnsConfig:
88+
{{- toYaml . | nindent 8 }}
89+
{{- end }}
8390
{{- end }}

packmind/values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,19 @@ api:
237237
tolerations: []
238238
affinity: {}
239239

240+
# DNS configuration (self-hosted Kubernetes)
241+
# The API image is Alpine-based (musl libc). Under K8s default pod DNS
242+
# (ndots:5 + cluster/corporate search domains), musl can fail to resolve
243+
# external hosts such as api.github.com (getaddrinfo ENOTFOUND) because it
244+
# aborts the search list before trying the absolute name. Setting ndots:"1"
245+
# makes names with >=1 dot resolve as absolute first, which fixes it.
246+
# See https://github.com/PackmindHub/packmind/issues/388
247+
dnsPolicy: "" # optional; e.g. "ClusterFirst" (k8s default), "Default", "None"
248+
dnsConfig: {}
249+
# options:
250+
# - name: ndots
251+
# value: "1"
252+
240253
# Auto scaling
241254
autoscaling:
242255
enabled: false

0 commit comments

Comments
 (0)