Skip to content

Commit

Permalink
feat(helm): align resources for helm
Browse files Browse the repository at this point in the history
Until now we were maintaining 2 separate set of installation resources. Here we make Helm to reuse the existing base resources instead, making easier any future evolution
  • Loading branch information
squakez committed Dec 4, 2024
1 parent 8870a49 commit 83ebae6
Show file tree
Hide file tree
Showing 17 changed files with 675 additions and 465 deletions.
2 changes: 1 addition & 1 deletion e2e/install/helm/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
func TestHelmInstallation(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
containerRegistry, ok := os.LookupEnv("KAMEL_INSTALL_REGISTRY")
g.Expect(ok).To(BeTrue(), "This test requires setting KAMEL_INSTALL_REGISTRY variable.")
g.Expect(ok).To(BeTrue(), "You must provide a registry address in KAMEL_INSTALL_REGISTRY env variable")
// Let's make sure no CRD is yet available in the cluster
// as we must make the procedure to install them accordingly
g.Eventually(CRDs(t)).Should(BeNil(), "No Camel K CRDs should be previously installed for this test")
Expand Down
File renamed without changes.
196 changes: 0 additions & 196 deletions helm/camel-k/templates/operator-cluster-role-bindings.yaml

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ metadata:
annotations:
{{ toYaml . | nindent 4 }}
{{- end }}

---

apiVersion: v1
kind: ServiceAccount
metadata:
name: camel-k-builder
labels:
app: "camel-k"
122 changes: 122 additions & 0 deletions helm/camel-k/templates/rbacs-common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app: camel-k
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
name: camel-k-edit
rules:
- apiGroups:
- camel.apache.org
resources:
- builds
- camelcatalogs
- integrationkits
- integrationplatforms
- integrationprofiles
- integrations
- pipes
- kamelets
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- camel.apache.org
resources:
- builds/status
- camelcatalogs/status
- integrationkits/status
- integrationplatforms/status
- integrationprofiles/status
- integrations/scale
- integrations/status
- pipes/scale
- pipes/status
- kamelets/status
verbs:
- get
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app: camel-k
name: camel-k-operator-bind-addressable-resolver
rules:
- apiGroups:
- rbac.authorization.k8s.io
resourceNames:
- addressable-resolver
resources:
- clusterroles
verbs:
- bind
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app: camel-k
name: camel-k-operator-custom-resource-definitions
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app: camel-k
name: camel-k-operator-bind-addressable-resolver
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: camel-k-operator-bind-addressable-resolver
subjects:
- kind: ServiceAccount
name: camel-k-operator
namespace: '{{ .Release.Namespace }}'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app: camel-k
name: camel-k-operator-custom-resource-definitions
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: camel-k-operator-custom-resource-definitions
subjects:
- kind: ServiceAccount
name: camel-k-operator
namespace: '{{ .Release.Namespace }}'
Loading

0 comments on commit 83ebae6

Please sign in to comment.