Giter VIP home page Giter VIP logo

container-native-spring-postgresql's Introduction

Container Native Microservices with OpenShift Sample Application

This tutorial shows the steps to install and run a Spring Boot microservice with PostgreSQL in a container-native way.

This sample application is comprised of:

  • Spring Boot 1.5 with RHOAR for microservices (In Progress)
  • Red Hat SSO 7.1 (a.k.a. Keycloak 2.5.5) for user management, authentication with JWT
    • Scalable, High Availability configuration using Kube Ping
    • Persistence with PostgreSQL
    • Pre-configured Realms for quick setup (TODO)
  • Istio 0.4 (latest) for service mesh and security (In Progress)
    • Injection of Envoy/Istio sidecar proxy into microservice pod
    • Authorization of web service access via JWT and SSO with Istio Mixer rule
    • Mutual TLS
  • Microsegmentation Rules (TODO)
  • Prometheus (Istio Integration)
  • Zipkin (Istio Integration)
  • Grafana (Istio Integration)
  • Service Graph (Istio Integration)
  • Hashicorp Vault for managing secrets (In Progress)
  • Crunchy Operator for High Availability PostgreSQL (In Progress)

The application has the following architecture:

Architecture

Assumptions:

  1. You have an OpenShift Container Platform cluster >= 3.7
  2. You have dynamic volume provisioning available (it's possible to use static provisioning provided that you have enough volumes)
  3. You are running the network policy plugin.
    • To enable the network policy plugin on Minishift use: ./minishift openshift config set --patch='{"networkConfig":{"networkPluginName":"redhat/openshift-ovs-networkpolicy"}}

Here are the steps for the installation:

Step Architcture
1. Deploy the Crunchy Postgres operator step1
2. Deploy Postgres in HA step2
3. Deploy Hashicorp Vault step3
4. Configure Vault to use Kubernetes backend authentication step4
5. Configure Vault to manage the postgresql DB step5
6. Configure application to use Vault to retrieve the postgresql account step6
7. RH SSO installation step7
8. Istio core installation step8
9. Configure app to use Istio step9
10. Configure Istio to do Mutual TLS authentication step10
11. Configure istio to do OAuth Authentication via RH SSO step11
12. Istio Add-ons installation (prometheus, Jaeger) step12
13. Configure microsegmentation step13
14. Build and deploy the application step14

POC Outcome (as of 2/1/2018)

technology production ready comments
RHOAR yes the maven plugin may not be fitting for all use cases
HA database running in openshift yes - HA templates to be developed with the customer - day 2 operations still not container native
postgres operator no main reason: lack of integration with enterprise security, it's in the roadmap to solve this
Vault yes
RH SSO yes
istio no privileged scc permission needs to be given to all pods running in the mesh
Application managed OAuth yes
Istio managed OAuth no seems a very frail configuration at this point, future versions of Istio may solve this issue
Istio managed mTLS yes more testing required
microsegmentation N/A not completed at this point

container-native-spring-postgresql's People

Contributors

deewhyweb avatar murphye avatar raffaelespazzoli avatar samirshamsi100 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

container-native-spring-postgresql's Issues

install vault

How can we install the vault as the markdown page is not very clear about that ? Is there an OpenShift template available ? How is the client installed on the machine of the user ?

Problem creating postgres HA

I'm getting the following issue for postgres-ha deployment, the readiness probe fails:

Readiness probe failed: setting PGROOT to /usr/pgsql-10 chown: cannot access '/pgdata/postgres-ha': Permission denied chown: cannot access '/pgwal/postgres-ha-wal': No such file or directory psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

I see the following the container is started:

+ mkdir -p /pgdata/postgres-ha
--
  | mkdir: cannot create directory '/pgdata': Permission denied
  | + chmod 0700 /pgdata/postgres-ha
  | User id is...
  | uid=26(postgres) gid=26(postgres) groups=26(postgres)
  | chmod: cannot access '/pgdata/postgres-ha': Permission denied
  | + [[ -v ARCHIVE_MODE ]]
  | + rm /pgdata/postgres-ha/postmaster.pid
  | rm: cannot remove '/pgdata/postgres-ha/postmaster.pid': Permission denied

Any input?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.