syndesisio / syndesis

This project is archived. A flexible, customizable, open source platform that provides core integration capabilities as a service.
https://syndesis.io/
Apache License 2.0
595 stars 203 forks source link

Support deployment on plain Kubernetes #6200

Closed balejos closed 4 years ago

balejos commented 5 years ago

Coming from a retro on decreasing the complexity of bringing up the dev environment, and also mentioned in Planning syndesis 2.0 We identified that working towards installing on plain Kubernetes, we would discover the assumptions we made and attract community deployment.

ToDo & Considerations:

balejos commented 5 years ago

related to https://github.com/syndesisio/syndesis/issues/3826 and https://github.com/syndesisio/syndesis/issues/6556

KurtStam commented 4 years ago

Some things come to mind that need to be looked at to make this happen:

  1. Switch the runtime to Camel-K (which can run on on plain K)
  2. Replace s2i (option)?
  3. SSO with OpenShift needs an alternative
  4. OpenShift Templates
  5. ?
lgarciaaco commented 4 years ago

We cannot use routes, imagestreams and deploymentconfigs ... they are all openshift objects

zregvart commented 4 years ago

Camel-K removes the need for Syndesis to perform the S2I build, it has strategies in place to perform the build itself either via S2I or via Kaniko.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

phantomjinx commented 4 years ago

Trying out https://microk8s.io/#get-started

phantomjinx commented 4 years ago

Need to define "plain Kubernetes".

Therefore what is the objective?

  1. Remove / migrate from Openshift-specific structural elements used in Syndesis to allow for a more-run-anywhere app?
  2. Allow / test installation & running on Syndesis on a number of different Kubernetes platforms to maximise community participation?
  3. Where an Openshift feature is considered essential, provide an alternative configuration for a Kubernetes install while retaining the Openshift feature, ie. maintenance of multiple installable configurations?
zregvart commented 4 years ago
  • Remove / migrate from Openshift-specific structural elements used in Syndesis to allow for a more-run-anywhere app?

OpenShift specific objects like DeploymentConfig and Route and the way we utilize S2I build make Syndesis non portable across any other Kubernetes distribution. I'd start with having a way to install and run Syndesis on Kubernetes. Defaulting to Camel K for running integrations will give us portability, as it supports both plain Kubernetes and OpenShift.

  • Allow / test installation & running on Syndesis on a number of different Kubernetes platforms to maximise community participation?

I'd focus on one, minikube is probably the one used most as a developer platform (similar to minishift/crc), running on minikube should be a representative common ground for any Kubernetes. I don't mind giving microk8s a try, but I think we should not spread ourselfs too thinly.

  • Where an Openshift feature is considered essential, provide an alternative configuration for a Kubernetes install while retaining the Openshift feature, ie. maintenance of multiple installable configurations?

The approach Camel K took is to have support for both OpenShift and Kubernetes, I think that makes sense. Though I don't think we need to depend on OpenShift specifics too much even when running on OpenShift. What we have, for example, with DeploymentConfig is caused either us not realizing the Kubernetes alternative (Deployment) or not having that ability at the time we started.

phantomjinx commented 4 years ago

Gist for guidelines on converting DeploymentConfig to Deployment: https://gist.github.com/bmaupin/d5be3ca882345ff92e8336698230dae0

phantomjinx commented 4 years ago

Interesting issue/discussion of possibility of oc conversion of Deployment/DeploymentConfig (sadly stale atm) https://github.com/openshift/origin/issues/16763

phantomjinx commented 4 years ago

Creating an ingress resource -> https://blog.openshift.com/kubernetes-ingress-vs-openshift-route/

phantomjinx commented 4 years ago

Progress with research links

  1. Configured ability to build operator image into docker registry;

  2. Understood that local docker registry is independant of kubernetes registry and s2i build provided in syndesis build scripts builds and adds the image to the openshift registry. This does not happen with kubernetes;

  3. Encountered error concerning locahost defaulting to ipv6 ::1 ip address - results in hang on 'docker push'

    • Changed all references to localost to 127.0.0.1 and retried -> docker push succeeded
    • Once in, microk8 registry failed to find image when install of syndesis-operator executed syndesis-operator install operator --image 127.0.0.1:32000/syndesis-operator --tag latest
    • Bug report that shows containerd problem in microk8 implementation and found that the file in question also refers to 'localhost' rather than '127.0.0.1' (https://github.com/ubuntu/microk8s/issues/384#issuecomment-480616243)
    • Modified file and restarted microk8 and operator pod successful

      Note: The built-in registry is NOT the same as the image cache available via microk8.ctr images. So just because am image was pushed to 127.0.0.1:32000 doesn't mean it will have appeared in the image cache until it is actually used.

  4. The operator has 2 distinct switch points available for custom image/tag combinations a) When building the operator we can change the default image/tag combination b) When running the operator we can change override the default image/tag combination

