Skip to content

Commit

Permalink
Add secrets in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyshah83 committed May 18, 2023
1 parent bac93e3 commit afbf2aa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/aks-redis-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ jobs:
resource-group: ${{ env.AZURE_RESOURCE_GROUP }}
cluster-name: ${{ env.AKS_CLUSTER_NAME }}

- name: Set Generic Redis Secret
uses: azure/k8s-create-secret@v1
id: redis-secret
with:
namespace: default
secret-type: generic
secret-name: redis-secret
data: |
${{ secrets.REDIS_HOST }}
${{ secrets.REDIS_PASSWORD }}
- name: Setup kubectl
id: install-kubectl
uses: azure/setup-kubectl@v3
Expand Down
10 changes: 8 additions & 2 deletions k8s-public-ip/redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ spec:
- name: SPRING_PROFILES_ACTIVE
value: cloud
- name: SPRING_DATA_REDIS_HOST
value: gh-demo.redis.cache.windows.net
valueFrom:
secretKeyRef:
name: redis-secret
key: HOST
- name: SPRING_DATA_REDIS_PASSWORD
value: 1FbqqWzvBfcSDfarIbrBHFswlSwcPg49jAzCaDWEP1w=
valueFrom:
secretKeyRef:
name: redis-secret
key: PASSWORD
ports:
- containerPort: 8761
---
Expand Down
11 changes: 8 additions & 3 deletions spring-data-reactive-redis/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ This project is a sample application that shows how to use Spring Data Redis to

### Prerequisites

* JDK 8 or later
* Gradle 4+ or Maven 3.2+
* JDK 17 or later
* Gradle 6+ or later
* Redis 6.0.0 or later
* Docker

### Running the application
### KeyVault
1. App needs to have the correct access policy to access the KeyVault
https://learn.microsoft.com/en-us/azure/key-vault/general/assign-access-policy?tabs=azure-portal

### Terraform

Expand Down Expand Up @@ -58,3 +60,6 @@ This project is a sample application that shows how to use Spring Data Redis to

- Resource Group
- Redis Cache
- ACR
- AKS
- Provide AKS access to pull images from ACR

0 comments on commit afbf2aa

Please sign in to comment.