fix: update configuration files to use YAML format and adjust references in deployment
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@
|
||||
certs/*
|
||||
helloapp
|
||||
.*-config.json
|
||||
.*-config.yaml
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"server": {
|
||||
"port": 8800
|
||||
},
|
||||
"certs": {
|
||||
"testKeyPath": "./certs/test.key"
|
||||
}
|
||||
}
|
||||
4
.linux-config-template.yaml
Normal file
4
.linux-config-template.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
server:
|
||||
port: 8800
|
||||
certs:
|
||||
testKeyPath: ./certs/test.key # 需要和 deployment.yaml 中的路径保持一致, 并且 certs 目录需要挂载 secret
|
||||
1
.vscode/launch.json
vendored
1
.vscode/launch.json
vendored
@@ -11,7 +11,6 @@
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${workspaceFolder}",
|
||||
"args": ["-f", ".linux-config.json"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -43,9 +43,9 @@ spec:
|
||||
- name: config-volume
|
||||
mountPath: /config
|
||||
- name: helloapp-test-key
|
||||
mountPath: /certs
|
||||
mountPath: /certs/test.key
|
||||
command: ["/helloapp"]
|
||||
args: ["-f", "/config/.linux-config.json"]
|
||||
args: ["-f", "/config/.linux-config.yaml"]
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
@@ -60,12 +60,8 @@ metadata:
|
||||
name: k8s-example-config
|
||||
namespace: helloapp
|
||||
data:
|
||||
.linux-config.json: |
|
||||
{
|
||||
"server": {
|
||||
"port": 8800
|
||||
},
|
||||
"certs": {
|
||||
"testKeyPath": "./certs/test.key"
|
||||
}
|
||||
}
|
||||
.linux-config.yaml: |
|
||||
server:
|
||||
port: 8800
|
||||
certs:
|
||||
testKeyPath: /certs/test.key
|
||||
Reference in New Issue
Block a user