我遵循LIN K指令https://artifacthub.io/packages/helm/wso2/am-single-node上的wso2应用程序接口管理器
然后,git clone https://github.com/wso2/kubernetes-apim.git更新安装目录中名为wso2am-git clone https://github.com/wso2/kubernetes-apim.git-ingress.yaml、wso2am-ingress.yaml和wso2am-websub-ingress.yaml的三个文件~/kubernetes-apim/simple/am-single/templates/am将nginx入口控制器与链接https://kubernetes.io/docs/concepts/services-networking/ingress匹配,然后通过运行以下代码安装WSO2
helm install <RELEASE_NAME> <HELM_HOME>/am-single --version 4.0.0-1 --namespace <NAMESPACE> --dependency-update --create-namespace
代码在G8S集群版本1.19上成功运行
但我无法访问服务请参阅访问服务应用编程接口管理器的链接发布者:http://35.245.157.84/publisher应用编程接口管理器DevPortal: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请在LIN指令https://artifacthub.io/packages/helm/wso2/am-single-node上克隆wsos API管理器
我通过克隆链接在github上使用wso2安装
git clone https://github.com/wso2/kubernetes-apim.git
请建议使用helm ver3查看我的舵表,以便在Kubernetes1.19版上工作
请参阅我的链接以访问服务应用编程接口管理器Publisher:http://35.245.157.84/publisher应用编程接口管理器DevPortal: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:~$发布于 2021-05-28 21:06:08
我在kubernetes-apim docs中找到的
如果已定义的主机名(在上一步中)由DNS服务支持,请在相关DNS服务中添加映射主机名和外部IP (EXTERNAL-IP)的DNS记录。
如果定义的主机名不受DNS服务支持,出于评估目的,您可以在客户端的/etc/hosts文件中添加一个映射主机名和外部IP的条目。
因此,看起来您需要使用自己的域并在values.yaml file中设置入口主机名,或者将已经存在的入口主机名从values.yaml添加到/etc/hosts文件中。
https://stackoverflow.com/questions/67724429
复制相似问题