I am using skaffold for my kubernetes local cluster deployment. Currently, I am trying to setup Redis. So far, I have written a "token-redis.yaml" file that contains the configmap, pvc, pv, statefulset and clusterip service. When I save the changes, skaffold gives me the following error:
"Skipping render due to error:missing Resource metadata"
This is my YAML file:
apiVersion: v1
kind: ConfigMap
metadata:
name: token-redis-configmap
data:
update-node.sh: |
#!/bin/sh
REDIS_NODES="/data/nodes.conf"
sed -i -e "/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${POD_IP}/" ${REDIS_NODES}
exec "$@"
redis.conf: |+
cluster-enabled yes
cluster-require-full-coverage no
cluster-node-timeout 15000
cluster-config-file /data/nodes.conf
cluster-migration-barrier 1
appendonly yes
protected-mode no
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: redis-pv-01
spec:
capacity:
storage: 1Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
hostPath:
path: /redis01
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: token-redis
spec:
replicas: 1
serviceName: token-redis
selector:
matchLabels:
app: token-redis
template:
metadata:
labels:
app: token-redis
spec:
volumes:
- name: conf
configMap:
name: "token-redis-configmap"
defaultMode: 0755
containers:
- name: token-redis-container
image: redis:5.0.1-alpine
command: ["/conf/update-node.sh", "redis-server", "/conf/redis.conf"]
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: "status.podIP"
ports:
- containerPort: 6379
name: client
- containerPort: 16379
name: gossip
volumeMounts:
- name: conf
mountPath: "/conf"
readOnly: false
- name: data
mountPath: "/data"
readOnly: false
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
name: token-redis-service
spec:
type: ClusterIP
selector:
app: token-redis
ports:
- name: client
port: 6379
targetPort: 6379
- name: gossip
port: 16379
targetPort: 16379