feat: add templates
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
94244cf937
commit
a4092639d1
20
templates/deployment.yaml
Normal file
20
templates/deployment.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: "{{ service }}"
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: "{{ service }}"
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: "{{ service }}"
|
||||||
|
image: "deployment:latest"
|
||||||
|
ports:
|
||||||
|
- containerPort: 3000
|
||||||
|
name: external_http
|
||||||
|
- containerPort: 3001
|
||||||
|
name: internal_http
|
||||||
|
- containerPort: 3002
|
||||||
|
name: internal_grpc
|
20
templates/kustomize/base/deployment.yaml
Normal file
20
templates/kustomize/base/deployment.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: "{{ service }}"
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: "{{ service }}"
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: "{{ service }}"
|
||||||
|
image: "deployment:latest"
|
||||||
|
ports:
|
||||||
|
- containerPort: 3000
|
||||||
|
name: external_http
|
||||||
|
- containerPort: 3001
|
||||||
|
name: internal_http
|
||||||
|
- containerPort: 3002
|
||||||
|
name: internal_grpc
|
24
templates/kustomize/base/kustomization.yaml
Normal file
24
templates/kustomize/base/kustomization.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
{% set_global cluster_vars = filter_by_prefix(prefix=["clusters", cluster]) %}
|
||||||
|
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
||||||
|
|
||||||
|
commonLabels:
|
||||||
|
app: "{{ service }}"
|
||||||
|
cluster: "{{ cluster }}"
|
||||||
|
|
||||||
|
namespace: "{{ cluster_vars.namespace }}"
|
||||||
|
|
||||||
|
replicas:
|
||||||
|
- name: "{{ service }}"
|
||||||
|
count: {{ cluster_vars.replicas }}
|
||||||
|
|
||||||
|
images:
|
||||||
|
- name: "deployment"
|
||||||
|
newName: "{{ service }}"
|
||||||
|
newTag: "{{ image_tag }}"
|
17
templates/kustomize/base/service.yaml
Normal file
17
templates/kustomize/base/service.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: "{{ service }}"
|
||||||
|
spec:
|
||||||
|
type: LoadBalancer
|
||||||
|
ports:
|
||||||
|
- name: external_http
|
||||||
|
port: 3000
|
||||||
|
targetPort: 3000
|
||||||
|
- name: internal_http
|
||||||
|
port: 3001
|
||||||
|
targetPort: 3001
|
||||||
|
- name: internal_grpc
|
||||||
|
port: 3002
|
||||||
|
targetPort: 3002
|
||||||
|
|
Loading…
Reference in New Issue
Block a user