Skip to content

Commit

Permalink
Update deploy.j2
Browse files Browse the repository at this point in the history
  • Loading branch information
saiyam1814 authored Aug 19, 2024
1 parent 051257b commit 60fce6c
Showing 1 changed file with 46 additions and 61 deletions.
107 changes: 46 additions & 61 deletions tmpl/deploy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
labels:
app: my-app
spec:
replicas: 1
replicas: 3
selector:
matchLabels:
app: my-app
Expand Down Expand Up @@ -59,76 +61,59 @@ apiVersion: v1
kind: Service
metadata:
name: my-app-service
labels:
app: my-app
spec:
selector:
app: my-app
ports:
- protocol: TCP
port: 80
targetPort: 8080
targetPort: 8080
type: ClusterIP
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: production-app
name: app-gateway
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
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:
name: app
# Enable the HTTP-01 challenge provider
solvers:
- http01:
ingress:
class: nginx
gatewayClassName: nginx
listeners:
- name: http
port: 80
protocol: HTTP
hostname: "*.kubesimplify.com"
- name: https
hostname: "*.kubesimplify.com"
port: 443
protocol: HTTPS
allowedRoutes:
namespaces:
from: All
tls:
mode: Terminate
certificateRefs:
- name: app-kubesimplify-com-tls
kind: Secret
group: core
---
apiVersion: cert-manager.io/v1
kind: Certificate
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: app
name: go-app-route
spec:
secretName: app
issuerRef:
name: production-app
kind: ClusterIssuer
commonName: demo.kubesimplify.com
dnsNames:
- demo.kubesimplify.com
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
annotations:
cert-manager.io/cluster-issuer: production-app

spec:
ingressClassName: nginx
parentRefs:
- name: app-gateway
namespace: default
hostnames:
- "app.kubesimplify.com"
rules:
- host: demo.kubesimplify.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-app-service
port:
number: 80
tls:
- hosts:
- demo.kubesimplify.com
secretName: app
---
apiVersion: v1
kind: Secret
metadata:
name: postgresql-credentials
type: Opaque
data:
password: bmV3X3Bhc3N3b3Jk
username: Z29hbHNfdXNlcg==
- matches:
- path:
type: Exact
value: /
backendRefs:
- name: my-app-service
port: 80

0 comments on commit 60fce6c

Please sign in to comment.