lburgazzoli commented 4 years ago

Gist for guidelines on converting DeploymentConfig to Deployment: https://gist.github.com/bmaupin/d5be3ca882345ff92e8336698230dae0

Once syndesis migrates to camel-k this won't be needed any more as camel-k takes care of generating the right "deployment" depending on the environment (i.e. it takes also into account knative services)

phantomjinx commented 4 years ago

Gist for guidelines on converting DeploymentConfig to Deployment: https://gist.github.com/bmaupin/d5be3ca882345ff92e8336698230dae0

Once syndesis migrates to camel-k this won't be needed any more as camel-k takes care of generating the right "deployment" depending on the environment (i.e. it takes also into account knative services)

Thanks @lburgazzoli. Yes you're right but we do need it at the moment though in converting the other Syndesis DeploymentConfig's, eg operator, syndesis-db. Converted the operator end-of-last-week.

phantomjinx commented 4 years ago

Kubebox -> https://github.com/astefanutti/kubebox

Kubespy -> https://github.com/pulumi/kubespy

phantomjinx commented 4 years ago

A blog on the interesting problems encountered in kubernetes development.

phantomjinx commented 4 years ago

First experiment with an ingress (the kubernetes alternative to OS routes)

Enabling the dashboard and exposing it through an https ingress.

Supplemental

Not required but FYI

phantomjinx commented 4 years ago

Openshift auto-generates a self-signed key/certificate combo when the service is given the following annotation:

annotations:
      service.alpha.openshift.io/serving-cert-secret-name: <name-of-secret-to-be-created>

This is responsible for the syndesis-oauthproxy-tls secret that is mounted by the syndesis-oauth-proxy.

phantomjinx commented 4 years ago

microk8s basic auth csv format:

password,user,uid,"group1,group2,group3"
phantomjinx commented 4 years ago

Since kubernetes distributions don't tend to come with an authentication/authorization identity-provider, it is necessary to install one then using OpenID Connect tie into it with oauth2_proxy. The latter to be used instead of the openshift oauth-proxy since it is designed to work with openshift.

Useful references for setting up keycloak as provider:

Alternative to keycloak is dex which can act as shim to google or github

Using keycloak in oauth2_proxy

phantomjinx commented 4 years ago

First time syndesis executed on kuberenetes implementation! syndesis-on-kubernetes

phantomjinx commented 4 years ago

Summary of major issues to be addressed:

  1. The {{.Syndesis.RouteHostname}} is blank

  2. Cannot install/use ingresses on minishift since it is only 3.11 and does not support them

  3. Need to generate certicates for the oauth2_proxy in order to use TLS. Openshift does this automatically but of course on kubernetes this is not

  4. The image for oauth2_proxy is quay.io hence a need to modify the build/conf/config.yaml. This needs further work to add in coordinates for specifying the auth provider, client-id & secret

  5. Modify arguments of oauth2_proxy since they need to be broader than the openshift version of oauth_proxy

  6. Update route to be ingress although the difficulty is ensuring this will be backward-compatible

  7. Small changes in code required, including

    • route.Spec.host -> ingress.Spec.rules[0].Host
    • DeploymentConfig -> Deployment (especially when calling wait execution code expecting the former)
    • A definitive Platform attribute in the configuration to act as an if condition
    • Changes in RBAC rules to allow for ingresses

Conclusion

rplescia commented 4 years ago

I'm super excited about this development stream to port it to plain kubernetes

medkbadri commented 4 years ago

@phantomjinx good job Is it possible to share a repo containing the modifications that you performed? Thanks

Ettery commented 4 years ago

I'd love to support this but we are committed to vanilla Kubernetes on-prem and AWS as a cloud provider.

phantomjinx commented 4 years ago

PR for review -> https://github.com/syndesisio/syndesis/pull/8697

SvenC56 commented 4 years ago

If installation on Kubernetes will be possible. Will there also be a helm chart?

phantomjinx commented 4 years ago

@SvenC56 Up until this point, I've never used helm but can certainly consider it.

mingfang commented 2 years ago

Please provide plain old docker images and Kubernetes yaml files. No helm, operator, openshift specific stuff.