我正在GOOGLE KUBERNETS VER 1.19上安装WSO2 API MANAGER git hub上的hel



我遵循wso2 API MANAGER ON LIN K指令https://artifacthub.io/packages/helm/wso2/am-single-node

git clone https://github.com/wso2/kubernetes-apim.git然后更新安装目录~/kubernetes-apim/simple/am-single/templates/am上名为wso2am-gateway-ingress.yaml、wso2am-ingress.yaml和wso2am-websub-ingress.亚马l的三个文件,使nginx入口控制器与链接匹配https://kubernetes.io/docs/concepts/services-networking/ingress然后我通过运行代码
helm install <RELEASE_NAME> <HELM_HOME>/am-single --version 4.0.0-1 --namespace <NAMESPACE> --dependency-update --create-namespace安装了WSO2

代码在G8S Cluster版本1.19 上成功运行

但是我无法使用该服务查看我的链接以访问服务API管理器发布者:http://35.245.157.84/publisherAPI管理器开发门户:https://35.245.157.84/devportal

我做了什么

我用如下所示的三个文件克隆了WSO2,它们位于~/kubernetes-apim/simple/am 上

文件1(wso2am-gateway-ingress.yaml:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "am-single-node.resource.prefix" . }}-am-gateway-ingress
namespace : {{ .Release.Namespace }}
{{- if .Values.wso2.deployment.am.ingress.gateway.annotations }}
annotations:
{{ toYaml .Values.wso2.deployment.am.ingress.gateway.annotations | indent 4 }}
{{- end }}
spec:
tls:
- hosts:
- {{ .Values.wso2.deployment.am.ingress.gateway.hostname }}
rules:
- host: {{ .Values.wso2.deployment.am.ingress.gateway.hostname }}
http:
paths:
- path: /
backend:
serviceName: {{ template "am-single-node.resource.prefix" . }}-am-service
servicePort: 8243

已编辑为

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "am-single-node.resource.prefix" . }}-am-gateway-ingress
namespace : {{ .Release.Namespace }}
{{- if .Values.wso2.deployment.am.ingress.gateway.annotations }}
annotations:
{{ toYaml .Values.wso2.deployment.am.ingress.gateway.annotations | indent 4 }}
{{- end }}
spec:
tls:
- hosts:
- {{ .Values.wso2.deployment.am.ingress.gateway.hostname }}
rules:
- host: {{ .Values.wso2.deployment.am.ingress.gateway.hostname }}
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: {{ template "am-single-node.resource.prefix" . }}-am-service
port:
number: 8243

文件2(wso2am-ingress.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "am-single-node.resource.prefix" . }}-am-ingress
namespace : {{ .Release.Namespace }}
{{- if .Values.wso2.deployment.am.ingress.management.annotations }}
annotations:
{{ toYaml .Values.wso2.deployment.am.ingress.management.annotations | indent 4 }}
{{- end }}
spec:
tls:
- hosts:
- {{ .Values.wso2.deployment.am.ingress.management.hostname }}
rules:
- host: {{ .Values.wso2.deployment.am.ingress.management.hostname }}
http:
paths:
- path: /
backend:
serviceName: {{ template "am-single-node.resource.prefix" . }}-am-service
servicePort: 9443

已编辑为

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "am-single-node.resource.prefix" . }}-am-ingress
namespace : {{ .Release.Namespace }}
{{- if .Values.wso2.deployment.am.ingress.management.annotations }}
annotations:
{{ toYaml .Values.wso2.deployment.am.ingress.management.annotations | indent 4 }}
{{- end }}
spec:
tls:
- hosts:
- {{ .Values.wso2.deployment.am.ingress.management.hostname }}
rules:
- host: {{ .Values.wso2.deployment.am.ingress.management.hostname }}
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: {{ template "am-single-node.resource.prefix" . }}-am-service
port:
number: 9443

文件3(wso2am-websub-ingress.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "am-single-node.resource.prefix" . }}-am-websub-ingress
namespace : {{ .Release.Namespace }}
{{- if .Values.wso2.deployment.am.ingress.websub.annotations }}
annotations:
{{ toYaml .Values.wso2.deployment.am.ingress.websub.annotations | indent 4 }}
{{- end }}
spec:
tls:
- hosts:
- {{ .Values.wso2.deployment.am.ingress.websub.hostname }}
rules:
- host: {{ .Values.wso2.deployment.am.ingress.websub.hostname }}
http:
paths:
- path: /
backend:
serviceName: {{ template "am-single-node.resource.prefix" . }}-am-service
servicePort: 8021

