Skip to content

Commit

Permalink
Dev (#15)
Browse files Browse the repository at this point in the history
* update namespace

* update namespace only when unset

* update prod

* update README

* use cluster ip for service

* remove service pathc

* add ingress

* update ingress

* update container port

* update ingress

* update ingress

* add tls

* fix typo
  • Loading branch information
ezynda3 authored May 18, 2024
1 parent 6bea4b1 commit f521334
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 27 deletions.
15 changes: 15 additions & 0 deletions .k8s/base/cert-manager-issuer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-louper
spec:
acme:
email: ezynda@mark3labs.com
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-louper-private-key
solvers:
# Use the HTTP-01 challenge provider
- http01:
ingress:
class: nginx
3 changes: 3 additions & 0 deletions .k8s/base/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ spec:
containers:
- name: louper-container
image: mark3labs/louper-web:latest
ports:
- name: http
containerPort: 3000
volumeMounts:
- mountPath: '/app/data'
name: volume
Expand Down
23 changes: 23 additions & 0 deletions .k8s/base/ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: louper-ingress
annotations:
cert-manager.io/issuer: letsencrypt-louper
spec:
tls:
- hosts:
- louper.dev
secretName: letsencrypt-louper
rules:
- host: louper.dev
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: louper-service
port:
number: 3000
ingressClassName: nginx
2 changes: 2 additions & 0 deletions .k8s/base/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ kind: Kustomization
resources:
- deployment.yml
- service.yml
- ingress.yml
- cert-manager-issuer.yml
6 changes: 3 additions & 3 deletions .k8s/base/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ kind: Service
metadata:
name: louper-service
spec:
type: NodePort
type: ClusterIP
ports:
- port: 3000
- name: http
port: 80
targetPort: 3000
nodePort: 31942
protocol: TCP
selector:
app: louper
2 changes: 2 additions & 0 deletions .k8s/staging/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ spec:
automated:
prune: true
selfHeal: true
syncOptions:
- ApplyOutOfSyncOnly=true
35 changes: 35 additions & 0 deletions .k8s/staging/ingress-patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# apiVersion: networking.k8s.io/v1
# kind: Ingress
# metadata:
# name: louper-ingress
# annotations:
# cert-manager.io/issuer: letsencrypt-louper
# spec:
# tls:
# - hosts:
# - louper.dev
# secretName: letsencrypt-louper
# rules:
# - host: louper.dev
# http:
# paths:
# - path: /
# pathType: Prefix
# backend:
# service:
# name: louper-service
# port:
# number: 3000
# ingressClassName: nginx
- op: replace
path: /spec/rules/0/host
value: staging.louper.dev
- op: replace
path: /spec/rules/0/http/paths/0/backend/service/name
value: louper-service-staging
- op: replace
path: '/metadata/annotations/cert-manager.io~1issuer'
value: letsencrypt-louper-staging
- op: replace
path: /spec/tls/0/hosts/0
value: staging.louper.dev
6 changes: 3 additions & 3 deletions .k8s/staging/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ patches:
name: louper-deployment
path: deployment-patch.yml
- target:
kind: Service
name: louper-service
path: service-patch.yml
kind: Ingress
name: louper-ingress
path: ingress-patch.yml
transformers:
- |-
apiVersion: builtin
Expand Down
17 changes: 0 additions & 17 deletions .k8s/staging/service-patch.yml

This file was deleted.

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ Contributions are what make the open source community such an amazing place to b
### Creating A Pull Request

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
2. Check out the `dev` branch (`git checkout dev`)
3. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
4. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
5. Push to the Branch (`git push origin feature/AmazingFeature`)
6. Open a Pull Request

## License

Expand Down

0 comments on commit f521334

Please # to comment.