This directive applies to client requests with a request body. As soon as the number of uploaded data exceedsmax_client_body_size, Nginx immediately sends a413 Request entity too largeHTTP error response. However, most browsers continue uploading data regardless of that notification. This directive defines the number of time Nginx should wait after sending this error response before closing the connection.
시크릿은 암호, 토큰 또는 키와 같은 소량의 중요한 데이터를 포함하는 오브젝트이다. 이를 사용하지 않으면 중요한 정보가파드명세나컨테이너 이미지에 포함될 수 있다. 시크릿을 사용한다는 것은 사용자의 기밀 데이터를 애플리케이션 코드에 넣을 필요가 없음을 뜻한다.
쿠버네티스에서 Deployment.yaml 작성시 Private Docker Registry, Nexus, Harbor 와 같은 것에 있는 이미지를 가져올 때Pull 권한이 없다고 하는 경우가 있다. 이 경우 secret 생성 후 deployment.yaml에 imagePullSecrets를 입력하면된다.(물론 모든 Worker Node에 docker login해주면되긴하지만, 항상 해당 registry 만 사용할건아니니까...)
1. secret 생성
secret 생성시 주의할 점은 namespace가 있을 경우 뒤에 -n 옵션을 통해 namespace를 설정해주어야한다.
없으면 default로 설정되며, 해당 pod가 namespace를 가질 경우 반드시 namespace를 설정해주어야한다.
1.1 default
kubectl create secret docker-registry secret-name \
--docker-email=test@test.com \ # 이 부분은 생략가능
--docker-username=harborId \
--docker-password=harborPw \
--docker-server=http://harborurl.com # harbor or nexus or private registry
1.2 namesapce
kubectl create secret docker-registry secret-name \
--docker-email=test@test.com \ # 이 부분은 생략가능
--docker-username=harborId \
--docker-password=harborPw \
--docker-server=http://harborurl.com \ # harbor or nexus or private registry
-n namespaceoption
2. imagePullSecrets 추가
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
spec:
replicas: 1
selector:
matchLabels:
app: test
template:
metadata:
labels:
app: test
spec:
containers:
- name: test
image: harborurl.com:latest
imagePullSecrets:
- name: secret-name # secret에서 생성한 이름