编辑为

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "am-single-node.resource.prefix" . }}-am-websub-ingress
namespace : {{ .Release.Namespace }}
{{- if .Values.wso2.deployment.am.ingress.websub.annotations }}
annotations:
{{ toYaml .Values.wso2.deployment.am.ingress.websub.annotations | indent 4 }}
{{- end }}
spec:
tls:
- hosts:
- {{ .Values.wso2.deployment.am.ingress.websub.hostname }}
rules:
- host: {{ .Values.wso2.deployment.am.ingress.websub.hostname }}
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: {{ template "am-single-node.resource.prefix" . }}-am-service
port:
number: 8021

请克隆林K指令上的wsos API MANAGERhttps://artifacthub.io/packages/helm/wso2/am-single-node

我通过克隆链接在github上使用wso2安装

git clone https://github.com/wso2/kubernetes-apim.git

请建议使用helm ver3检查我的helm图表,以便在kubernetes 1.19版本上工作

查看我的链接以访问服务API管理器发布者:http://35.245.157.84/publisherAPI管理器开发门户:https://35.245.157.84/devportal

参见curl https://am.wso2.com/publisher/ -k的输出

Welcome to Cloud Shell! Type "help" to get started.
Your Cloud Platform project in this session is set to metal-contact-171112.
Use “gcloud config set project [PROJECT_ID]” to change to a different project.
dmalamo42@cs-881542484316-default-default-pc56l:~$ gcloud container clusters get-credentials beanworth-cluster-2 --zone us-east4-a --project metal-contact-171112
Fetching cluster endpoint and auth data.
kubeconfig entry generated for beanworth-cluster-2.
dmalamo42@cs-881542484316-default-default-pc56l:~$ curl https://am.wso2.com/publisher/ -k
curl: (6) Could not resolve host: am.wso2.com
dmalamo42@cs-881542484316-default-default-pc56l:~$ pwd
/home/dmalamo42
dmalamo42@cs-881542484316-default-default-pc56l:~$ sudo nano /etc/hosts
dmalamo42@cs-881542484316-default-default-pc56l:~$ curl https://am.wso2.com/publisher/ -k
<!DOCTYPE html>
<!--
~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied.  See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<html lang="en">

<head>
<base href="/publisher/" />
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=1024, initial-scale=1" />
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>[Publisher Portal]WSO2 APIM</title>
<link href="/publisher/site/public/css/main.css" type="text/css" rel="stylesheet" />
<link href="/publisher/site/public/css/draftjs.css" type="text/css" rel="stylesheet" />
<link rel="shortcut icon" href="/publisher/site/public/images/favicon.ico">
</head>
<body>
<div id="react-root">
<div class="apim-dual-ring"></div>
</div>
<script src="/publisher/site/public/fonts/iconfont/MaterialIcons.js"></script>
<script src="/publisher/site/public/conf/userThemes.js"></script>
<script src="/publisher/site/public/conf/portalSettings.js"></script>
<script src="/publisher/services/settings/settings.js"></script>
<script src="/publisher/site/public/dist/index.7422e2feefc0de743eb6.bundle.js"></script>
<!-- Swagger worker has being removed until we resolve
*              https://github.com/wso2/product-apim/issues/10694 issue, need to change webpack config too -->
<!--script src="/publisher/"></script-->
<link rel="stylesheet" href="/publisher/site/public/fonts/iconfont/material-icons.css">
</body>
</html>dmalamo42@cs-881542484316-default-default-pc56l:~$

我在kubernetes apim docs:中找到了

3.添加映射主机名和外部IP的DNS记录

如果定义的主机名(在上一步中(由DNS支持服务,添加映射主机名和外部IP的DNS记录(EXTERNAL-IP(。

如果定义的主机名没有DNS服务支持,则对于为了进行评估,您可以添加一个映射主机名和客户端CCD_ 7文件中的外部IP。

<wso2.deployment.am.ingress.gateway.hostname>

因此,您似乎需要使用自己的域并在values.yaml文件中设置Ingress主机名,或者将values.yaml中已经存在的Ingress主机名称添加到/etc/hosts文件中。

最新更新