From ea8f9a846e755f29a9b6a7f6333309e5587700ce Mon Sep 17 00:00:00 2001 From: James Rhoat Date: Thu, 7 Nov 2024 12:54:48 -0500 Subject: [PATCH 1/5] adding support for ipFamilyPolicy --- CHANGELOG.md | 6 ++++ charts/factorio-server-charts/Chart.yaml | 2 +- .../templates/rcon-api-service.yaml | 10 ++++++ .../templates/rcon-service.yaml | 10 ++++++ .../templates/service.yaml | 10 ++++++ charts/factorio-server-charts/values.yaml | 33 +++++++++++++++++++ 6 files changed, 70 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5c8cc9..39d2d48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## Changelog +### V2.2.3 + +#### Non-Breaking Changes + +- Adding support for ipFamilyPolicy, fixing [Issue 63](https://github.com/SQLJames/factorio-server-charts/issues/63) + ### V2.2.2 #### Non-Breaking Changes diff --git a/charts/factorio-server-charts/Chart.yaml b/charts/factorio-server-charts/Chart.yaml index 0f856c7..ad9dd62 100644 --- a/charts/factorio-server-charts/Chart.yaml +++ b/charts/factorio-server-charts/Chart.yaml @@ -20,7 +20,7 @@ sources: # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.2.2 +version: 2.2.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/factorio-server-charts/templates/rcon-api-service.yaml b/charts/factorio-server-charts/templates/rcon-api-service.yaml index d7c4684..37144b5 100644 --- a/charts/factorio-server-charts/templates/rcon-api-service.yaml +++ b/charts/factorio-server-charts/templates/rcon-api-service.yaml @@ -13,6 +13,16 @@ metadata: {{ $key }}: {{ $value | quote }} {{- end }} spec: + {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} + {{- if .Values.controller.service.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} + {{- end }} + {{- end }} + {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} + {{- if .Values.controller.service.ipFamilies }} + ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} + {{- end }} + {{- end }} type: {{ .Values.rconAPI.type }} ports: - name: http diff --git a/charts/factorio-server-charts/templates/rcon-service.yaml b/charts/factorio-server-charts/templates/rcon-service.yaml index 74ff326..87f34ce 100644 --- a/charts/factorio-server-charts/templates/rcon-service.yaml +++ b/charts/factorio-server-charts/templates/rcon-service.yaml @@ -13,6 +13,16 @@ metadata: {{ $key }}: {{ $value | quote }} {{- end }} spec: + {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} + {{- if .Values.controller.service.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} + {{- end }} + {{- end }} + {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} + {{- if .Values.controller.service.ipFamilies }} + ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} + {{- end }} + {{- end }} type: {{ .Values.rcon.type }} ports: - name: rcon diff --git a/charts/factorio-server-charts/templates/service.yaml b/charts/factorio-server-charts/templates/service.yaml index 0c23d13..3bfb525 100644 --- a/charts/factorio-server-charts/templates/service.yaml +++ b/charts/factorio-server-charts/templates/service.yaml @@ -14,6 +14,16 @@ metadata: {{- end }} {{- end }} spec: + {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} + {{- if .Values.controller.service.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} + {{- end }} + {{- end }} + {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} + {{- if .Values.controller.service.ipFamilies }} + ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} + {{- end }} + {{- end }} type: {{ .Values.service.type }} {{- if .Values.service.externalTrafficPolicy}} externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} diff --git a/charts/factorio-server-charts/values.yaml b/charts/factorio-server-charts/values.yaml index 6df23a6..d7e8405 100644 --- a/charts/factorio-server-charts/values.yaml +++ b/charts/factorio-server-charts/values.yaml @@ -48,6 +48,17 @@ nodeSelector: {} ## The best way ist to define a ClusterIP service and define one or more externalIPs. Of course this IPs must be available on the node the factorio pod runs on! service: type: NodePort + ## Represents the dual-stack-ness requested or required by this Service. Possible values are + ## SingleStack, PreferDualStack or RequireDualStack. + ## The ipFamilies and clusterIPs fields depend on the value of this field. + ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ + #ipFamilyPolicy: "SingleStack" + + ## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically + ## based on cluster configuration and the ipFamilyPolicy field. + ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ + #ipFamilies: + # - IPv4 port: 31497 ## If you are able to map an external IP, set it here # externalIPs: @@ -332,6 +343,17 @@ port_fixer: ## @param rcon.port RCON service external port # Password and port for the rcon service rcon: + ## Represents the dual-stack-ness requested or required by this Service. Possible values are + ## SingleStack, PreferDualStack or RequireDualStack. + ## The ipFamilies and clusterIPs fields depend on the value of this field. + ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ + #ipFamilyPolicy: "SingleStack" + + ## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically + ## based on cluster configuration and the ipFamilyPolicy field. + ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ + #ipFamilies: + # - IPv4 external: true type: LoadBalancer serviceAnnotations: {} @@ -359,6 +381,17 @@ rcon: ## @param rconAPI.ingress.tls.enabled Enable or disable TLS for the Ingress ## @param rconAPI.ingress.tls.secretName Kubernetes Secret name for TLS certificates used by the Ingress rconAPI: + ## Represents the dual-stack-ness requested or required by this Service. Possible values are + ## SingleStack, PreferDualStack or RequireDualStack. + ## The ipFamilies and clusterIPs fields depend on the value of this field. + ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ + #ipFamilyPolicy: "SingleStack" + + ## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically + ## based on cluster configuration and the ipFamilyPolicy field. + ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ + #ipFamilies: + # - IPv4 enabled: false image: repository: "ghcr.io/nekomeowww/factorio-rcon-api" From 5ccc40a7b4dc11c0552f8cee50ab9c1ecb35cfe7 Mon Sep 17 00:00:00 2001 From: James Rhoat Date: Thu, 7 Nov 2024 12:57:23 -0500 Subject: [PATCH 2/5] fixing linting --- charts/factorio-server-charts/values.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/charts/factorio-server-charts/values.yaml b/charts/factorio-server-charts/values.yaml index d7e8405..fab8c8d 100644 --- a/charts/factorio-server-charts/values.yaml +++ b/charts/factorio-server-charts/values.yaml @@ -52,13 +52,13 @@ service: ## SingleStack, PreferDualStack or RequireDualStack. ## The ipFamilies and clusterIPs fields depend on the value of this field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - #ipFamilyPolicy: "SingleStack" + # ipFamilyPolicy: "SingleStack" ## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically ## based on cluster configuration and the ipFamilyPolicy field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - #ipFamilies: - # - IPv4 + # ipFamilies: + # - IPv4 port: 31497 ## If you are able to map an external IP, set it here # externalIPs: @@ -347,13 +347,13 @@ rcon: ## SingleStack, PreferDualStack or RequireDualStack. ## The ipFamilies and clusterIPs fields depend on the value of this field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - #ipFamilyPolicy: "SingleStack" + # ipFamilyPolicy: "SingleStack" ## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically ## based on cluster configuration and the ipFamilyPolicy field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - #ipFamilies: - # - IPv4 + # ipFamilies: + # - IPv4 external: true type: LoadBalancer serviceAnnotations: {} @@ -385,13 +385,13 @@ rconAPI: ## SingleStack, PreferDualStack or RequireDualStack. ## The ipFamilies and clusterIPs fields depend on the value of this field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - #ipFamilyPolicy: "SingleStack" + # ipFamilyPolicy: "SingleStack" ## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically ## based on cluster configuration and the ipFamilyPolicy field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - #ipFamilies: - # - IPv4 + # ipFamilies: + # - IPv4 enabled: false image: repository: "ghcr.io/nekomeowww/factorio-rcon-api" From a89098683b67a14f8d53979fef90243e594c20ab Mon Sep 17 00:00:00 2001 From: James Rhoat Date: Thu, 7 Nov 2024 12:59:46 -0500 Subject: [PATCH 3/5] fixing rendering issue --- charts/factorio-server-charts/values.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/charts/factorio-server-charts/values.yaml b/charts/factorio-server-charts/values.yaml index fab8c8d..0a17791 100644 --- a/charts/factorio-server-charts/values.yaml +++ b/charts/factorio-server-charts/values.yaml @@ -52,13 +52,13 @@ service: ## SingleStack, PreferDualStack or RequireDualStack. ## The ipFamilies and clusterIPs fields depend on the value of this field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - # ipFamilyPolicy: "SingleStack" + ipFamilyPolicy: "SingleStack" ## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically ## based on cluster configuration and the ipFamilyPolicy field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - # ipFamilies: - # - IPv4 + ipFamilies: + - IPv4 port: 31497 ## If you are able to map an external IP, set it here # externalIPs: @@ -347,13 +347,13 @@ rcon: ## SingleStack, PreferDualStack or RequireDualStack. ## The ipFamilies and clusterIPs fields depend on the value of this field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - # ipFamilyPolicy: "SingleStack" + ipFamilyPolicy: "SingleStack" ## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically ## based on cluster configuration and the ipFamilyPolicy field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - # ipFamilies: - # - IPv4 + ipFamilies: + - IPv4 external: true type: LoadBalancer serviceAnnotations: {} @@ -385,13 +385,13 @@ rconAPI: ## SingleStack, PreferDualStack or RequireDualStack. ## The ipFamilies and clusterIPs fields depend on the value of this field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - # ipFamilyPolicy: "SingleStack" + ipFamilyPolicy: "SingleStack" ## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically ## based on cluster configuration and the ipFamilyPolicy field. ## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/ - # ipFamilies: - # - IPv4 + ipFamilies: + - IPv4 enabled: false image: repository: "ghcr.io/nekomeowww/factorio-rcon-api" From a0846a64af9378c4da2f254b69cf4c27b75462e0 Mon Sep 17 00:00:00 2001 From: James Rhoat Date: Thu, 7 Nov 2024 13:01:32 -0500 Subject: [PATCH 4/5] fixing rendering issue --- charts/factorio-server-charts/templates/rcon-api-service.yaml | 4 ++-- charts/factorio-server-charts/templates/rcon-service.yaml | 4 ++-- charts/factorio-server-charts/templates/service.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/factorio-server-charts/templates/rcon-api-service.yaml b/charts/factorio-server-charts/templates/rcon-api-service.yaml index 37144b5..420ebd3 100644 --- a/charts/factorio-server-charts/templates/rcon-api-service.yaml +++ b/charts/factorio-server-charts/templates/rcon-api-service.yaml @@ -15,12 +15,12 @@ metadata: spec: {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} {{- if .Values.controller.service.ipFamilyPolicy }} - ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} {{- end }} {{- end }} {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} {{- if .Values.controller.service.ipFamilies }} - ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} + ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} {{- end }} {{- end }} type: {{ .Values.rconAPI.type }} diff --git a/charts/factorio-server-charts/templates/rcon-service.yaml b/charts/factorio-server-charts/templates/rcon-service.yaml index 87f34ce..7edc6fc 100644 --- a/charts/factorio-server-charts/templates/rcon-service.yaml +++ b/charts/factorio-server-charts/templates/rcon-service.yaml @@ -15,12 +15,12 @@ metadata: spec: {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} {{- if .Values.controller.service.ipFamilyPolicy }} - ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} {{- end }} {{- end }} {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} {{- if .Values.controller.service.ipFamilies }} - ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} + ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} {{- end }} {{- end }} type: {{ .Values.rcon.type }} diff --git a/charts/factorio-server-charts/templates/service.yaml b/charts/factorio-server-charts/templates/service.yaml index 3bfb525..4053bb0 100644 --- a/charts/factorio-server-charts/templates/service.yaml +++ b/charts/factorio-server-charts/templates/service.yaml @@ -16,12 +16,12 @@ metadata: spec: {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} {{- if .Values.controller.service.ipFamilyPolicy }} - ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} {{- end }} {{- end }} {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} {{- if .Values.controller.service.ipFamilies }} - ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} + ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} {{- end }} {{- end }} type: {{ .Values.service.type }} From 92644745c6abb4a0ec401cd7cb00373aae39a970 Mon Sep 17 00:00:00 2001 From: James Rhoat Date: Thu, 7 Nov 2024 13:06:36 -0500 Subject: [PATCH 5/5] fixing values --- .../templates/rcon-api-service.yaml | 8 ++++---- charts/factorio-server-charts/templates/rcon-service.yaml | 8 ++++---- charts/factorio-server-charts/templates/service.yaml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/charts/factorio-server-charts/templates/rcon-api-service.yaml b/charts/factorio-server-charts/templates/rcon-api-service.yaml index 420ebd3..5963e87 100644 --- a/charts/factorio-server-charts/templates/rcon-api-service.yaml +++ b/charts/factorio-server-charts/templates/rcon-api-service.yaml @@ -14,13 +14,13 @@ metadata: {{- end }} spec: {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} - {{- if .Values.controller.service.ipFamilyPolicy }} - ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} + {{- if .Values.rconAPI.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.rconAPI.ipFamilyPolicy }} {{- end }} {{- end }} {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} - {{- if .Values.controller.service.ipFamilies }} - ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} + {{- if .Values.rconAPI.ipFamilies }} + ipFamilies: {{ toYaml .Values.rconAPI.ipFamilies | nindent 4 }} {{- end }} {{- end }} type: {{ .Values.rconAPI.type }} diff --git a/charts/factorio-server-charts/templates/rcon-service.yaml b/charts/factorio-server-charts/templates/rcon-service.yaml index 7edc6fc..de7449e 100644 --- a/charts/factorio-server-charts/templates/rcon-service.yaml +++ b/charts/factorio-server-charts/templates/rcon-service.yaml @@ -14,13 +14,13 @@ metadata: {{- end }} spec: {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} - {{- if .Values.controller.service.ipFamilyPolicy }} - ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} + {{- if .Values.rcon.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.rcon.ipFamilyPolicy }} {{- end }} {{- end }} {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} - {{- if .Values.controller.service.ipFamilies }} - ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} + {{- if .Values.rcon.ipFamilies }} + ipFamilies: {{ toYaml .Values.rcon.ipFamilies | nindent 4 }} {{- end }} {{- end }} type: {{ .Values.rcon.type }} diff --git a/charts/factorio-server-charts/templates/service.yaml b/charts/factorio-server-charts/templates/service.yaml index 4053bb0..4e8c0be 100644 --- a/charts/factorio-server-charts/templates/service.yaml +++ b/charts/factorio-server-charts/templates/service.yaml @@ -15,13 +15,13 @@ metadata: {{- end }} spec: {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} - {{- if .Values.controller.service.ipFamilyPolicy }} - ipFamilyPolicy: {{ .Values.controller.service.ipFamilyPolicy }} + {{- if .Values.service.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }} {{- end }} {{- end }} {{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}} - {{- if .Values.controller.service.ipFamilies }} - ipFamilies: {{ toYaml .Values.controller.service.ipFamilies | nindent 4 }} + {{- if .Values.service.ipFamilies }} + ipFamilies: {{ toYaml .Values.service.ipFamilies | nindent 4 }} {{- end }} {{- end }} type: {{ .Values.service.type }}