問題:
I am trying to deploy nginx on kubernetes, kubernetes version is v1.5.2, I have deployed nginx with 3 replica, YAML file is below,我正在嘗試在 kubernetes 上部署 nginx,kubernetes 版本是 v1.5.2,我已經部署了 3 個副本的 nginx,YAML 文件在下面,
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: deployment-example
spec:
replicas: 3
revisionHistoryLimit: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.10
ports:
- containerPort: 80
and now I want to expose its port 80 on port 30062 of node, for that I created a service below,現在我想在節點的端口 30062 上公開它的端口 80,爲此我在下面創建了一個服務,
kind: Service
apiVersion: v1
metadata:
name: nginx-ils-service
spec:
ports:
- name: http
port: 80
nodePort: 30062
selector:
app: nginx
type: LoadBalancer
this service is working good as it should be, but it is showing as pending not only on kubernetes dashboard also on terminal.這項服務運行良好,但它不僅在 kubernetes 儀表板上而且在終端上都顯示爲待處理。
解決方案:
參考一: https://en.stackoom.com/question/2z5Fk參考二: https://stackoom.com/question/2z5Fk