Skip to content

Commit

Permalink
Merge pull request #315 from alwinsimon/main
Browse files Browse the repository at this point in the history
Updating with cert-manager configuration.
  • Loading branch information
alwinsimon authored Nov 2, 2023
2 parents fa2488c + ba52d01 commit d044939
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/CD - Deploy - Manifests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ jobs:
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- run: doctl kubernetes cluster kubeconfig save ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- run: kubectl apply -f infra/ingress-nginx/prod && kubectl apply -f infra/statefull && kubectl apply -f infra/stateless
- run: kubectl apply -f infra/statefull
- run: kubectl apply -f infra/stateless
- run: kubectl apply -f infra/ingress-nginx/prod
24 changes: 24 additions & 0 deletions .github/workflows/CD - Deploy - SSL config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ========================================= CD - Deploy - SSL Config =========================================

name: CD - Deploy - SSL Config

on:
push:
branches:
- production
paths:
- "infra/ingress-nginx/**"
- "infra/ssl/**"

jobs:
Deploy-Manifests-CD-Pipeline:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- run: doctl kubernetes cluster kubeconfig save ${{ secrets.DIGITALOCEAN_CLUSTER_ID }}
- run: kubectl apply -f infra/ssl
- run: kubectl apply -f infra/ingress-nginx/prod
7 changes: 7 additions & 0 deletions infra/ingress-nginx/prod/prod-ingress-srv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ metadata:
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/use-regex: "true"
cert-manager.io/cluster-issuer: letsencrypt-ssl-cert-issuer-prod
spec:
tls:
- hosts:
- bms.alwinsimon.com
- www.bms.alwinsimon.com
# Below secretName will be automatically configured in cluster- no manual config required
secretName: ssl-cert-key
rules:
- host: bms.alwinsimon.com
http:
Expand Down
30 changes: 30 additions & 0 deletions infra/ssl/cert-manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-ssl-cert-issuer-prod
namespace: cert-manager
spec:
acme:
# The ACME server URL
server: https://acme-v02.api.letsencrypt.org/directory
# Email address used for ACME registration
email: [email protected]
# Name of a secret used to store the ACME account private key
# privateKeySecretRef will be automatically configured in cluster- no manual config required
privateKeySecretRef:
name: letsencrypt-ssl-cert-key
# Enable the HTTP-01 challenge provider
solvers:
- http01:
ingress:
class: nginx


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Instructions:
# Reference for configuration: https://cert-manager.io/docs/installation/kubectl/
# Apply following command in cluster to configure cert-manager:
# - kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.2/cert-manager.yaml
# Check status of cert-manager pods by running the following command
# - kubectl get pods --namespace cert-manager
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

0 comments on commit d044939

Please sign in to comment.