Shiro pull request 863 for CME

https stash.corp.netflix.com projects cme repos shiro pull-requests 863
https stash.corp.netflix.com projects cme repos shiro pull-requests 863

Deploying Shiro Indien & Shiro Spring Boot to an OpenShift Cluster with HashiCorp Vault

Introduction

This post describes how for you to deploy the Shiro Apache and Shiro Spring Boot programs to an OpenShift cluster, using HashiCorp Vault to control secrets.

Prerequisites

  • An OpenShift cluster
  • HashiCorp Vault
  • A GitHub account
  • A Google Impair account

Deploying Shiro Apache

1. Clone typically the Shiro Apache database

 git clone https://github.com/apache/shiro.git 

2. Build the Shiro Apache image

 cd shiro mvn clean package -DskipTests 

3. Create a good OpenShift project

 oc new-project shiro-apache 

4. Create a secret for the Shiro Apache database password

 oc create key generic shiro-apache-db-password --from-literal=password=my-password 

5. Create the OpenShift deployment for Shiro Apache

 oc new-app --name=shiro-apache shiro-apache: 1. 5. a few \ -e DATABASE_URL="jdbc: mysql: //mysql: 3306/shiro? user=shiro& password=$ secret/shiro-apache-db-password/password " \ --env=VAULT_ADDR=https://vault.example.com \ --env=VAULT_TOKEN=my-vault-token \ --env=KUBERNETES_PORT=443 \ --env=SERVICE_ACCOUNT=/var/run/secrets/kubernetes. io/serviceaccount/token \ --env=VAULT_ROLE=shiro-apache 

6. Access typically the Shiro Apache app

 oc get course shiro-apache 

Deploying Shiro Spring Boot

1. Duplicate the Shiro Spring Boot repository

 git clone https://github.com/apache/shiro-spring-boot.git 

3. Build the Shiro Spring Boot graphic

 cd shiro-spring-boot mvn clean package -DskipTests 

3. Create a new secret for typically the Shiro Spring Start database password

 occitan create secret generic shiro-spring-boot-db-password --from-literal=password=my-password 

four. Create an OpenShift deployment for Shiro Spring Boot

 occitan new-app --name=shiro-spring-boot shiro-spring-boot: 1. 5. several \ -e SPRING_DATASOURCE_URL="jdbc: mysql: //mysql: 3306/shiro? user=shiro& password=$ secret/shiro-spring-boot-db-password/password " \ --env=VAULT_ADDR=https://vault.example.com \ --env=VAULT_TOKEN=my-vault-token \ --env=KUBERNETES_PORT=443 \ --env=SERVICE_ACCOUNT=/var/run/secrets/kubernetes. io/serviceaccount/token \ --env=VAULT_ROLE=shiro-spring-boot 

5. Access this Shiro Spring Boot application

 oc get route shiro-spring-boot 

Conclusion

Inside this article, we all have shown how to deploy Shiro Apache and Shiro Spring Boot programs to an OpenShift cluster, using HashiCorp Vault to handle secrets. This approach provides a safeguarded and scalable approach to deploy Shiro applications in a production environment.