Kubernetes Operator for Enonic XP released (beta)

Hi everybody.

We have released the beta version of our Kubernetes Operator for Enonic XP and the source is available. It helps you deploy Enonic XP, using custom Kubernetes resources. The project is still in beta, so expect some instability and non backwards compatible changes. But it is stable enough that we would like to show you guys the progress we have made.

Hope you guys are as exited about this as we are. All feedback is appreciated. Have a nice day!

5 Likes

@gbi @tsi
I am working on 2 web-pages using enonic solutions with NextXP.

I already have a K8-Cluster on AWS and therefore I tested this operator.

I have some issues on a local K8 Cluster (using the integrated Docker Desktop Solution).

As I did not get much response to my posts related to this solution, I kindly ask you, if this solution is still on your roadmap or if you prefer a different approach ?

I am available for testing with pleasure :slight_smile:

Hi Thomas.

The operator most certainly is relevant, as it is at the ver “heart” of our new self service cloud, and we believe it is the future for anyone looking to host Enonic themselves.

We have not released any new versions lately, as we have not had many issues with it. However, if there are issues we will certainly look into them.

Please share your problems here. I assume you are using Minikube?

Hi Thomas,

No I just activated Kubernetes in Docker Desktop !

Here my main issue:
I stared testing with a single enonic instance as decribed in your docs here: https://developer.enonic.com/docs/kubernetes-operator-for-xp/master/usage#simple_example

I am using the latest xp and content-studio version. Everthing runs as expected until I start to add some data. The pod with the xp-image crashes unpredictiable and is redeployed.

When I try to upload an image, which is greater than 1MB (?) the same behaviour.

I did not see any errors in the xp-logs!
What can I do?

@tsi
After further investigation I found the following error-message in the xp-operator logs:

2023-01-21 09:09:50,428 ERROR io.fab.kub.cli.inf.cac.SharedProcessor - Failed invoking com.enonic.kubernetes.operator.ingress.OperatorIngress@229d7c1d event handler: 
Failure executing: GET at: https://10.96.0.1/apis/networking.k8s.io/v1beta1/namespaces/my-namespace/ingresses/my-domain-com. 
Message: the server could not find the requested resource. 
Received status: Status(apiVersion=v1, code=404, details=StatusDetails(causes=[], group=null, kind=null, name=null, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=the server could not find the requested resource, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=NotFound, status=Failure, additionalProperties={}).: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://10.96.0.1/apis/networking.k8s.io/v1beta1/namespaces/my-namespace/ingresses/my-domain-com. Message: the server could not find the requested resource. Received status: Status(apiVersion=v1, code=404, details=StatusDetails(causes=[], group=null, kind=null, name=null, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=the server could not find the requested resource, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=NotFound, status=Failure, additionalProperties={}).

So tit seems, there is an issue with the ingress-configuration:

# Expose XP through an ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-domain-com
  namespace: my-namespace
  annotations:
    enonic.cloud/xp7.vhost.mapping.my-mapping-site.source: /
    enonic.cloud/xp7.vhost.mapping.my-mapping-site.target: /site/default/master/homepage

    enonic.cloud/xp7.vhost.mapping.my-mapping-admin.source: /admin
    enonic.cloud/xp7.vhost.mapping.my-mapping-admin.target: /admin
    enonic.cloud/xp7.vhost.mapping.my-mapping-admin.idproviders: system
spec:
  ingressClassName: nginx
  rules:
    - host: localhost
      http:
        paths:
          - path: /
            pathType: ImplementationSpecific
            backend:
              service:
                name: main
                port:
                  number: 8080

          - path: /admin
            pathType: ImplementationSpecific
            backend:
              service:
                name: main
                port:
                  number: 8080

I am using the following ingress-controller: Installation Guide - NGINX Ingress Controller
I used the following command to install the controller:

helm upgrade --install ingress-nginx ingress-nginx \
  --repo https://kubernetes.github.io/ingress-nginx \
  --namespace ingress-nginx --create-namespace

I have not seen this before. I understand this is a local dev environment. Have you tested the same using miniKube?

Not yet - but I will try using minikube instead!
@tsi Unfortunately I get exact the same error-message from xp-controller as already posted :frowning:
Also the pod crashes unpredictable :frowning: