feat(dummyhttp): first version of the application
All checks were successful
multi-semantic-release / multi-semantic-release (push) Successful in 13s
All checks were successful
multi-semantic-release / multi-semantic-release (push) Successful in 13s
This commit is contained in:
parent
4ebd3d8601
commit
979ecd44dc
6 changed files with 88 additions and 0 deletions
15
dummyhttp/README.md
Normal file
15
dummyhttp/README.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Dummyhttp kustomize application
|
||||||
|
|
||||||
|
This application deploys a container that runs an instance of the [dummyhttp](https://github.com/svenstaro/dummyhttp)
|
||||||
|
application that returns a string that uses environment variables added to the container from a `ConfigMap` and a
|
||||||
|
`Secret`.
|
||||||
|
|
||||||
|
The container image is built from a generic
|
||||||
|
[Dockerfile](https://forgejo.mixinet.net/oci/images/src/tag/dummyhttp-v1.0.0/dummyhttp/Dockerfile) that runs the
|
||||||
|
application directly, but we have modified the arguments on the `Deployment` to be able to use environment variables on
|
||||||
|
the arguments to the server (we use `/bin/sh -c` as entrypoint and the command uses `eval` to expand the environment
|
||||||
|
variables when calling the application).
|
||||||
|
|
||||||
|
The base application includes a `Deployment`, a `Service` and an `Ingress` definition; the `Deployment` uses environment
|
||||||
|
variables from a `ConfigMap` and a `Secret` if they are available, but we've marked them as optional to be able to
|
||||||
|
deploy the application without having them available.
|
36
dummyhttp/deployment.yaml
Normal file
36
dummyhttp/deployment.yaml
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: dummyhttp
|
||||||
|
labels:
|
||||||
|
app: dummyhttp
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: dummyhttp
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: dummyhttp
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: dummyhttp
|
||||||
|
image: forgejo.mixinet.net/oci/dummyhttp:1.0.0
|
||||||
|
command: [ "/bin/sh", "-c" ]
|
||||||
|
args:
|
||||||
|
- 'eval dummyhttp -b \"{\\\"c\\\": \\\"$CM_VAR\\\", \\\"s\\\": \\\"$SECRET_VAR\\\"}\"'
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
env:
|
||||||
|
- name: CM_VAR
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: dummyhttp-configmap
|
||||||
|
key: CM_VAR
|
||||||
|
optional: true
|
||||||
|
- name: SECRET_VAR
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: dummyhttp-secret
|
||||||
|
key: SECRET_VAR
|
||||||
|
optional: true
|
18
dummyhttp/ingress.yaml
Normal file
18
dummyhttp/ingress.yaml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: dummyhttp
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: dummyhttp.localhost.mixinet.net
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: dummyhttp
|
||||||
|
port:
|
||||||
|
number: 80
|
7
dummyhttp/kustomization.yaml
Normal file
7
dummyhttp/kustomization.yaml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
- service.yaml
|
||||||
|
- ingress.yaml
|
1
dummyhttp/msr.yaml
Normal file
1
dummyhttp/msr.yaml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
version: 1.0.0
|
11
dummyhttp/service.yaml
Normal file
11
dummyhttp/service.yaml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: dummyhttp
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: dummyhttp
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
targetPort: 8080
|
Loading…
Add table
Add a link
Reference in a new issue