Skip to content

Commit

Permalink
Merge pull request #145 from mmadzin/limits
Browse files Browse the repository at this point in the history
Update pod resources
  • Loading branch information
mmadzin authored Nov 27, 2024
2 parents 0a24148 + e644d77 commit 1f42788
Show file tree
Hide file tree
Showing 7 changed files with 351 additions and 38 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
config/manifests/bases/*
bundle/*
bundle.Dockerfile

# Binaries for programs and plugins
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/webserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type WebServerSpec struct {
// (Deployment method 2) Imagestream
WebImageStream *WebImageStreamSpec `json:"webImageStream,omitempty"`
// Configuration of the resources used by the WebServer, ie CPU and memory, use limits and requests
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
PodResources corev1.ResourceRequirements `json:"podResources,omitempty"`
//If true operator will create a PVC to save the logs.
PersistentLogs bool `json:"persistentLogs,omitempty"`
//If true operator will log tomcat's access logs
Expand Down
6 changes: 1 addition & 5 deletions api/v1alpha1/zz_generated.deepcopy.go

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

340 changes: 340 additions & 0 deletions bundle/manifests/jws-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,340 @@
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
annotations:
alm-examples: '[]'
capabilities: Basic Install
operators.operatorframework.io/builder: operator-sdk-v1.25.3
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
name: jws-operator.v0.0.1
namespace: placeholder
spec:
apiservicedefinitions: {}
customresourcedefinitions:
owned:
- kind: WebServer
name: webservers.web.servers.org
version: v1alpha1
specDescriptors:
- description: Pod resources
displayName: Pod Resources
path: podResources
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:resourceRequirements
description: jws-mm
displayName: jws-mm
icon:
- base64data: ""
mediatype: ""
install:
spec:
clusterPermissions:
- rules:
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- apps
resources:
- jws-operator
verbs:
- update
- apiGroups:
- apps.openshift.io
resources:
- deploymentconfigs
verbs:
- create
- delete
- get
- list
- update
- watch
- apiGroups:
- build.openshift.io
resources:
- buildconfigs
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- build.openshift.io
resources:
- builds
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- ""
resources:
- services
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- ""
resources:
- services/finalizers
verbs:
- update
- apiGroups:
- image.openshift.io
resources:
- imagestreams
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
verbs:
- create
- get
- grant
- list
- watch
- apiGroups:
- route.openshift.io
resources:
- routes
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- route.openshift.io
resources:
- routes/custom-host
verbs:
- create
- get
- apiGroups:
- web.servers.org
resources:
- webservers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- web.servers.org
resources:
- webservers/finalizers
verbs:
- update
- apiGroups:
- web.servers.org
resources:
- webservers/status
verbs:
- get
- patch
- update
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
serviceAccountName: jws-operator-controller-manager
deployments:
- label:
control-plane: controller-manager
name: jws-operator-controller-manager
spec:
replicas: 1
selector:
matchLabels:
control-plane: controller-manager
strategy: {}
template:
metadata:
labels:
control-plane: controller-manager
spec:
containers:
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=10
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
protocol: TCP
resources: {}
- args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=127.0.0.1:8080
- --leader-elect
command:
- /manager
image: quay.io/mmadzin/jws-operator:latest
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: manager
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 100m
memory: 20Mi
securityContext:
allowPrivilegeEscalation: false
securityContext:
runAsNonRoot: true
serviceAccountName: jws-operator-controller-manager
terminationGracePeriodSeconds: 10
permissions:
- rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
serviceAccountName: jws-operator-controller-manager
strategy: deployment
installModes:
- supported: false
type: OwnNamespace
- supported: false
type: SingleNamespace
- supported: false
type: MultiNamespace
- supported: true
type: AllNamespaces
keywords:
- jws
- mm
links:
- name: Jws Operator
url: https://jws-operator.domain
maturity: alpha
provider:
name: mm
version: 0.0.1
12 changes: 6 additions & 6 deletions config/crd/bases/web.servers.org_webservers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,7 @@ spec:
persistentLogs:
description: If true operator will create a PVC to save the logs.
type: boolean
replicas:
description: The desired number of replicas for the application
format: int32
minimum: 0
type: integer
resources:
podResources:
description: Configuration of the resources used by the WebServer,
ie CPU and memory, use limits and requests
properties:
Expand All @@ -191,6 +186,11 @@ spec:
to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
replicas:
description: The desired number of replicas for the application
format: int32
minimum: 0
type: integer
routeHostname:
description: Route behaviour:[tls]hostname/NONE or empty.
type: string
Expand Down
Loading

0 comments on commit 1f42788

Please sign in to comment.