72 lines
1.5 KiB
YAML
72 lines
1.5 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: k8s-example
|
|
namespace: helloapp
|
|
spec:
|
|
selector:
|
|
app: k8s-example
|
|
ports:
|
|
- port: 8800
|
|
targetPort: 8800
|
|
type: LoadBalancer
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: k8s-example
|
|
namespace: helloapp
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: k8s-example
|
|
replicas: 3
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: k8s-example
|
|
spec:
|
|
containers:
|
|
- name: k8s-example
|
|
image: localhost:8180/k8s-example/k8s-example:latest
|
|
imagePullPolicy: IfNotPresent
|
|
resources:
|
|
requests:
|
|
memory: "128Mi"
|
|
cpu: "500m"
|
|
limits:
|
|
memory: "128Mi"
|
|
cpu: "500m"
|
|
ports:
|
|
- containerPort: 8800
|
|
volumeMounts:
|
|
- name: config-volume
|
|
mountPath: /config
|
|
- name: helloapp-test-key
|
|
mountPath: /certs
|
|
command: ["/helloapp"]
|
|
args: ["-f", "/config/.linux-config.json"]
|
|
volumes:
|
|
- name: config-volume
|
|
configMap:
|
|
name: k8s-example-config
|
|
- name: helloapp-test-key
|
|
secret:
|
|
secretName: helloapp-test-key
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: k8s-example-config
|
|
namespace: helloapp
|
|
data:
|
|
.linux-config.json: |
|
|
{
|
|
"server": {
|
|
"port": 8800
|
|
},
|
|
"certs": {
|
|
"testKeyPath": "./certs/test.key"
|
|
}
|
|
}
|