Hi Community ,
Im trying to deploy raw yaml to kubernates cluster under stored on rancher for specific namespace.
I could deploy without using any volume mounts and config map (using for volume) but couldn’t be successfully with using stored config map on rancher for under this namespace value.
my release created from teamcity successfully.
Im getting array error on validation in this step , any suggest to me? would be appreciated
ValidationError(Deployment.spec.template.spec.containers): invalid type for io.k8s.api.core.v1.PodSpec.containers: got “map”, expected “array”; if you choose to ignore these errors, turn validation off with --validate=false
The remote script failed with exit code 1
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: #{rancher.service_name}-#{Octopus.Action[Variable].Output.branch}
namespace: somenamespace
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
selector:
matchLabels:
workload.user.cattle.io/workloadselector: #{rancher.service_name}-#{Octopus.Action[Variable].Output.branch}
template:
metadata:
labels:
io.emlakjet.dc: somelabel
io.emlakjet.stack: somelabel
workload.user.cattle.io/workloadselector: #{rancher.service_name}-#{Octopus.Action[Variable].Output.branch}
spec:
containers:
- envFrom:
configMapRef:
name: myconfigmap
optional: false
command:
- /usr/bin/pm2-docker
- /app/pm2.json
image: #{docker_hub.path}/#{docker_hub.image_name}:#{Octopus.Action[Variable].Output.branch}-#{Octopus.Release.Number}
imagePullPolicy: Always
name: #{rancher.service_name}-#{Octopus.Action[Variable].Output.branch}
ports:
- containerPort: 80
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /app/config
name: volname
securityContext:
allowPrivilegeEscalation: false
capabilities: {}
privileged: false
readOnlyRootFilesystem: false
runAsNonRoot: false
serviceAccountName: ""
imagePullSecrets:
- name: mysecret
restartPolicy: Always
volumes:
- configMap:
defaultMode: 256
name: myconfigmapstoredonrancher
optional: false
name: somenamespace