Files
go-example/deployment.yaml
2026-01-11 19:49:33 +08:00

67 lines
1.4 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:0b2c48ee261873d5a5b2146f424e2a68ce33d4da
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.yaml"]
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.yaml: |
server:
port: 8800
certs:
testKeyPath: /certs/test.key