Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Add in ability to install on kubernetes as well as openshift #8697

Merged
merged 4 commits into from
Jul 2, 2020

Conversation

phantomjinx
Copy link
Contributor

@phantomjinx phantomjinx commented Jun 13, 2020

Am sure there may be things people want to talk about so lets start the review and see how we get on.

#6200

@KurtStam
Copy link
Contributor

Hi @phantomjinx, super excited to see this come along. Would you be able to add a document in project/design to go over how this works and the decisions you took along the way?

@squakez
Copy link
Contributor

squakez commented Jun 15, 2020

Is there any known side effect with the current supported platform (openshift)?

@phantomjinx
Copy link
Contributor Author

Is there any known side effect with the current supported platform (openshift)?

At this point, I have installed on both openshift and minikube and worked to avoid any limitations or side-effects. It should be the case that installation on openshift happens as it always has.

Siginificant changes for openshift installation:

  • All DeploymentConfigs have migrated to be Deployments;
  • Imagestreams remain but Deployments do not have triggers. So a special annotation is added to each Deployment to provide the trigger to use the associated Imagestream;

Copy link
Contributor

@claudio4j claudio4j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phantomjinx I tried to install but I was stuck on creating the developer user.
At this point it asks for a cluster admin

$ syndesis kube user developer -n syndesis 
Changing to user "developer" with namespace "syndesis" on current cluster "minikube"
Please specify a cluster admin account to continue? :

Which I need to create a cluster admin user in kubernetes, similar to system:admin in openshift I believe, but I will try it next day.

Couple of comments:

  • I was able to use the minikube docker registry by using minikube docker-env. Build and pushed images (sample project). I didn't use the registry addon. Perhaps this docker can be used instead of the external docker registry (as you described in readme) ?
    - I added a parameter to generate a self-signed key/certificate
    claudio4j@310d7b3
  • generate a key is not appropriate as minikube ca didn't sign it, instead I suggest to document the possibility the user can reuse the .minikube/ca.key and .minikube/ca.crt when calling syndesis kube registry

tools/bin/commands/minikube Outdated Show resolved Hide resolved
tools/bin/commands/util/common_funcs Outdated Show resolved Hide resolved
@phantomjinx
Copy link
Contributor Author

Minikube comes with a cluster-admin account minikube

@phantomjinx
Copy link
Contributor Author

I was able to use the minikube docker registry by using minikube docker-env. Build and pushed
images (sample project). I didn't use the registry addon. Perhaps this docker can be used instead of
the external docker registry (as you described in readme) ?

You certainly can use this docker registry instead. However, it has certain implications:

  • The VM can be destroyed and recreated (& I frequently do so). In which case, the registry is destroyed too as is the builds created. This caused me some delays so I preferred a separate registry;
  • The certificate used to create the registry and make it secure will need recreating (if the VM is recreated) but also requires a DNS name (or IP). The name localhost can be used but referring to the from the build scripts can be problematic.

install/kubernetes/README.md Show resolved Hide resolved
tools/bin/commands/kube Outdated Show resolved Hide resolved
* Migrate DeploymentConfigs to Deployments

* Make Imagestreams conditional on API being available

* Uses discovery client to interrogate the names of the installed APIs.
  For example, if it has the ImageStreams API then the ApiSpec sets the
  flag appropriately.
* syndesis_types.go
 * Adds oauth secret properties to be specified in the CR. Used by k8
   for the auth provider credentials & tls comms certificate

* 04-syndesis-oauth-proxy...
 * Splits proxy template into OS & k8 versions
 * k8 version has image hard-coded since oauth2_proxy is required
 * k8 version has far broader config as it allows different providers
 * OS version generates the syndesis-oauthproxy-tls whereas the k8
   version cannot & requires this to be manually specified

* role.yml.tmpl
 * Adds ingress permissions

* ingress.yml.tmpl
 * Use ingress for k8 but retain route for OS since latter has ability to
   generate the route hostname

* action/install.go
* conduit.go
 * Uses new interface Conduit to wrap around ingress & route so install
   can interrogate them interchangeably.

* configuration.go
 * Moves Openshift flag to an ApiServer struct & track the version of k8
 * Adds non-OS checks on the RouteHostname & auth credentials/certificate
 * Adds routeHostname to SetRoute rather than asking to fetch it again
   since all instances of its use, the value is already known

* Only call checks on route host name & credentials when actual install

* Refactors syndesis tooling scripts for detecting platform and running
  the most appropriate functions

* Extra commands to supplement kubectl to make changing context easier

* README file for install instructions
* oauth2-proxy implementation can plugin multiple providers. Yet some
  require more config parameters than the minimum provider, client id &
  client secret. So make all parameters dependent upon credentials secret
  allowing multiple parameters to be converted by template parser into
  env vars variables.

* 04-syndesis-oauth-proxy...
 - All credentials-secret properties are converted to env vars using single
   template function

* configuration.go
 * findSecret not only confirms secret but returns it for use if required
 * CheckOAuthCredentialSecret finds the secret and adds its data to the
   config attribute CredentialsSecretData
 * SecretToEnvVars converts a secret data map into an EnvVars object,
   marshals it to yaml and return a string representation indenting with a
   requested number of tabs
* Fix minikube status check

* Stops traps overwriting each other by accumulating their commands

* Provides ADMIN_USER to platform specific scripts to avoid asking the
  user the question unnecessarily

* Exposes --dev switch to install script

* Improvements to kube commands

* Script for Minikube install

* Switch to using /data in Minikube persistent volumes as this directory
  is actually persisted between restarts

* Use CA_CERT & CA_KEY env vars to avoid asking the user for CA credentials

* Copies the platform-detect binary when building as well as the operator
Copy link
Contributor

@claudio4j claudio4j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, great job Paul.

@Delawen
Copy link
Contributor

Delawen commented Jul 2, 2020

I was going to wait for late Friday to merge this to have a sleepy Monday of everything broken... but why wait for the fun? :)

@Delawen Delawen merged commit 37da27a into syndesisio:master Jul 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support deployment on plain Kubernetes
5 participants