Deployment create or apply -f 파일이름 실행시 아래와 같이 에러 메세지 출력 (참고 apiVersion: apps/v1)
[root@hadoopm KUBE]# kubectl apply -f deployment-definition.yml
Error from server (BadRequest): error when creating "deployment-definition.yml": Deployment in version "v1" cannot be handled as a Deployment: no kind "Deployment" is registered for version "apps/v1"
root@hadoopm KUBE]# kubectl version
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.0", GitCommit:"d3ada0119e776222f11ec7945e6d
뭐 이렇게 하는게 맞는진 모르지만
암튼..
K8S가 1.9 밑에 버젼 1.8 이나 1.7 버젼이면 apiVersion: apps/v1beta1 <=요렇게 변경해준다 1.9이상이면 에러가 안나겠죵(apps/v1)
그럼 된다..
-----------------deployment-definition.yml ------------------------------
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-deployment
labels:
app: myapp
type: front-end
spec:
template:
metadata:
name: myapp-pod
labels:
app: myapp
type: front-end
spec:
containers:
- name: nginx-container
image: dockertest2.io:12000/nginx:latest
replicas: 3
selector:
matchLabels:
type: front-end
[root@hadoopm KUBE]# kubectl get deployments
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
myapp-deployment 3 3 3 3 6m
nginx 1 1 1 1 5d
[root@hadoopm KUBE]# kubectl get replicaset
NAME DESIRED CURRENT READY AGE
myapp-deployment-3571195553 3 3 3 6m
nginx-2496978322 1 1 1 5d
[root@hadoopm KUBE]# kubectl get pods
NAME READY STATUS RESTARTS AGE
myapp-deployment-3571195553-27hgj 1/1 Running 0 7m
myapp-deployment-3571195553-7hzvr 1/1 Running 0 7m
myapp-deployment-3571195553-gw4xn 1/1 Running 0 7m
'나는 노동자 > QnA' 카테고리의 다른 글
failed to get D-Bus connection:Operation not permitted (0) | 2019.11.04 |
---|---|
npm install 설치시 unable_to_verify_left (0) | 2018.09.18 |
10-kubeadm.conf CGroups change (0) | 2018.07.11 |
R install_tensorflow() virtualenvs python 에러시 (0) | 2018.06.19 |
pytorch jupyter notebook 실행시 OSError: [Errno 99] Cannot assign requested address (0) | 2018.06.15 |