Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

81 lines (75 sloc) 1.63 KB
#? stdtmpl(subsChar = '$', metaChar = '#')
# proc genDeploymentWithIngress(name, domain, dockerImage: string, containerPort, replicas: int, useProdLE: bool, envvars: seq[Envvar] = @[]): string =
# result = ""
apiVersion: v1
kind: Service
metadata:
name: $name
annotations:
external-dns.alpha.kubernetes.io/hostname: $domain
external-dns.alpha.kubernetes.io/ttl: "120" #optional
external-dns.alpha.kubernetes.io/cloudflare-proxied: "false"
spec:
type: ClusterIP
ports:
- port: 80
targetPort: $containerPort
selector:
app: $name
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: $name
spec:
replicas: $replicas
selector:
matchLabels:
app: $name
template:
metadata:
labels:
app: $name
spec:
containers:
- name: $name-web
image: $dockerImage
# if envvars.len != 0:
env:
# for val in envvars:
- name: $val.name
value: "$val.value"
# end for
# end if
ports:
- containerPort: $containerPort
imagePullSecrets:
- name: regcred
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: $name
annotations:
kubernetes.io/ingress.class: nginx
# if useProdLe:
certmanager.k8s.io/cluster-issuer: "letsencrypt-prod"
# else:
certmanager.k8s.io/cluster-issuer: "letsencrypt-staging"
# end if
spec:
tls:
- hosts:
- $domain
# if useProdLe:
secretName: prod-certs-$name
# else:
secretName: staging-certs-$name
# end if
rules:
- host: $domain
http:
paths:
- backend:
serviceName: $name
servicePort: 80
You can’t perform that action at this time.