Skip to content

Commit

Permalink
Added new
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiyerra committed Dec 16, 2022
1 parent b6c7415 commit a54cce3
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 19 deletions.
36 changes: 28 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ envRaw: # Additional environment variables added.
fieldRef:
fieldPath: status.hostIP
externals:
- name: sitemap
type: ExternalName
cname: "some-sitemap.s3.amazon.com"
ingress:
hosts:
- host: somesitemap.shopcanal.com
paths: ["/"]
port: 8000
- name: elasticache
type: ExternalName
cname: "elasticache.redis.amazon.com"
apps:
- name: sitemap
service:
Expand All @@ -78,18 +91,23 @@ apps:
- name: http
port: 3000
protocol: TCP
hosts:
- host: yieldpayroll.com
paths: ["/"]
- name: com
port: 4000
protocol: TCP
ingress:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
hosts:
- host: yieldpayroll.com
paths: ["/"]
port: 3000
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
ingressAnnotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
autoscaling:
enabled: true
minReplicas: 2
Expand Down Expand Up @@ -125,9 +143,11 @@ apps:
port: 3000
protocol: TCP
command: ["bundle", "exec", "rails", "server"]
hosts:
- host: yieldpayroll.com
paths: ["/"]
ingress:
hosts:
- host: yieldpayroll.com
paths: ["/"]
port: 3000
healthChecks:
lifecycle:
preStop:
Expand Down
2 changes: 1 addition & 1 deletion charts/tiphys/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: tiphys
description: A High Level Helm Chart
type: application
version: 0.8.0
version: 0.9.0
appVersion: 1.16.0

dependencies:
Expand Down
22 changes: 12 additions & 10 deletions charts/tiphys/templates/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ kind: Service
metadata:
name: {{ include "opszero.fullname" $ }}-{{ $app.name }}
labels:
{{- include "opszero.selectorLabels" $ | nindent 4 }}-{{ $app.name }}
{{- include "opszero.labels" $ | nindent 4 }}-{{ $app.name }}
spec:
type: {{ $app.service.type }}
selector:
Expand All @@ -61,7 +61,6 @@ spec:
{{- end }}
{{- end }}

{{- if ne $app.service.type "ExternalName" }}
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -134,7 +133,6 @@ spec:
{{- with $app.service.healthChecks }}
{{ toYaml . | nindent 10 }}
{{- end }}
{{- end }}

{{- if $app.secrets }}
---
Expand Down Expand Up @@ -182,7 +180,7 @@ spec:
{{- end }}
{{- end }}

{{- with $app.service.hosts }}
{{- if and $app.service.ingress $app.service.ingress.hosts}}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand All @@ -200,13 +198,17 @@ metadata:
{{- with $.Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $app.service.ingressAnnotations }}
{{ if $app.service.ingress }}
{{- with $app.service.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
spec:
ingressClassName: nginx
rules:
{{- range $app.service.hosts }}
{{- with $app.service.ingress }}
{{- with $app.service.ingress.hosts }}
{{- range $host := . }}
- host: {{ .host | quote }}
http:
paths:
Expand All @@ -216,15 +218,15 @@ spec:
backend:
service:
name: {{ include "opszero.fullname" $ }}-{{ $app.name }}
{{- if ne $app.service.type "ExternalName" }}
port:
number: {{ $app.service.port }}
{{- end }}
number: {{ $host.port }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
tls:
- hosts:
{{- range $app.service.hosts }}
{{- range $app.service.ingress.hosts }}
- {{ .host }}
{{- end }}
secretName: {{ include "opszero.fullname" $ }}-{{ $app.name }}-tls
Expand Down
60 changes: 60 additions & 0 deletions charts/tiphys/templates/externals.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{{- range $app := .Values.externals }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "opszero.fullname" $ }}-{{ $app.name }}
labels:
{{- include "opszero.labels" $ | nindent 4 }}-{{ $app.name }}
spec:
type: ExternalName
selector:
{{- include "opszero.selectorLabels" $ | nindent 4 }}-{{ $app.name }}
externalName: {{ $app.cname }}

{{- if $app.ingress }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "opszero.fullname" $ }}-{{ $app.name }}
labels:
{{- include "opszero.labels" $ | nindent 4 }}
annotations:
cert-manager.io/cluster-issuer: letsencrypt
nginx.ingress.kubernetes.io/proxy-connect-timeout: "120"
nginx.ingress.kubernetes.io/proxy-send-timeout: "120"
nginx.ingress.kubernetes.io/proxy-read-timeout: "120"
nginx.ingress.kubernetes.io/proxy-next-upstream-timeout: "120"
nginx.ingress.kubernetes.io/proxy-body-size: "128m"
{{- with $.Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $app.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: nginx
rules:
{{- with $app.ingress.hosts }}
{{- range $host := . }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . | quote }}
pathType: Prefix
backend:
service:
name: {{ include "opszero.fullname" $ }}-{{ $app.name }}
{{- end }}
{{- end }}
{{- end }}
tls:
- hosts:
{{- range $app.ingress.hosts }}
- {{ .host }}
{{- end }}
secretName: {{ include "opszero.fullname" $ }}-{{ $app.name }}-tls
{{- end -}}
{{- end }}
3 changes: 3 additions & 0 deletions charts/tiphys/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ redis:
enabled: false
auth:
enabled: false

apps: {}
externals: {}

0 comments on commit a54cce3

Please sign in to comment.