Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove crd-install hook, as it break CRD updates #441

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,15 @@ push: push-controller-image push-agones-sdk-image push-ping-image
install: ALWAYS_PULL_SIDECAR := true
install: IMAGE_PULL_POLICY := "Always"
install: PING_SERVICE_TYPE := "LoadBalancer"
install: CRD_CLEANUP := true
install: $(ensure-build-image) install-custom-pull-secret
$(DOCKER_RUN) \
helm upgrade --install --wait --namespace=agones-system\
--set agones.image.tag=$(VERSION),agones.image.registry=$(REGISTRY) \
--set agones.image.controller.pullPolicy=$(IMAGE_PULL_POLICY),agones.image.sdk.alwaysPull=$(ALWAYS_PULL_SIDECAR) \
--set agones.image.controller.pullSecret=$(IMAGE_PULL_SECRET) \
--set agones.ping.http.serviceType=$(PING_SERVICE_TYPE),agones.ping.udp.serviceType=$(PING_SERVICE_TYPE) \
--set agones.crds.cleanupOnDelete=$(CRD_CLEANUP) \
agones $(mount_path)/install/helm/agones/

uninstall: $(ensure-build-image)
Expand Down Expand Up @@ -251,7 +253,8 @@ push-agones-sdk-image: $(ensure-build-image)
gen-install: $(ensure-build-image)
docker run --rm $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) bash -c \
'helm template --name=agones-manual --namespace agones-system $(mount_path)/install/helm/agones \
--set agones.controller.generateTLS=false --set agones.enableHelmCleanupHooks=false \
--set agones.controller.generateTLS=false \
--set agones.crds.cleanupOnDelete=false \
> $(mount_path)/install/yaml/install.yaml'

# Generate the SDK gRPC server and client code
Expand Down
2 changes: 2 additions & 0 deletions install/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ The following tables lists the configurable parameters of the Agones chart and t
| Parameter | Description | Default |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------- |
| `agones.rbacEnabled` | Creates RBAC resources. Must be set for any cluster configured with RBAC | `true` |
| `agones.crds.install` | Install the CRDs with this chart. Useful to disable if you want to subchart (since crd-install hook is broken), so you can copy the CRDs into your own chart. | `true` |
| `agones.crds.cleanupOnDelete` | Run the pre-delete hook to delete all GameServers and their backing Pods when deleting the helm chart, so that all CRDs can be removed on chart deletion | `true` |
| `agones.serviceaccount.controller` | Service account name for the controller | `agones-controller` |
| `agones.serviceaccount.sdk` | Service account name for the sdk | `agones-sdk` |
| `agones.image.registry` | Global image registry for all images | `gcr.io/agones-images` |
Expand Down
21 changes: 0 additions & 21 deletions install/helm/agones/scripts/delete_crds.sh

This file was deleted.

