通过helm在AKS上的Kubernetes LoadBalancer服务是 [英] Kubernetes LoadBalancer service on AKS via helm is

查看:154
本文介绍了通过helm在AKS上的Kubernetes LoadBalancer服务是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我''正在处理我需要的项目使用Kubernetes,Helm和Azure Kubernetes服务部署一个简单的NodeJs应用程序。


这是我的尝试:



我的  Dockerfile

  FROM节点:8 

WORKDIR / usr / src / app

COPY包* .json ./

RUN npm install

COPY ..

EXPOSE 32000
CMD [" npm"," start"]



这是我的  mychart / values.yaml

  replicaCount:1 

image:
#register:docker.io
repository:registry-1.docker.io/arycloud/docker-web- app
标签:0.3
pullPolicy:IfNotPresent

nameOverride:""
fullnameOverride:""

service:
名称:http
类型:LoadBalancer
port:80
internalPort:32000

ingress:
enabled:false
annotations: {}
#kubernetes.io/ingress.class:nginx
#kubernetes.io/tls-acme:" true"
paths:[]
hosts:
- 名称:mychart.local
路径:/
tls:[]

资源:{}

nodeSelector:{}

宽容:[]

亲和力:{}



我的节点  server.js

 'use strict'; 

const express = require('express');

//常量
const PORT = 32000;
const HOST ='0.0.0.0';

// App
const app = express();
app.get('/',(req, res)=> {
res.send('来自container.\'的Hello world);
});

app.listen(PORT,HOST);
console.log(`在http:// $ {HOST}上运行:$ {PORT}`);


< p style ="padding-right:0px;行高:继承; font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;字体大小:15像素;垂直对齐:基线;明确:两者;颜色:#242729">
我在AKS上创建了一个集群,然后运行  get-credentials  命令
,它运行正常,然后我标记并将我的docker镜像推送到 dockerhub  和
docker容器也正常工作,之后我创建了一个helm图表并更新   values.yaml 相应
并运行  helm
install
 命令,它将我的应用程序安装到  aks  和
服务提供,外部
IP
  pods  是
in  正在运行 状态
但当我尝试通过  Etxernal_IP:80  它
不加载我的应用程序。



这里有什么问题?



提前致谢!

解决方案

错误是什么导航到外部IP时会得到什么? 


您是否遵循了我们为您的AKS群集设置外部IP的文档? 


https://docs.microsoft.com/en-us/azure/ AKS /入口静电-IP


I''m working on a project in which I need to deploy a simple NodeJs application using Kubernetes, Helm and Azure Kubernetes Service.

Here's What I have tried:

My Dockerfile:

FROM node:8

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 32000
CMD [ "npm", "start" ]

Here's my mychart/values.yaml:

replicaCount: 1

image:
  # registry: docker.io
  repository: registry-1.docker.io/arycloud/docker-web-app
  tag: 0.3
  pullPolicy: IfNotPresent

nameOverride: ""
fullnameOverride: ""

service:
  name: http
  type: LoadBalancer
  port: 80
  internalPort: 32000

ingress:
  enabled: false
  annotations: {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  paths: []
  hosts:
    - name: mychart.local
      path: /
  tls: []

resources: {}

nodeSelector: {}

tolerations: []

affinity: {}

And my node server.js:

'use strict';

const express = require('express');

// Constants
const PORT = 32000;
const HOST = '0.0.0.0';

// App
const app = express();
app.get('/', (req, res) => {
  res.send('Hello world from container.\n');
});

app.listen(PORT, HOST);
console.log(`Running on http://${HOST}:${PORT}`);

I have created a cluster on AKS then run the get-credentials command from my mac os terminal and it works fine, then I have tagged and pushed my docker image to dockerhub and the docker container is also working fine, after that I have created a helm chart and update  values.yamlaccordingly and run the helm install command, it install my application to aks and the service provide an,external IP in the kubernetes dashboard the pods are in running state but when I try to access my application via Etxernal_IP:80 it doesn't load my application.

What can be wrong here?

Thanks in advance!

解决方案

What is the error you get when you navigate to the external IP? 

Have you followed the documentation we have for setting up an External IP for your AKS cluster? 

https://docs.microsoft.com/en-us/azure/aks/ingress-static-ip


这篇关于通过helm在AKS上的Kubernetes LoadBalancer服务是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