some formatting in dump.sh and undo RBAC change
This commit is contained in:
		
							parent
							
								
									e3a8a9e5d3
								
							
						
					
					
						commit
						aa7f07314f
					
				|  | @ -14,7 +14,7 @@ PG_BIN=$PG_DIR/$PG_VERSION/bin | ||||||
| DUMP_SIZE_COEFF=5 | DUMP_SIZE_COEFF=5 | ||||||
| 
 | 
 | ||||||
| TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) | TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) | ||||||
| K8S_API_URL=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT | K8S_API_URL=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT/api/v1 | ||||||
| CERT=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt | CERT=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt | ||||||
| 
 | 
 | ||||||
| function estimate_size { | function estimate_size { | ||||||
|  | @ -48,14 +48,14 @@ function aws_upload { | ||||||
| function get_pods { | function get_pods { | ||||||
|     declare -r SELECTOR="$1" |     declare -r SELECTOR="$1" | ||||||
| 
 | 
 | ||||||
|     curl "${K8S_API_URL}/api/v1/namespaces/${POD_NAMESPACE}/pods?$SELECTOR"        \ |     curl "${K8S_API_URL}/namespaces/${POD_NAMESPACE}/pods?$SELECTOR" \ | ||||||
|         --cacert $CERT                          \ |         --cacert $CERT \ | ||||||
|         -H "Authorization: Bearer ${TOKEN}" | jq .items[].status.podIP -r |         -H "Authorization: Bearer ${TOKEN}" | jq .items[].status.podIP -r | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function get_current_pod { | function get_current_pod { | ||||||
|     curl "${K8S_API_URL}/api/v1/namespaces/${POD_NAMESPACE}/pods?fieldSelector=metadata.name%3D${HOSTNAME}" \ |     curl "${K8S_API_URL}/namespaces/${POD_NAMESPACE}/pods?fieldSelector=metadata.name%3D${HOSTNAME}" \ | ||||||
|         --cacert $CERT   \ |         --cacert $CERT \ | ||||||
|         -H "Authorization: Bearer ${TOKEN}" |         -H "Authorization: Bearer ${TOKEN}" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -103,12 +103,6 @@ rules: | ||||||
|   - delete |   - delete | ||||||
|   - get |   - get | ||||||
|   - patch |   - patch | ||||||
| - apiGroups: |  | ||||||
|   - apps |  | ||||||
|   resources: |  | ||||||
|   - deployments |  | ||||||
|   verbs: |  | ||||||
|   - get |  | ||||||
| - apiGroups: | - apiGroups: | ||||||
|   - apps |   - apps | ||||||
|   resources: |   resources: | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue