deployment.yaml:
x
apiVersion apps/v1
kind Deployment
metadata
name test-deploy
namespace default
spec
replicas1
selector
matchLabels
app test-deploy
template
metadata
labels
app test-deploy
spec
nodeName k8s-102
containers
name golang-container
image golang 1.21.3-alpine3.18
command "sleep" "infinity"
volumeMounts
name config-volume
mountPath /etc/config
name secret-volume
mountPath /etc/password
volumes
name config-volume
configMap
name test-configmap
name secret-volume
secret
secretName test-secret
configmap.yaml:
xxxxxxxxxx
---
apiVersion v1
data
config.yaml
mode: product
port: 80
kind ConfigMap
metadata
name test-configmap
namespace default
---
apiVersion v1
data
redis.json eyJyZWRpc19wYXNzd29yZCI6ICJyZHNwd2QifQ==
kind Secret
metadata
name test-secret
namespace default
type Opaque