6 changes: 4 additions & 2 deletions install/helm/agones/templates/crds/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{- if .Values.agones.crds.install }}

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand All @@ -22,8 +24,6 @@ metadata:
chart: {{ template "agones.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
"helm.sh/hook": "crd-install"
spec:
group: stable.agones.dev
version: v1alpha1
Expand Down Expand Up @@ -59,3 +59,5 @@ spec:
- RollingUpdate
template:
{{- include "gameserver.validation" . | indent 14 }}

{{- end }}
6 changes: 4 additions & 2 deletions install/helm/agones/templates/crds/fleetallocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{- if .Values.agones.crds.install }}

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand All @@ -22,8 +24,6 @@ metadata:
chart: {{ template "agones.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
"helm.sh/hook": "crd-install"
spec:
group: stable.agones.dev
version: v1alpha1
Expand All @@ -46,3 +46,5 @@ spec:
minLength: 1
maxLength: 63
pattern: "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"

{{- end }}
5 changes: 3 additions & 2 deletions install/helm/agones/templates/crds/fleetautoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{- if .Values.agones.crds.install }}

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand All @@ -22,8 +24,6 @@ metadata:
chart: {{ template "agones.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
"helm.sh/hook": "crd-install"
spec:
group: stable.agones.dev
version: v1alpha1
Expand Down Expand Up @@ -65,3 +65,4 @@ spec:
maxReplicas:
type: integer
minimum: 1
{{- end }}
6 changes: 4 additions & 2 deletions install/helm/agones/templates/crds/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{- if .Values.agones.crds.install }}

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand All @@ -22,8 +24,6 @@ metadata:
chart: {{ template "agones.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
"helm.sh/hook": "crd-install"
spec:
group: stable.agones.dev
version: v1alpha1
Expand All @@ -37,3 +37,5 @@ spec:
validation:
openAPIV3Schema:
{{- include "gameserver.validation" . | indent 6 }}

{{- end }}
5 changes: 3 additions & 2 deletions install/helm/agones/templates/crds/gameserverset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

{{- if .Values.agones.crds.install }}

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
Expand All @@ -22,8 +24,6 @@ metadata:
chart: {{ template "agones.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
"helm.sh/hook": "crd-install"
spec:
group: stable.agones.dev
version: v1alpha1
Expand Down Expand Up @@ -53,3 +53,4 @@ spec:
- Distributed
template:
{{- include "gameserver.validation" . | indent 14 }}
{{- end }}
49 changes: 0 additions & 49 deletions install/helm/agones/templates/hooks/post_delete_hook.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion install/helm/agones/templates/hooks/pre_delete_hook.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.agones.enableHelmCleanupHooks }}
{{- if .Values.agones.crds.cleanupOnDelete }}
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
5 changes: 1 addition & 4 deletions install/helm/agones/templates/hooks/sa.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.agones.enableHelmCleanupHooks }}
{{- if .Values.agones.crds.cleanupOnDelete }}
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -44,9 +44,6 @@ metadata:
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": before-hook-creation
rules:
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["delete"]
- apiGroups: ["stable.agones.dev"]
resources: ["fleets", "fleetallocations", "fleetautoscalers", "gameservers", "gameserversets"]
verbs: ["delete", "list" ]
Expand Down
18 changes: 1 addition & 17 deletions install/helm/agones/templates/hooks/scripts.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.agones.enableHelmCleanupHooks }}
{{- if .Values.agones.crds.cleanupOnDelete }}
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,22 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ConfigMap
metadata:
name: delete-crds
labels:
app.kubernetes.io/managed-by: {{.Release.Service | quote }}
app.kubernetes.io/instance: {{.Release.Name | quote }}
helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-weight": "-3"
"helm.sh/hook-delete-policy": before-hook-creation
data:
delete_crds.sh: |
{{ .Files.Get "scripts/delete_crds.sh" | indent 4 }}
---
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
4 changes: 3 additions & 1 deletion install/helm/agones/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

agones:
rbacEnabled: true
enableHelmCleanupHooks: true
crds:
install: true
cleanupOnDelete: true
serviceaccount:
controller: agones-controller
sdk: agones-sdk
Expand Down
18 changes: 0 additions & 18 deletions install/yaml/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ metadata:
chart: agones-0.7.0-rc
release: agones-manual
heritage: Tiller
annotations:
"helm.sh/hook": "crd-install"
spec:
group: stable.agones.dev
version: v1alpha1
Expand Down Expand Up @@ -303,7 +301,6 @@ spec:
type: integer
minimum: 1
maximum: 2147483648

---
# Source: agones/templates/crds/fleetallocation.yaml
# Copyright 2018 Google Inc. All Rights Reserved.
Expand All @@ -330,8 +327,6 @@ metadata:
chart: agones-0.7.0-rc
release: agones-manual
heritage: Tiller
annotations:
"helm.sh/hook": "crd-install"
spec:
group: stable.agones.dev
version: v1alpha1
Expand All @@ -354,7 +349,6 @@ spec:
minLength: 1
maxLength: 63
pattern: "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"

---
# Source: agones/templates/crds/fleetautoscaler.yaml
# Copyright 2018 Google Inc. All Rights Reserved.
Expand All @@ -381,8 +375,6 @@ metadata:
chart: agones-0.7.0-rc
release: agones-manual
heritage: Tiller
annotations:
"helm.sh/hook": "crd-install"
spec:
group: stable.agones.dev
version: v1alpha1
Expand Down Expand Up @@ -424,7 +416,6 @@ spec:
maxReplicas:
type: integer
minimum: 1

---
# Source: agones/templates/crds/gameserver.yaml
# Copyright 2018 Google Inc. All Rights Reserved.
Expand All @@ -451,8 +442,6 @@ metadata:
chart: agones-0.7.0-rc
release: agones-manual
heritage: Tiller
annotations:
"helm.sh/hook": "crd-install"
spec:
group: stable.agones.dev
version: v1alpha1
Expand Down Expand Up @@ -596,8 +585,6 @@ metadata:
chart: agones-0.7.0-rc
release: agones-manual
heritage: Tiller
annotations:
"helm.sh/hook": "crd-install"
spec:
group: stable.agones.dev
version: v1alpha1
Expand Down Expand Up @@ -730,7 +717,6 @@ spec:
type: integer
minimum: 1
maximum: 2147483648

---
# Source: agones/templates/service.yaml
# Copyright 2018 Google Inc. All Rights Reserved.
Expand Down Expand Up @@ -949,10 +935,6 @@ spec:
targetPort: 8080
protocol: UDP
type: LoadBalancer
---
# Source: agones/templates/hooks/post_delete_hook.yaml


---
# Source: agones/templates/hooks/pre_delete_hook.yaml

Expand Down