fix jobs to create a secret can work on upgrade
This PS fixes the jobs falling into a crash loop state when upgrading charts. 'kubectl create' command cannot overwrite if a secret already exists. But 'kubectl apply' command can do it. Change-Id: Idd6eea06892a30e36e51a9b1130fd7cd84ff65cf
This commit is contained in:
parent
db2276055e
commit
717d72485b
@ -47,7 +47,7 @@ type: Opaque
|
||||
data:
|
||||
${CEPH_KEYRING_NAME}: $( kube_ceph_keyring_gen ${CEPH_KEYRING} ${CEPH_KEYRING_TEMPLATE} )
|
||||
EOF
|
||||
} | kubectl create --namespace ${DEPLOYMENT_NAMESPACE} -f -
|
||||
} | kubectl apply --namespace ${DEPLOYMENT_NAMESPACE} -f -
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ type: Opaque
|
||||
data:
|
||||
${CEPH_KEYRING_NAME}: $( kube_ceph_keyring_gen ${CEPH_KEYRING} ${CEPH_KEYRING_TEMPLATE} )
|
||||
EOF
|
||||
} | kubectl create --namespace ${DEPLOYMENT_NAMESPACE} -f -
|
||||
} | kubectl apply --namespace ${DEPLOYMENT_NAMESPACE} -f -
|
||||
fi
|
||||
}
|
||||
#create_kube_key <ceph_key> <ceph_keyring_name> <ceph_keyring_template> <kube_secret_name>
|
||||
@ -71,7 +71,7 @@ type: kubernetes.io/rbd
|
||||
data:
|
||||
key: $( echo ${CEPH_KEYRING} | base64 | tr -d '\n' )
|
||||
EOF
|
||||
} | kubectl create --namespace ${DEPLOYMENT_NAMESPACE} -f -
|
||||
} | kubectl apply --namespace ${DEPLOYMENT_NAMESPACE} -f -
|
||||
fi
|
||||
}
|
||||
#create_kube_storage_key <ceph_key> <kube_secret_name>
|
||||
|
@ -37,7 +37,7 @@ type: "${secret_type}"
|
||||
data:
|
||||
key: $( echo ${ceph_key} )
|
||||
EOF
|
||||
} | kubectl create --namespace ${kube_namespace} -f -
|
||||
} | kubectl apply --namespace ${kube_namespace} -f -
|
||||
}
|
||||
|
||||
if ! kubectl get --namespace ${DEPLOYMENT_NAMESPACE} secrets ${PVC_CEPH_CEPHFS_STORAGECLASS_USER_SECRET_NAME}; then
|
||||
|
@ -37,7 +37,7 @@ type: "${secret_type}"
|
||||
data:
|
||||
key: $( echo ${ceph_key} )
|
||||
EOF
|
||||
} | kubectl create --namespace ${kube_namespace} -f -
|
||||
} | kubectl apply --namespace ${kube_namespace} -f -
|
||||
}
|
||||
|
||||
ceph_activate_namespace ${DEPLOYMENT_NAMESPACE} "kubernetes.io/rbd" ${PVC_CEPH_RBD_STORAGECLASS_USER_SECRET_NAME} "$(echo ${CEPH_RBD_KEY} | jq -r '.data | .[]')"
|
||||
|
@ -36,6 +36,7 @@ rules:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: RoleBinding
|
||||
|
@ -37,6 +37,7 @@ rules:
|
||||
verbs:
|
||||
- get
|
||||
- create
|
||||
- patch
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: RoleBinding
|
||||
|
@ -36,6 +36,7 @@ rules:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: RoleBinding
|
||||
|
@ -33,6 +33,7 @@ rules:
|
||||
verbs:
|
||||
- get
|
||||
- create
|
||||
- patch
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: RoleBinding
|
||||
|
@ -63,6 +63,6 @@ type: kubernetes.io/rbd
|
||||
data:
|
||||
key: $( echo ${ENCODED_KEYRING} )
|
||||
EOF
|
||||
kubectl create --namespace ${NAMESPACE} -f ${SECRET}
|
||||
kubectl apply --namespace ${NAMESPACE} -f ${SECRET}
|
||||
|
||||
fi
|
||||
|
@ -60,6 +60,6 @@ type: kubernetes.io/rbd
|
||||
data:
|
||||
key: $( echo ${ENCODED_KEYRING} )
|
||||
EOF
|
||||
kubectl create --namespace ${NAMESPACE} -f ${SECRET}
|
||||
kubectl apply --namespace ${NAMESPACE} -f ${SECRET}
|
||||
|
||||
fi
|
||||
|
@ -34,6 +34,7 @@ rules:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: RoleBinding
|
||||
|
@ -34,6 +34,7 @@ rules:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: RoleBinding
|
||||
|
@ -62,7 +62,7 @@ type: kubernetes.io/rbd
|
||||
data:
|
||||
key: $( echo ${ENCODED_KEYRING} )
|
||||
EOF
|
||||
kubectl create --namespace ${NAMESPACE} -f ${SECRET}
|
||||
kubectl apply --namespace ${NAMESPACE} -f ${SECRET}
|
||||
elif [ "x$STORAGE_BACKEND" == "xradosgw" ]; then
|
||||
radosgw-admin user stats --uid="${RADOSGW_USERNAME}" || \
|
||||
radosgw-admin user create \
|
||||
|
@ -34,6 +34,7 @@ rules:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: RoleBinding
|
||||
|
@ -57,4 +57,4 @@ type: kubernetes.io/rbd
|
||||
data:
|
||||
key: $( echo ${ENCODED_KEYRING} )
|
||||
EOF
|
||||
kubectl create --namespace ${NAMESPACE} -f ${SECRET}
|
||||
kubectl apply --namespace ${NAMESPACE} -f ${SECRET}
|
||||
|
@ -34,6 +34,7 @@ rules:
|
||||
- get
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: RoleBinding
|
||||
|
Loading…
Reference in New Issue
Block a user