Skip to content

Commit

Permalink
fix: can't enable job server without deploying controller (#448)
Browse files Browse the repository at this point in the history
* avoid deployment of controller in icm-as
* extract image/repository to values.yaml
* remove namespace icm-system from helm-template
* move environment variable declaration to _environments.tpl
* remove JOB server group from icm-as in case job server is enabled
  • Loading branch information
Thomas-Bergmann committed Nov 6, 2023
1 parent a4062ef commit 94bd9d1
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 33 deletions.
5 changes: 0 additions & 5 deletions charts/icm-as/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,3 @@ version: 1.4.0
description: Intershop Commerce Management - AppServer
type: application
appVersion: 11.2.1
dependencies:
- name: icm-job
version: 1.0.1
repository: file://../icm-job
condition: job.enabled
24 changes: 23 additions & 1 deletion charts/icm-as/templates/_environments.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,26 @@ env:
- name: INTERSHOP_PAGECACHE_REDIS_ENABLED
value: "true"
{{- end }}
{{- end -}}
{{- end -}}

{{/*
Job-specific-environment
*/}}
{{- define "icm-as.envJob" }}
{{- include "icm-as.env" . }}
- name: MAIN_CLASS
value: "com.intershop.beehive.core.capi.job.JobServer"
- name: INTERSHOP_JOB_SERVER_EXCLUSIVE
value: "true"
- name: INTERSHOP_SERVER_ASSIGNEDTOSERVERGROUP
value: {{ .jobServerGroup }}
{{- end -}}

{{/*
AppServer-specific-environment
*/}}
{{- define "icm-as.envAS" }}
{{- include "icm-as.env" . }}
- name: INTERSHOP_SERVER_ASSIGNEDTOSERVERGROUP
value: "BOS,WSF"
{{- end -}}
2 changes: 1 addition & 1 deletion charts/icm-as/templates/as-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
containers:
- name: icm-as-server
{{- include "icm-as.image" . | nindent 8 }}
{{- include "icm-as.env" . | nindent 8 }}
{{- include "icm-as.envAS" . | nindent 8 }}
{{- include "icm-as.ports" . | nindent 8 }}
{{- include "icm-as.resources" . | nindent 8 }}
{{- include "icm-as.volumeMounts" . | nindent 8 }}
Expand Down
15 changes: 0 additions & 15 deletions charts/icm-as/templates/jobserver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,6 @@ spec:
{{- include "icm-as.volumes" . | nindent 10 }}
{{- end -}}

{{/*
Job-specific-environment
*/}}
{{- define "icm-as.envJob" }}
{{- include "icm-as.env" . }}
- name: MAIN_CLASS
value: "com.intershop.beehive.core.capi.job.JobServer"
- name: INTERSHOP_JOB_SERVER_EXCLUSIVE
value: "true"
- name: INTERSHOP_SERVER_ASSIGNEDTOSERVERGROUP
value: {{ .jobServerGroup }}
- name: SERVER_NAME
value: {{ .jobServerName }}
{{- end -}}

{{/*
Job-scheduling service
*/}}
Expand Down
1 change: 1 addition & 0 deletions charts/icm-as/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ sslCertificateRetrieval:
# In order to override these properties add them in the job section, e.g. add a 'resources' section to
# configure different cpu or memory limits.
job:
# if enabled=true the job controller must be deployed at cluster separatelly. see icm-job chart.
enabled: false

# If true, job-server-support will be available but no jobs will be created
Expand Down
2 changes: 1 addition & 1 deletion charts/icm-job/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
description: Intershop Commerce Management - ICM Job
description: Intershop Commerce Management - ICM Job Controller
# name and version must be in this exact order, otherwise bump2version won't work
name: icm-job
version: 1.0.1
10 changes: 9 additions & 1 deletion charts/icm-job/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

This chart brings job server functionality into the [ICM Application Server](../icm-as/README.md) (`icm-as`). If enabled long running jobs could run outside of the application server as kubernetes jobs.

It will install the ICMJob-CRD (Custom Resource Definition) per default. If the ICMJob-CRD already exists, it will be skipped with a warning. If you wish to skip this CRD installation step, you can pass the `--skip-crds` flag to the `helm install/upgrade` command. Note that uninstalling this chart will *NOT* uninstall the CRD. In order to uninstall the ICMJob-CRD use:
## Initial Deployment

```bash
helm install icm-job icm-job -n icm-system
```

## Redeployment

The chart will install the ICMJob-CRD (Custom Resource Definition) per default. If the ICMJob-CRD already exists, it will be skipped with a warning. If you wish to skip this CRD installation step, you can pass the `--skip-crds` flag to the `helm install/upgrade` command. Note that uninstalling this chart will *NOT* uninstall the CRD. In order to uninstall the ICMJob-CRD use:

```bash
kubectl delete -f crds/icm-job-controller.yaml
Expand Down
10 changes: 1 addition & 9 deletions charts/icm-job/templates/icm-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ metadata:
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/part-of: project
name: icm-controller-manager
namespace: icm-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand All @@ -31,7 +30,6 @@ metadata:
app.kubernetes.io/name: role
app.kubernetes.io/part-of: project
name: icm-leader-election-role
namespace: icm-system
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -169,15 +167,13 @@ metadata:
app.kubernetes.io/name: rolebinding
app.kubernetes.io/part-of: project
name: icm-leader-election-rolebinding
namespace: icm-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: icm-leader-election-role
subjects:
- kind: ServiceAccount
name: icm-controller-manager
namespace: icm-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -197,7 +193,6 @@ roleRef:
subjects:
- kind: ServiceAccount
name: icm-controller-manager
namespace: icm-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -217,7 +212,6 @@ roleRef:
subjects:
- kind: ServiceAccount
name: icm-controller-manager
namespace: icm-system
---
apiVersion: v1
kind: Service
Expand All @@ -231,7 +225,6 @@ metadata:
app.kubernetes.io/part-of: project
control-plane: controller-manager
name: icm-controller-manager-metrics-service
namespace: icm-system
spec:
ports:
- name: https
Expand All @@ -253,7 +246,6 @@ metadata:
app.kubernetes.io/part-of: project
control-plane: controller-manager
name: icm-controller-manager
namespace: icm-system
spec:
replicas: 1
selector:
Expand Down Expand Up @@ -315,7 +307,7 @@ spec:
- --leader-elect
command:
- /manager
image: intershophub/icm-job-operator:1.0.0-dev5
image: "{{ .Values.image.repository }}{{ if not (contains ":" .Values.image.repository) }}:{{ .Values.image.tag | default .Chart.AppVersion }}{{ end }}"
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down
3 changes: 3 additions & 0 deletions charts/icm-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ dockerSecret:
## Intershop: These secrets also last for customization images
imagePullSecrets:
- "dockerhub"

image:
repository: intershophub/icm-job-operator:1.0.0-dev5

0 comments on commit 94bd9d1

Please sign in to comment.