Skip to content

Commit

Permalink
Merge branch 'main' into Issue-380
Browse files Browse the repository at this point in the history
  • Loading branch information
GMartinez-Sisti committed Jun 18, 2024
2 parents 0c108a2 + f60ce86 commit dc77b01
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: azure/setup-helm@v4
with:
# renovate: datasource=github-tags depName=helm packageName=helm/helm
version: v3.15.1
version: v3.15.2

- uses: actions/setup-python@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: azure/setup-helm@v4
with:
# renovate: datasource=github-tags depName=helm packageName=helm/helm
version: v3.15.1
version: v3.15.2

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
Expand Down
4 changes: 3 additions & 1 deletion charts/atlantis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ extraManifests:
| disableApply | bool | `false` | Disables running `atlantis apply` regardless of which flags are sent with it. |
| disableApplyAll | bool | `false` | Disables running `atlantis apply` without any flags. |
| disableRepoLocking | bool | `false` | Stops atlantis locking projects and or workspaces when running terraform. |
| dnsConfig | object | `{}` | Optionally specify dnsConfig for the Atlantis pod. Check values.yaml for examples. |
| dnsPolicy | string | `"ClusterFirst"` | Optionally specify dnsPolicy parameter to specify a DNS policy for a pod Check https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy |
| enableDiffMarkdownFormat | bool | `false` | Use Diff Markdown Format for color coding diffs. |
| enableKubernetesBackend | bool | `false` | Optionally deploy rbac to allow for the serviceAccount to manage terraform state via the kubernetes backend. |
| environment | object | `{}` | Environtment values to add to the Atlantis pod. Check values.yaml for examples. |
Expand Down Expand Up @@ -131,11 +133,11 @@ extraManifests:
| ingress.pathType | string | `"ImplementationSpecific"` | |
| ingress.paths | list | `[]` | Used when several paths under the same host, with different backend services, are required. Check values.yaml for examples. |
| ingress.tls | list | `[]` | Check values.yaml for examples. |
| initConfig.containerSecurityContext | object | `{}` | Security context for the container. |
| initConfig.enabled | bool | `false` | Install providers/plugins into a path shared with the Atlantis pod. |
| initConfig.image | string | `"alpine:latest"` | |
| initConfig.imagePullPolicy | string | `"IfNotPresent"` | |
| initConfig.script | string | Check values.yaml. | Script to run on the init container. |
| initConfig.securityContext | object | `{}` | Security context for the container. |
| initConfig.sharedDir | string | `"/plugins"` | SharedDir is set as env var INIT_SHARED_DIR. |
| initConfig.sharedDirReadOnly | bool | `true` | |
| initConfig.sizeLimit | string | `"100Mi"` | Size for the shared volume. |
Expand Down
19 changes: 19 additions & 0 deletions charts/atlantis/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ spec:
{{- toYaml .Values.podTemplate.annotations | nindent 8 }}
{{- end }}
spec:
{{- if and (or .Values.dnsPolicy (.Values.dnsPolicy and .Values.dnsConfig)) (ne .Values.dnsPolicy "ClusterFirst") }}
dnsPolicy: {{ .Values.dnsPolicy}}
{{- end }}
{{- if or .Values.dnsConfig (eq .Values.dnsPolicy "None") }}
{{- if not .Values.dnsConfig }}
{{- fail "dnsPolicy is set to 'None', but dnsConfig is not provided" }}
{{- end }}
dnsConfig:
nameservers:
{{- range .Values.dnsConfig.nameservers }}
- {{ . }}
{{- end }}
{{- if .Values.dnsConfig.searches }}
searches:
{{- range .Values.dnsConfig.searches }}
- {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.hostAliases }}
hostAliases:
{{- range .Values.hostAliases }}
Expand Down
53 changes: 52 additions & 1 deletion charts/atlantis/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@
"type": [
"integer",
"null"
],
],
"description": "Set terminationGracePeriodSeconds for the StatefulSet."
},
"ingress": {
Expand Down Expand Up @@ -1050,6 +1050,39 @@
}
]
},
"dnsPolicy": {
"type": "string",
"default": "ClusterFirst",
"description": "dnsPolicy for Atlantis pods",
"enum": [
"ClusterFirst",
"Default",
"ClusterFirstWithHostNet",
"None"
],
"examples": [
"ClusterFirst",
"Default",
"ClusterFirstWithHostNet",
"None"
]
},
"dnsConfig": {
"description": "Specify dnsConfig for Atlantis containers.",
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.DnsConfig"
},
"type": "object",
"default": [],
"examples": [
{
"nameservers": "8.8.8.8",
"searches": [
"mydomain.com"
]
}
]
},
"hostNetwork": {
"type": "boolean",
"description": "Use the host's network namespace.",
Expand Down Expand Up @@ -1232,6 +1265,24 @@
"type": "object",
"additionalProperties": false
},
"io.k8s.api.core.v1.DnsConfig": {
"description": "DnsConfig ",
"properties": {
"nameservers": {
"description": "a list of IP addresses that will be used as DNS servers for the search domain.",
"items": {
"type": "string"
},
"type": "array"
},
"searches": {
"description": "A list of DNS search domains for hostname lookup.",
"type": "string"
}
},
"type": "object",
"additionalProperties": false
},
"io.k8s.api.core.v1.Container": {
"description": "A single application container that you want to run within a pod.",
"properties": {
Expand Down
15 changes: 14 additions & 1 deletion charts/atlantis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ initConfig:
# -- Size for the shared volume.
sizeLimit: 100Mi
# -- Security context for the container.
securityContext: {}
containerSecurityContext: {}
# -- Script to run on the init container.
# @default -- Check values.yaml.
script: |
Expand Down Expand Up @@ -608,6 +608,19 @@ hostAliases: []
# - bbb.com
# ip: 10.0.0.2

# -- Optionally specify dnsPolicy parameter to specify a DNS policy for a pod
# Check https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy
dnsPolicy: "ClusterFirst"

# -- Optionally specify dnsConfig for the Atlantis pod.
# Check values.yaml for examples.
dnsConfig: {}
# dnsConfig:
# nameservers:
# - 8.8.8.8
# searches:
# - mydomain.com

hostNetwork: false

# - These annotations will be added to all the resources.
Expand Down

0 comments on commit dc77b01

Please sign in to comment.