我正在安装WSO2 API管理器在谷歌Kubernets版本1.19的掌舵图git枢纽工程Kubernetes版本1.12如何使它工作1.19

wsxa1bj1  于 2022-12-11  发布在  Kubernetes
关注(0)|答案(1)|浏览(106)

I folow wso2 API MANAGER ON LIN K instruction https://artifacthub.io/packages/helm/wso2/am-single-node
git clone https://github.com/wso2/kubernetes-apim.git then updating three files named wso2am-gateway-ingress.yaml, wso2am-ingress.yaml and wso2am-websub-ingress.yaml on installation directory ~/kubernetes-apim/simple/am-single/templates/am match nginx ingress controller with link https://kubernetes.io/docs/concepts/services-networking/ingress then i installed WSO2 by run the code
helm install <RELEASE_NAME> <HELM_HOME>/am-single --version 4.0.0-1 --namespace <NAMESPACE> --dependency-update --create-namespace
the code run successfully on G8S Cluster ver1.19
but i cant access the service See my link to access the services API Manager Publisher: http://35.245.157.84/publisher API Manager DevPortal: https://35.245.157.84/devportal
what i did
I cloned WSO2 with the three files as shown below located on ~/kubernetes-apim/simple/am
file 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

Editted to

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

file 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

Editted to

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

file 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

editted to

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

please clone that wsos API MANAGER ON LIN K instruction https://artifacthub.io/packages/helm/wso2/am-single-node
i use the wso2 installation on github by cloning the link
git clone https://github.com/wso2/kubernetes-apim.git

please advise to check my helm chart using helm ver3 to work on kubernetes version 1.19

See my link to access the services API Manager Publisher: http://35.245.157.84/publisher API Manager DevPortal: https://35.245.157.84/devportal
see the output of 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:~$
mnemlml8

mnemlml81#

I've found in kubernetes-apim docs:

3. Add a DNS record mapping the hostnames and the external IP

If the defined hostnames (in the previous step) are backed by a DNS service, add a DNS record mapping the hostnames and the external IP ( EXTERNAL-IP ) in the relevant DNS service.
If the defined hostnames are not backed by a DNS service, for the purpose of evaluation you may add an entry mapping the hostnames and the external IP in the /etc/hosts file at the client-side.

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

So it looks like you need to either use your own domain and set Ingress hostnames in values.yaml file, or add the already existing Ingress hostnames from values.yaml to /etc/hosts file.

相关问题