Closed HansG89 closed 2 years ago
Many thanks for this report. From the log, it looks like it jumps from
INFO: Starting service [Tomcat] Feb 02, 2022 8:43:39 AM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/8.5.41
directly to
Killed
Is there no Exception message or anything similar?
What are the exact steps that lead to this error, does it crash right after registering the AAS at the registry?
Thank you for your quick reply
Is there no Exception message or anything similar?
No further exception details in the log
What are the exact steps that lead to this error
I provided kubernetes deployments for the registry and the aas server. The aas server uses a persistent volume, which is basically a volume mount to the host. It contains the aasx file.
When I remove the registry.path
form aas.properties
the AAS gets successfully registered in the server and I can query it.
But as soon as I add the registry.path and point it to a DNS name inside my cluster (e.g. http://aas-registry-service.basys.svc.cluster.local:4000/registry/
) the aas server crashes. The funny thing is, that the AAS gets registered before the crash. So when I query my registry, I can see the aas. But there is no further line of code after starting the server
Thank you very much for providing further details. We will try to reproduce the issue on our end update the Issue accordingly.
Thank you very much for providing further details. We will try to reproduce the issue on our end update the Issue accordingly.
I figured out the problem. It was just an issue in the k8s resource limits. I limited the amount of RAM for the AAS Server to 100Mi which seems to be enough for an empty server without any loaded .aasx file but as soon as the file gots loaded, k8s kills the pod because it exceeds memory limits. So no issue in the application code but a configuration problem. Stupid me!
This is my working config:
registry-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: registry-config
namespace: basys
data:
context.properties: |
contextPath=
contextHostname=localhost
contextPort=4000
registry.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: aas-registry
namespace: basys
labels:
app: aas-registry
spec:
selector:
matchLabels:
app: aas-registry
replicas: 1
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: aas-registry
spec:
containers:
- name: aas-registry
image: eclipsebasyx/aas-registry:1.0.4
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 100m
memory: 500Mi
livenessProbe:
tcpSocket:
port: 4000
initialDelaySeconds: 5
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
periodSeconds: 10
readinessProbe:
httpGet:
path: /api/v1/registry
port: 4000
initialDelaySeconds: 5
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 3
periodSeconds: 10
ports:
- containerPort: 4000
name: registry-server
volumeMounts:
- name: registry-config-volume
mountPath: /usr/share/config/context.properties
subPath: context.properties
volumes:
- name: registry-config-volume
configMap:
name: registry-config
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: aas-registry-service
namespace: basys
spec:
type: ClusterIP
selector:
app: aas-registry
ports:
- name: registry-server-port
protocol: TCP
port: 4000
targetPort: 4000
storage.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: aasx-files-volume
namespace: basys
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/Users/xxx/aasx-files"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: aasx-files-claim
namespace: basys
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
aas-server-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: aas-server-config
namespace: basys
data:
context.properties: |
contextPath=
contextHostname=localhost
contextPort=4001
aas.properties: |
aas.backend=InMemory
aas.source=/usr/share/config/data/demo-aas.aasx
registry.path=http://aas-registry-service.basys.svc.cluster.local:4000
aas-server.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: aas-server
namespace: basys
labels:
app: aas-server
spec:
selector:
matchLabels:
app: aas-server
replicas: 1
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: aas-server
spec:
containers:
- name: aas-server
image: eclipsebasyx/aas-server:1.0.2
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 200m
memory: 500Mi
livenessProbe:
tcpSocket:
port: 4001
initialDelaySeconds: 5
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
periodSeconds: 10
readinessProbe:
httpGet:
path: /shells
port: 4001
initialDelaySeconds: 5
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 3
periodSeconds: 10
ports:
- containerPort: 4001
name: aas-server
volumeMounts:
- name: aas-server-config-volume
mountPath: /usr/share/config/context.properties
subPath: context.properties
- name: aas-server-config-volume
mountPath: /usr/share/config/aas.properties
subPath: aas.properties
- mountPath: /usr/share/config/data
name: aasx-files-storage
volumes:
- name: aas-server-config-volume
configMap:
name: aas-server-config
- name: aasx-files-storage
persistentVolumeClaim:
claimName: aasx-files-claim
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: aas-server-service
namespace: basys
spec:
type: ClusterIP
selector:
app: aas-server
ports:
- name: aas-server-port
protocol: TCP
port: 4001
targetPort: 4001
I'm happy that you could solve this issue. Many thanks also for providing your Kubernetes config!
I tried to use the provided images
eclipsebasyx/aas-registry:1.0.4
andeclipsebasyx/aas-server:1.0.2
to use them in a local kubernetes testing environment. When I don't provide a registry URL to the AAS Server, everything works fine. I can load an aasx file from a persistent kubernetes storage and of course the AAS does not get registered. When I provide a registry URL something strange happens. I can access the registry with its kubernetes internal DNS name and the AAS successfully gets registered. But afterwards the AAS server immediately crashes with the logs attached. Any idea how to further debug this issue?