diff --git a/component/class/defaults.yml b/component/class/defaults.yml index e22fe539d..399c041bd 100644 --- a/component/class/defaults.yml +++ b/component/class/defaults.yml @@ -134,7 +134,6 @@ parameters: memory: 200Mi stsResizer: - enabled: true resources: requests: cpu: 100m diff --git a/component/component/statefuleset-resize-controller.jsonnet b/component/component/statefuleset-resize-controller.jsonnet index bfe106a9e..b558deafa 100644 --- a/component/component/statefuleset-resize-controller.jsonnet +++ b/component/component/statefuleset-resize-controller.jsonnet @@ -103,7 +103,7 @@ local resizeClusterRoleBinding = kube.ClusterRoleBinding('appcat:job:resizejob') }; // Curently we only need this for redis. -if params.services.vshn.enabled && params.services.vshn.stsResizer.enabled then { +if params.services.vshn.enabled && (params.services.vshn.redis.enabled || params.services.vshn.services.mariadb.enabled) then { 'controllers/sts-resizer/10_role': role, 'controllers/sts-resizer/10_sa': sa, 'controllers/sts-resizer/10_binding': binding, diff --git a/component/component/vshn_appcat_services.jsonnet b/component/component/vshn_appcat_services.jsonnet index 2fa825380..97f7a5ea1 100644 --- a/component/component/vshn_appcat_services.jsonnet +++ b/component/component/vshn_appcat_services.jsonnet @@ -26,8 +26,7 @@ local getServiceNamePlural(serviceName) = local vshn_appcat_service(name) = local isOpenshift = std.startsWith(inv.parameters.facts.distribution, 'openshift'); - local securityContext = !isOpenshift; - + local serviceParams = params.services.vshn.services[name]; local connectionSecretKeys = serviceParams.connectionSecretKeys; local promRuleSLA = prom.PromRuleSLA(serviceParams.sla, serviceParams.serviceName); diff --git a/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_binding.yaml b/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_binding.yaml deleted file mode 100644 index a8e67764c..000000000 --- a/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_binding.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: appcat:contoller:sts-resizer - namespace: syn-appcat -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: appcat:contoller:sts-resizer -subjects: - - kind: ServiceAccount - name: sts-resizer - namespace: syn-appcat diff --git a/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_deployment.yaml b/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_deployment.yaml deleted file mode 100644 index 834bb9076..000000000 --- a/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_deployment.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - control-plane: controller-manager - name: sts-resizer - namespace: syn-appcat -spec: - replicas: 1 - selector: - matchLabels: - control-plane: controller-manager - template: - metadata: - labels: - control-plane: controller-manager - spec: - containers: - - args: - - --inplace - image: quay.io/vshn/statefulset-resize-controller:v0.3.0 - 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: 250m - memory: 200Mi - requests: - cpu: 100m - memory: 50Mi - securityContext: - allowPrivilegeEscalation: false - securityContext: - runAsNonRoot: true - serviceAccountName: sts-resizer - terminationGracePeriodSeconds: 10 diff --git a/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_role.yaml b/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_role.yaml deleted file mode 100644 index 9f81459dd..000000000 --- a/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_role.yaml +++ /dev/null @@ -1,88 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: appcat:contoller:sts-resizer - namespace: syn-appcat -rules: - - apiGroups: - - '' - resources: - - serviceaccounts - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - apps - resources: - - statefulsets - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - apps - resources: - - statefulsets/finalizers - verbs: - - update - - apiGroups: - - apps - resources: - - statefulsets/status - verbs: - - get - - patch - - update - - apiGroups: - - batch - resources: - - jobs - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - batch - resources: - - jobs/status - verbs: - - get - - patch - - update - - apiGroups: - - '' - resources: - - persistentvolumeclaims - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - - apiGroups: - - rbac.authorization.k8s.io - resources: - - rolebindings - verbs: - - create - - delete - - get - - list - - patch - - update - - watch diff --git a/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_sa.yaml b/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_sa.yaml deleted file mode 100644 index 5ba89fa5f..000000000 --- a/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/10_sa.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: sts-resizer - namespace: syn-appcat diff --git a/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/20_rbac_resize_job.yaml b/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/20_rbac_resize_job.yaml deleted file mode 100644 index 601f8711e..000000000 --- a/component/tests/golden/minio/appcat/appcat/controllers/sts-resizer/20_rbac_resize_job.yaml +++ /dev/null @@ -1,72 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - annotations: {} - labels: - name: sa-sts-deleter - name: sa-sts-deleter - namespace: syn-appcat-control ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - annotations: {} - labels: - name: appcat-job-resizejob - name: appcat:job:resizejob -rules: - - apiGroups: - - helm.crossplane.io - resources: - - releases - verbs: - - get - - list - - watch - - update - - patch - - create - - delete - - apiGroups: - - apps - resources: - - statefulsets - verbs: - - delete - - get - - watch - - list - - update - - patch - - apiGroups: - - helm.crossplane.io - resources: - - releases - verbs: - - update - - get - - apiGroups: - - '' - resources: - - pods - verbs: - - list - - get - - update - - delete ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - annotations: {} - labels: - name: appcat-job-resizejob - name: appcat:job:resizejob -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: appcat:job:resizejob -subjects: - - kind: ServiceAccount - name: sa-sts-deleter - namespace: syn-appcat-control diff --git a/component/tests/golden/minio/appcat/appcat/statefuleset-resize-controller.yaml b/component/tests/golden/minio/appcat/appcat/statefuleset-resize-controller.yaml new file mode 100644 index 000000000..e69de29bb