From a67763cb94deaa55ed9c43f01f3f98cf301d79bf Mon Sep 17 00:00:00 2001 From: Alejandro Escobar Date: Tue, 1 Oct 2019 23:34:15 -0700 Subject: [PATCH 1/3] [catalog] chore: update crds and roles --- staging/kubeaddons-catalog/Chart.yaml | 2 +- .../{crds.yaml => crd_addonrepository.yaml} | 6 ++++ .../templates/deployment.yaml | 4 +++ .../templates/hook-roles.yaml | 11 ++++++++ .../kubeaddons-catalog/templates/role.yaml | 28 +++++++++++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) rename staging/kubeaddons-catalog/templates/{crds.yaml => crd_addonrepository.yaml} (93%) create mode 100644 staging/kubeaddons-catalog/templates/hook-roles.yaml create mode 100644 staging/kubeaddons-catalog/templates/role.yaml diff --git a/staging/kubeaddons-catalog/Chart.yaml b/staging/kubeaddons-catalog/Chart.yaml index bf79952c2..df610a5be 100644 --- a/staging/kubeaddons-catalog/Chart.yaml +++ b/staging/kubeaddons-catalog/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "v0.0.1-alpha1" description: "A Catalog service for Kubeaddons" name: kubeaddons-catalog -version: 0.0.3 +version: 0.0.4 home: https://github.com/mesosphere/kubeaddons sources: - https://github.com/mesosphere/kubeaddons/tools/catalog diff --git a/staging/kubeaddons-catalog/templates/crds.yaml b/staging/kubeaddons-catalog/templates/crd_addonrepository.yaml similarity index 93% rename from staging/kubeaddons-catalog/templates/crds.yaml rename to staging/kubeaddons-catalog/templates/crd_addonrepository.yaml index d5577217d..f15bcfd3a 100644 --- a/staging/kubeaddons-catalog/templates/crds.yaml +++ b/staging/kubeaddons-catalog/templates/crd_addonrepository.yaml @@ -1,9 +1,14 @@ +{{- if not (.Capabilities.APIVersions.Has "kubeaddons.mesosphere.io/v1alpha1") }} --- apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: creationTimestamp: null name: addonrepositories.kubeaddons.mesosphere.io + labels: +{{ include "kubeaddons-catalog.labels" . | indent 4 }} + annotations: + "helm.sh/hook": crd-install spec: additionalPrinterColumns: - JSONPath: .status.ready @@ -80,3 +85,4 @@ status: plural: "" conditions: [] storedVersions: [] +{{- end }} diff --git a/staging/kubeaddons-catalog/templates/deployment.yaml b/staging/kubeaddons-catalog/templates/deployment.yaml index 240020193..3f463ba6a 100644 --- a/staging/kubeaddons-catalog/templates/deployment.yaml +++ b/staging/kubeaddons-catalog/templates/deployment.yaml @@ -16,6 +16,7 @@ spec: app.kubernetes.io/name: {{ include "kubeaddons-catalog.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} spec: + serviceAccountName: {{ template "kubeaddons-catalog.fullname" . }} {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} @@ -28,6 +29,9 @@ spec: - name: http containerPort: 3000 protocol: TCP + - name: metrics + containerPort: 9094 + protocol: TCP livenessProbe: httpGet: path: /v1alpha1/health diff --git a/staging/kubeaddons-catalog/templates/hook-roles.yaml b/staging/kubeaddons-catalog/templates/hook-roles.yaml new file mode 100644 index 000000000..fa300d7c5 --- /dev/null +++ b/staging/kubeaddons-catalog/templates/hook-roles.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "kubeaddons-catalog.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "kubeaddons-catalog.labels" . | indent 4 }} + annotations: + helm.sh/hook: pre-install + helm.sh/hook-delete-policy: "before-hook-creation" \ No newline at end of file diff --git a/staging/kubeaddons-catalog/templates/role.yaml b/staging/kubeaddons-catalog/templates/role.yaml new file mode 100644 index 000000000..d5f5e6b06 --- /dev/null +++ b/staging/kubeaddons-catalog/templates/role.yaml @@ -0,0 +1,28 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ template "kubeaddons-catalog.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "kubeaddons-catalog.labels" . | indent 4 }} +rules: + - apiGroups: ["kubeaddons.mesosphere.io"] + resources: ["addonrepositories"] + verbs: ["get", "watch", "list"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ template "kubeaddons-catalog.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "kubeaddons-catalog.labels" . | indent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "kubeaddons-catalog.fullname" . }} +subjects: + - kind: ServiceAccount + name: {{ template "kubeaddons-catalog.fullname" . }} + namespace: {{ .Release.Namespace }} From f1f7bf86f743fc851cf4d304be6ae906b33a0084 Mon Sep 17 00:00:00 2001 From: Alejandro Escobar Date: Wed, 2 Oct 2019 10:15:23 -0700 Subject: [PATCH 2/3] force deploy crds if needed --- staging/kubeaddons-catalog/templates/crd_addonrepository.yaml | 2 +- staging/kubeaddons-catalog/values.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/staging/kubeaddons-catalog/templates/crd_addonrepository.yaml b/staging/kubeaddons-catalog/templates/crd_addonrepository.yaml index f15bcfd3a..451cec957 100644 --- a/staging/kubeaddons-catalog/templates/crd_addonrepository.yaml +++ b/staging/kubeaddons-catalog/templates/crd_addonrepository.yaml @@ -1,4 +1,4 @@ -{{- if not (.Capabilities.APIVersions.Has "kubeaddons.mesosphere.io/v1alpha1") }} +{{- if or (not (.Capabilities.APIVersions.Has "kubeaddons.mesosphere.io/v1alpha1")) .Values.crds.forceDeploy }} --- apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition diff --git a/staging/kubeaddons-catalog/values.yaml b/staging/kubeaddons-catalog/values.yaml index 3a7d6c60a..cf2880db6 100644 --- a/staging/kubeaddons-catalog/values.yaml +++ b/staging/kubeaddons-catalog/values.yaml @@ -13,6 +13,9 @@ service: type: ClusterIP port: 80 +crds: + forceDeploy: false + resources: {} nodeSelector: {} tolerations: [] From 408f5595f78171e9aa20511941563c2be1cef411 Mon Sep 17 00:00:00 2001 From: Steven Chung Date: Wed, 2 Oct 2019 19:21:51 -0400 Subject: [PATCH 3/3] fix up routes with new beta routes --- staging/kubeaddons-catalog/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staging/kubeaddons-catalog/templates/deployment.yaml b/staging/kubeaddons-catalog/templates/deployment.yaml index 3f463ba6a..6fa21bac8 100644 --- a/staging/kubeaddons-catalog/templates/deployment.yaml +++ b/staging/kubeaddons-catalog/templates/deployment.yaml @@ -34,11 +34,11 @@ spec: protocol: TCP livenessProbe: httpGet: - path: /v1alpha1/health + path: /v1beta1/health port: http readinessProbe: httpGet: - path: /v1alpha1/healthz + path: /v1beta1/healthz port: http resources: {{- toYaml .Values.resources | nindent 12 }}