-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from europeana/EA-3252_k8s
EA-3252: Setup kustomize for k8s deployment
- Loading branch information
Showing
21 changed files
with
125 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ | |
*.iml | ||
|
||
# Kubernetes config properties | ||
*.properties.yaml | ||
*.properties.yaml | ||
*.user.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
# NB: ensure the version matches that in buildpack.yml | ||
FROM nginx:mainline | ||
FROM nginx:1.23 | ||
|
||
LABEL Author="Europeana Foundation <development@europeana.eu>" | ||
|
||
# TODO: add a self-signed SSL certificate | ||
|
||
COPY docker/env-nginx docker/rewrite-nginx-conf /usr/sbin/ | ||
COPY env-nginx /usr/sbin/ | ||
|
||
COPY public /usr/share/nginx/html | ||
COPY mime.types /etc/nginx/ | ||
COPY nginx.conf.d/ /etc/nginx/nginx.conf.d/ | ||
|
||
COPY nginx.conf /etc/nginx/nginx.template.conf | ||
|
||
RUN rewrite-nginx-conf | ||
COPY nginx.conf.template /etc/nginx/nginx.conf.template | ||
|
||
ENTRYPOINT ["env-nginx"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
resources: | ||
- deployment.yaml | ||
|
||
# expects file to be in the same directory | ||
configMapGenerator: | ||
- name: api-gateway-config | ||
envs: | ||
- .env |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
k8s/overlays/cloud/deployment_patch.properties.yaml.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: api-gateway-deployment | ||
spec: | ||
replicas: ${MIN_REPLICAS} | ||
template: | ||
spec: | ||
containers: | ||
- name: api-gateway | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "${MEMORY_REQUEST}M" | ||
cpu: "${CPU_REQUEST}m" | ||
limits: | ||
memory: "${MEMORY_LIMIT}M" | ||
cpu: "${CPU_LIMIT}m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: api-gateway-hpa | ||
spec: | ||
maxReplicas: ${MAX_REPLICAS} | ||
minReplicas: ${MIN_REPLICAS} | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: api-gateway-deployment | ||
behavior: | ||
scaleDown: | ||
stabilizationWindowSeconds: 900 | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: 70 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# name suffix and commonLabels to be provided imperatively during deployment | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../../base | ||
- service.yaml | ||
- ingress.properties.yaml | ||
- hpa.properties.yaml | ||
|
||
patchesStrategicMerge: | ||
- deployment_patch.properties.yaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: api-gateway-service | ||
spec: | ||
# selector provided via Kustomize | ||
ports: | ||
- name: http | ||
port: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: api-gateway-deployment | ||
spec: | ||
replicas: 1 | ||
template: | ||
spec: | ||
containers: | ||
- name: api-gateway | ||
# required to use local image | ||
imagePullPolicy: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../../base | ||
- nodeport.yaml | ||
|
||
patchesStrategicMerge: | ||
- deployment_patch.yaml | ||
|
||
commonLabels: | ||
app: api-gateway-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters