Skip to content

Commit

Permalink
Merge pull request #290 from RedHatInsights/set-frontend-environment-…
Browse files Browse the repository at this point in the history
…replicas

Set frontend environment replicas
  • Loading branch information
adamrdrew authored Jan 6, 2025
2 parents c903722 + 0b6c51b commit a4cc7cd
Show file tree
Hide file tree
Showing 10 changed files with 865 additions and 701 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store

# Binaries for programs and plugins
*.exe
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
GOTESTSUM ?= $(LOCALBIN)/gotestsum

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_VERSION ?= v5.5.0
CONTROLLER_TOOLS_VERSION ?= v0.16.4
GOTESTSUM_VERSION ?= v1.9.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
Expand Down
1 change: 0 additions & 1 deletion apis/cloud.redhat.com/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

542 changes: 283 additions & 259 deletions config/crd/bases/cloud.redhat.com_namespacepools.yaml

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions config/crd/bases/cloud.redhat.com_namespacereservations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.16.4
name: namespacereservations.cloud.redhat.com
spec:
group: cloud.redhat.com
Expand Down Expand Up @@ -39,14 +38,19 @@ spec:
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down
54 changes: 4 additions & 50 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
Expand All @@ -25,36 +24,9 @@ rules:
- cloud.redhat.com
resources:
- clowdenvironments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cloud.redhat.com
resources:
- clowdenvironments/status
verbs:
- get
- apiGroups:
- cloud.redhat.com
resources:
- frontendenvironments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cloud.redhat.com
resources:
- namespacepools
- namespacereservations
verbs:
- create
- delete
Expand All @@ -66,38 +38,20 @@ rules:
- apiGroups:
- cloud.redhat.com
resources:
- namespacepools/finalizers
verbs:
- update
- apiGroups:
- cloud.redhat.com
resources:
- namespacepools/status
verbs:
- get
- patch
- update
- apiGroups:
- cloud.redhat.com
resources:
- namespacereservations
- clowdenvironments/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cloud.redhat.com
resources:
- namespacepools/finalizers
- namespacereservations/finalizers
verbs:
- update
- apiGroups:
- cloud.redhat.com
resources:
- namespacepools/status
- namespacereservations/status
verbs:
- get
Expand Down
10 changes: 6 additions & 4 deletions controllers/cloud.redhat.com/helpers/frontends.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ func CreateFrontendEnv(ctx context.Context, cl client.Client, namespaceName stri

frontendEnv = frontend.FrontendEnvironment{
Spec: frontend.FrontendEnvironmentSpec{
Hostname: clowdEnv.Status.Hostname,
SSO: ssoURL,
IngressClass: clowdEnv.Spec.Providers.Web.IngressClass,
GenerateNavJSON: true,
Hostname: clowdEnv.Status.Hostname,
SSO: ssoURL,
IngressClass: clowdEnv.Spec.Providers.Web.IngressClass,
GenerateNavJSON: true,
EnableAkamaiCacheBust: false,
DefaultReplicas: func(i int32) *int32 { return &i }(1),
},
}

Expand Down
Loading

0 comments on commit a4cc7cd

Please sign in to comment.