forked from LaconicNetwork/kompose
Support config short syntax and fix old bugs (#1230)
This commit is contained in:
parent
fe4301192a
commit
05e9bf4fc8
@ -23,7 +23,7 @@ __Glossary:__
|
|||||||
| cap_add, cap_drop | ✓ | ✓ | ✓ | Pod.Spec.Container.SecurityContext.Capabilities.Add/Drop | |
|
| cap_add, cap_drop | ✓ | ✓ | ✓ | Pod.Spec.Container.SecurityContext.Capabilities.Add/Drop | |
|
||||||
| command | ✓ | ✓ | ✓ | Pod.Spec.Container.Command | |
|
| command | ✓ | ✓ | ✓ | Pod.Spec.Container.Command | |
|
||||||
| configs | n | n | ✓ | | |
|
| configs | n | n | ✓ | | |
|
||||||
| configs: short-syntax | n | n | n | | Only create configMap |
|
| configs: short-syntax | n | n | ✓ | | Only create configMap |
|
||||||
| configs: long-syntax | n | n | ✓ | | If target path is /, ignore this and only create configMap |
|
| configs: long-syntax | n | n | ✓ | | If target path is /, ignore this and only create configMap |
|
||||||
| cgroup_parent | x | x | x | | Not supported within Kubernetes. See issue https://github.com/kubernetes/kubernetes/issues/11986 |
|
| cgroup_parent | x | x | x | | Not supported within Kubernetes. See issue https://github.com/kubernetes/kubernetes/issues/11986 |
|
||||||
| container_name | ✓ | ✓ | ✓ | Metadata.Name + Deployment.Spec.Containers.Name | |
|
| container_name | ✓ | ✓ | ✓ | Metadata.Name + Deployment.Spec.Containers.Name | |
|
||||||
|
|||||||
@ -19,7 +19,9 @@ package kobject
|
|||||||
import (
|
import (
|
||||||
dockerCliTypes "github.com/docker/cli/cli/compose/types"
|
dockerCliTypes "github.com/docker/cli/cli/compose/types"
|
||||||
"github.com/docker/libcompose/yaml"
|
"github.com/docker/libcompose/yaml"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
// KomposeObject holds the generic struct of Kompose transformation
|
// KomposeObject holds the generic struct of Kompose transformation
|
||||||
@ -164,3 +166,23 @@ type Volumes struct {
|
|||||||
PVCSize string // PVC size
|
PVCSize string // PVC size
|
||||||
SelectorValue string // Value of the label selector
|
SelectorValue string // Value of the label selector
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetConfigMapKeyFromMeta...
|
||||||
|
// given a source name ,find the file and extract the filename which will be act as ConfigMap key
|
||||||
|
// return "" if not found
|
||||||
|
func (s *ServiceConfig) GetConfigMapKeyFromMeta(name string) (string, error) {
|
||||||
|
if s.ConfigsMetaData == nil {
|
||||||
|
return "", errors.Errorf("config %s not found", name)
|
||||||
|
}
|
||||||
|
if _, ok := s.ConfigsMetaData[name]; !ok {
|
||||||
|
return "", errors.Errorf("config %s not found", name)
|
||||||
|
}
|
||||||
|
|
||||||
|
config := s.ConfigsMetaData[name]
|
||||||
|
if config.External.External {
|
||||||
|
return "", errors.Errorf("config %s is external", name)
|
||||||
|
}
|
||||||
|
|
||||||
|
return filepath.Base(config.File), nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@ -798,18 +798,12 @@ func checkUnsupportedKeyForV3(composeObject *types.Config) []string {
|
|||||||
var keysFound []string
|
var keysFound []string
|
||||||
|
|
||||||
for _, service := range composeObject.Services {
|
for _, service := range composeObject.Services {
|
||||||
//For short syntax, volume mount path must be /, but this will cause pod create fail in kubernetes
|
|
||||||
//So we ignore this attribute
|
|
||||||
for _, tmpConfig := range service.Configs {
|
for _, tmpConfig := range service.Configs {
|
||||||
if tmpConfig.Mode == nil {
|
if tmpConfig.GID != "" {
|
||||||
keysFound = append(keysFound, "short syntax config")
|
keysFound = append(keysFound, "long syntax config gid")
|
||||||
} else {
|
}
|
||||||
if tmpConfig.GID != "" {
|
if tmpConfig.UID != "" {
|
||||||
keysFound = append(keysFound, "long syntax config gid")
|
keysFound = append(keysFound, "long syntax config uid")
|
||||||
}
|
|
||||||
if tmpConfig.UID != "" {
|
|
||||||
keysFound = append(keysFound, "long syntax config uid")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -155,32 +155,48 @@ func (k *Kubernetes) InitPodSpecWithConfigMap(name string, image string, service
|
|||||||
var volumeMounts []api.VolumeMount
|
var volumeMounts []api.VolumeMount
|
||||||
var volumes []api.Volume
|
var volumes []api.Volume
|
||||||
|
|
||||||
if len(service.Configs) > 0 && service.Configs[0].Mode != nil {
|
log.Debugf("fuck config: %+v", service.Configs)
|
||||||
//This is for LONG SYNTAX
|
|
||||||
for _, value := range service.Configs {
|
|
||||||
if value.Target == "/" {
|
|
||||||
log.Warnf("Long syntax config, target path can not be /")
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
tmpKey := FormatFileName(value.Source)
|
|
||||||
volumeMounts = append(volumeMounts,
|
|
||||||
api.VolumeMount{
|
|
||||||
Name: tmpKey,
|
|
||||||
MountPath: "/" + FormatFileName(value.Target),
|
|
||||||
})
|
|
||||||
|
|
||||||
tmpVolume := api.Volume{
|
for _, value := range service.Configs {
|
||||||
Name: tmpKey,
|
cmVolName := FormatFileName(value.Source)
|
||||||
}
|
target := value.Target
|
||||||
tmpVolume.ConfigMap = &api.ConfigMapVolumeSource{}
|
if target == "" {
|
||||||
tmpVolume.ConfigMap.Name = tmpKey
|
// short syntax, = /<source>
|
||||||
var tmpMode int32
|
target = "/" + value.Source
|
||||||
tmpMode = int32(*value.Mode)
|
|
||||||
tmpVolume.ConfigMap.DefaultMode = &tmpMode
|
|
||||||
volumes = append(volumes, tmpVolume)
|
|
||||||
}
|
}
|
||||||
} else {
|
subPath := filepath.Base(target)
|
||||||
//This is for SHORT SYNTAX, unsupported
|
|
||||||
|
volSource := api.ConfigMapVolumeSource{}
|
||||||
|
volSource.Name = cmVolName
|
||||||
|
key, err := service.GetConfigMapKeyFromMeta(value.Source)
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("cannot parse config %s , %s", value.Source, err.Error())
|
||||||
|
// mostly it's external
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
volSource.Items = []api.KeyToPath{{
|
||||||
|
Key: key,
|
||||||
|
Path: subPath,
|
||||||
|
}}
|
||||||
|
|
||||||
|
if value.Mode != nil {
|
||||||
|
tmpMode := int32(*value.Mode)
|
||||||
|
volSource.DefaultMode = &tmpMode
|
||||||
|
}
|
||||||
|
|
||||||
|
cmVol := api.Volume{
|
||||||
|
Name: cmVolName,
|
||||||
|
VolumeSource: api.VolumeSource{ConfigMap: &volSource},
|
||||||
|
}
|
||||||
|
|
||||||
|
volumeMounts = append(volumeMounts,
|
||||||
|
api.VolumeMount{
|
||||||
|
Name: cmVolName,
|
||||||
|
MountPath: target,
|
||||||
|
SubPath: subPath,
|
||||||
|
})
|
||||||
|
volumes = append(volumes, cmVol)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pod := api.PodSpec{
|
pod := api.PodSpec{
|
||||||
@ -337,11 +353,8 @@ func (k *Kubernetes) InitConfigMapFromFile(name string, service kobject.ServiceC
|
|||||||
log.Fatalf("Unable to retrieve file: %s", err)
|
log.Fatalf("Unable to retrieve file: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
originFileName := FormatFileName(fileName)
|
|
||||||
|
|
||||||
dataMap := make(map[string]string)
|
dataMap := make(map[string]string)
|
||||||
|
dataMap[filepath.Base(fileName)] = content
|
||||||
dataMap[originFileName] = content
|
|
||||||
|
|
||||||
configMapName := ""
|
configMapName := ""
|
||||||
for key, tmpConfig := range service.ConfigsMetaData {
|
for key, tmpConfig := range service.ConfigsMetaData {
|
||||||
|
|||||||
@ -882,7 +882,7 @@ convert::expect_success "$cmd" "/tmp/output-os.json"
|
|||||||
|
|
||||||
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-short.yaml"
|
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-short.yaml"
|
||||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-k8s-config-short.json > /tmp/output-k8s.json
|
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-k8s-config-short.json > /tmp/output-k8s.json
|
||||||
convert::expect_success_and_warning "$cmd" "/tmp/output-k8s.json"
|
convert::expect_success "$cmd" "/tmp/output-k8s.json"
|
||||||
|
|
||||||
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-short-warning.yaml"
|
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-short-warning.yaml"
|
||||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-k8s-config-short-warning.json > /tmp/output-k8s.json
|
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-k8s-config-short-warning.json > /tmp/output-k8s.json
|
||||||
@ -917,7 +917,7 @@ convert::expect_success_and_warning "$cmd" "/tmp/output-os.json"
|
|||||||
|
|
||||||
cmd="kompose --provider openshift convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-short.yaml"
|
cmd="kompose --provider openshift convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-config-short.yaml"
|
||||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-os-config-short.json > /tmp/output-os.json
|
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-os-config-short.json > /tmp/output-os.json
|
||||||
convert::expect_success_and_warning "$cmd" "/tmp/output-os.json"
|
convert::expect_success "$cmd" "/tmp/output-os.json"
|
||||||
|
|
||||||
cmd="kompose --provider openshift convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-endpoint-mode-1.yaml"
|
cmd="kompose --provider openshift convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/compose-endpoint-mode-1.yaml"
|
||||||
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-os-mode-1.json > /tmp/output-os.json
|
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/compose-v3.3-test/output-os-mode-1.json > /tmp/output-os.json
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"my-config.txt": "aaaa"
|
"my_config.txt": "aaaa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -59,8 +59,9 @@
|
|||||||
"resources": {},
|
"resources": {},
|
||||||
"volumeMounts": [
|
"volumeMounts": [
|
||||||
{
|
{
|
||||||
"mountPath": "/redis-config",
|
"mountPath": "/redis_config",
|
||||||
"name": "my-config"
|
"name": "my-config",
|
||||||
|
"subPath": "redis_config"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -70,8 +71,14 @@
|
|||||||
"volumes": [
|
"volumes": [
|
||||||
{
|
{
|
||||||
"configMap": {
|
"configMap": {
|
||||||
"name": "my-config",
|
"defaultMode": 288,
|
||||||
"defaultMode": 288
|
"items": [
|
||||||
|
{
|
||||||
|
"key": "my_config.txt",
|
||||||
|
"path": "redis_config"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "my-config"
|
||||||
},
|
},
|
||||||
"name": "my-config"
|
"name": "my-config"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"my-config.txt": "aaaa"
|
"my_config.txt": "aaaa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -59,8 +59,9 @@
|
|||||||
"resources": {},
|
"resources": {},
|
||||||
"volumeMounts": [
|
"volumeMounts": [
|
||||||
{
|
{
|
||||||
"mountPath": "/redis-config",
|
"mountPath": "/redis_config",
|
||||||
"name": "my-config"
|
"name": "my-config",
|
||||||
|
"subPath": "redis_config"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -70,8 +71,14 @@
|
|||||||
"volumes": [
|
"volumes": [
|
||||||
{
|
{
|
||||||
"configMap": {
|
"configMap": {
|
||||||
"name": "my-config",
|
"defaultMode": 288,
|
||||||
"defaultMode": 288
|
"items": [
|
||||||
|
{
|
||||||
|
"key": "my_config.txt",
|
||||||
|
"path": "redis_config"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "my-config"
|
||||||
},
|
},
|
||||||
"name": "my-config"
|
"name": "my-config"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"my-config.txt": "aaaa"
|
"my_config.txt": "aaaa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -56,12 +56,32 @@
|
|||||||
"image": "redis:latest",
|
"image": "redis:latest",
|
||||||
"imagePullPolicy": "",
|
"imagePullPolicy": "",
|
||||||
"name": "redis",
|
"name": "redis",
|
||||||
"resources": {}
|
"resources": {},
|
||||||
|
"volumeMounts": [
|
||||||
|
{
|
||||||
|
"mountPath": "/my_config",
|
||||||
|
"name": "my-config",
|
||||||
|
"subPath": "my_config"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"restartPolicy": "Always",
|
"restartPolicy": "Always",
|
||||||
"serviceAccountName": "",
|
"serviceAccountName": "",
|
||||||
"volumes": null
|
"volumes": [
|
||||||
|
{
|
||||||
|
"configMap": {
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"key": "my_config.txt",
|
||||||
|
"path": "my_config"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "my-config"
|
||||||
|
},
|
||||||
|
"name": "my-config"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"my-config.txt": "aaaa"
|
"my_config.txt": "aaaa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -56,12 +56,32 @@
|
|||||||
"image": "redis:latest",
|
"image": "redis:latest",
|
||||||
"imagePullPolicy": "",
|
"imagePullPolicy": "",
|
||||||
"name": "redis",
|
"name": "redis",
|
||||||
"resources": {}
|
"resources": {},
|
||||||
|
"volumeMounts": [
|
||||||
|
{
|
||||||
|
"mountPath": "/my_config",
|
||||||
|
"name": "my-config",
|
||||||
|
"subPath": "my_config"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"restartPolicy": "Always",
|
"restartPolicy": "Always",
|
||||||
"serviceAccountName": "",
|
"serviceAccountName": "",
|
||||||
"volumes": null
|
"volumes": [
|
||||||
|
{
|
||||||
|
"configMap": {
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"key": "my_config.txt",
|
||||||
|
"path": "my_config"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "my-config"
|
||||||
|
},
|
||||||
|
"name": "my-config"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"my-config.txt": "aaaa"
|
"my_config.txt": "aaaa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -71,6 +71,12 @@
|
|||||||
"name": "my-config",
|
"name": "my-config",
|
||||||
"configMap": {
|
"configMap": {
|
||||||
"name": "my-config",
|
"name": "my-config",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"key": "my_config.txt",
|
||||||
|
"path": "redis_config"
|
||||||
|
}
|
||||||
|
],
|
||||||
"defaultMode": 288
|
"defaultMode": 288
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,7 +89,8 @@
|
|||||||
"volumeMounts": [
|
"volumeMounts": [
|
||||||
{
|
{
|
||||||
"name": "my-config",
|
"name": "my-config",
|
||||||
"mountPath": "/redis-config"
|
"mountPath": "/redis_config",
|
||||||
|
"subPath": "redis_config"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"my-config.txt": "aaaa"
|
"my_config.txt": "aaaa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -66,11 +66,32 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
|
"volumes": [
|
||||||
|
{
|
||||||
|
"name": "my-config",
|
||||||
|
"configMap": {
|
||||||
|
"name": "my-config",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"key": "my_config.txt",
|
||||||
|
"path": "my_config"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"containers": [
|
"containers": [
|
||||||
{
|
{
|
||||||
"name": "redis",
|
"name": "redis",
|
||||||
"image": " ",
|
"image": " ",
|
||||||
"resources": {}
|
"resources": {},
|
||||||
|
"volumeMounts": [
|
||||||
|
{
|
||||||
|
"name": "my-config",
|
||||||
|
"mountPath": "/my_config",
|
||||||
|
"subPath": "my_config"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"restartPolicy": "Always"
|
"restartPolicy": "Always"
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"first-config.txt": "First config\n"
|
"first_config.txt": "First config\n"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -61,8 +61,9 @@
|
|||||||
"resources": {},
|
"resources": {},
|
||||||
"volumeMounts": [
|
"volumeMounts": [
|
||||||
{
|
{
|
||||||
"mountPath": "/nginx.conf",
|
"mountPath": "/etc/nginx.conf",
|
||||||
"name": "firstconfig"
|
"name": "firstconfig",
|
||||||
|
"subPath": "nginx.conf"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mountPath": "/var/www/nginx",
|
"mountPath": "/var/www/nginx",
|
||||||
@ -76,8 +77,14 @@
|
|||||||
"volumes": [
|
"volumes": [
|
||||||
{
|
{
|
||||||
"configMap": {
|
"configMap": {
|
||||||
"name": "firstconfig",
|
"defaultMode": 644,
|
||||||
"defaultMode": 644
|
"items": [
|
||||||
|
{
|
||||||
|
"key": "first_config.txt",
|
||||||
|
"path": "nginx.conf"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "firstconfig"
|
||||||
},
|
},
|
||||||
"name": "firstconfig"
|
"name": "firstconfig"
|
||||||
},
|
},
|
||||||
@ -126,7 +133,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"second-config.txt": "Second config\n"
|
"second_config.txt": "Second config\n"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -173,8 +180,9 @@
|
|||||||
"resources": {},
|
"resources": {},
|
||||||
"volumeMounts": [
|
"volumeMounts": [
|
||||||
{
|
{
|
||||||
"mountPath": "/nginx.conf",
|
"mountPath": "/etc/nginx.conf",
|
||||||
"name": "secondconfig"
|
"name": "secondconfig",
|
||||||
|
"subPath": "nginx.conf"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mountPath": "/var/www/nginx",
|
"mountPath": "/var/www/nginx",
|
||||||
@ -188,8 +196,14 @@
|
|||||||
"volumes": [
|
"volumes": [
|
||||||
{
|
{
|
||||||
"configMap": {
|
"configMap": {
|
||||||
"name": "secondconfig",
|
"defaultMode": 644,
|
||||||
"defaultMode": 644
|
"items": [
|
||||||
|
{
|
||||||
|
"key": "second_config.txt",
|
||||||
|
"path": "nginx.conf"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "secondconfig"
|
||||||
},
|
},
|
||||||
"name": "secondconfig"
|
"name": "secondconfig"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"second-config.txt": "Second config\n"
|
"second_config.txt": "Second config\n"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -61,8 +61,9 @@
|
|||||||
"resources": {},
|
"resources": {},
|
||||||
"volumeMounts": [
|
"volumeMounts": [
|
||||||
{
|
{
|
||||||
"mountPath": "/nginx.conf",
|
"mountPath": "/etc/nginx.conf",
|
||||||
"name": "firstconfig"
|
"name": "firstconfig",
|
||||||
|
"subPath": "nginx.conf"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mountPath": "/var/www/nginx",
|
"mountPath": "/var/www/nginx",
|
||||||
@ -76,8 +77,14 @@
|
|||||||
"volumes": [
|
"volumes": [
|
||||||
{
|
{
|
||||||
"configMap": {
|
"configMap": {
|
||||||
"name": "firstconfig",
|
"defaultMode": 644,
|
||||||
"defaultMode": 644
|
"items": [
|
||||||
|
{
|
||||||
|
"key": "second_config.txt",
|
||||||
|
"path": "nginx.conf"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "firstconfig"
|
||||||
},
|
},
|
||||||
"name": "firstconfig"
|
"name": "firstconfig"
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user