##01 问题现象:网关安装成功后,点击启用网关无反应?应用路由无法使用
##于是我查看了 【启用网关】时候到yaml文件编辑 省略部分
kind: Gateway
apiVersion: gateway.kubesphere.io/v2alpha1
metadata:
namespace: prod
name: kubesphere-router-namespace-prod
spec:
values:
commonLabels: {}
controller:
patch:
enabled: true
image:
digest: >-
sha256:39c5b2e3310dc4264d638ad28d9d1d96c4cbb2b2dcfb52368fe4e3c63f61e10f
image: ingress-nginx/kube-webhook-certgen
pullPolicy: IfNotPresent
registry: registry.k8s.io
tag: v20220916-gd32f8c343
labels: {}
nodeSelector:
kubernetes.io/os: linux
....
targetCPUUtilizationPercentage: 50
targetMemoryUtilizationPercentage: 50
autoscalingTemplate: []
config:
worker-processes: '4'
configAnnotations: {}
configMapNamespace: ''
containerName: controller
containerPort:
http: 80
https: 443
customTemplate:
configMapKey: ''
configMapName: ''
dnsConfig: {}
dnsPolicy: ClusterFirst
electionID: kubesphere-router-namespace-prod
enableMimalloc: true
existingPsp: ''
extraArgs: {}
extraContainers: []
extraEnvs: []
extraInitContainers: []
extraModules: []
extraVolumeMounts: []
extraVolumes: []
healthCheckHost: ''
healthCheckPath: /healthz
hostNetwork: false
hostPort:
enabled: false
ports:
http: 80
https: 443
hostname: {}
image:
allowPrivilegeEscalation: true
chroot: false
digest: >-
sha256:34ee929b111ffc7aa426ffd409af44da48e5a0eea1eb2207994d9e0c0882d143
digestChroot: >-
sha256:b67e889f1db8692de7e41d4d9aef8de56645bf048261f31fa7f8bfc6ea2222a0
image: ingress-nginx/controller
pullPolicy: IfNotPresent
registry: registry.k8s.io
runAsUser: 101
tag: v1.4.0
ingressClass: nginx
ingressClassByName: false
....
appVersion: kubesphere-nginx-ingress-4.3.0
【问题一】docker pull registry.k8s.io/ingress-nginx/controller/v1.4.0 镜像无法拉取
已经从其他机器拉取该镜像并导入k8s节点解决
#使用set 替换镜像
kubectl set image deployment/kubesphere-router-namespace-prod-ingress-nginx \
controller=registry.k8s.io/ingress-nginx/controller:v1.4.0 --namespace=prod
【问题二】pods起来后 瞬间就挂了
原因:该镜像 registry.k8s.io/ingress-nginx/controller:v1.4.0 支持的架构是:arm x86 (英特尔的)
而我集群节点的架构是amd的
#查看节点
kubectl get nodes -o jsonpath='{.items[*].status.nodeInfo.architecture}'
amd64 amd64 amd64 amd64 amd64 amd64 amd64 amd64 amd64 amd64
#查看镜像
docker inspect registry.k8s.io/ingress-nginx/controller:v1.4.0 --format='{{.Architecture}}'
arm64
再整个排出过程中,我尝试把扩展组件网关卸载重装
但是:重装了一晚上 页面显示一直是安装中
##下面是安装的job 部分内容
[root@master03 ingress]# cat job.yaml
kind: Job
apiVersion: batch/v1
metadata:
name: helm-executor-install-gateway
namespace: extension-gateway
labels:
kubesphere.io/extension-ref: gateway
kubesphere.io/managed: 'true'
annotations:
executor.kubesphere.io/action: install
executor.kubesphere.io/config-hash: 6cce66adee93fb95
spec:
parallelism: 1
completions: 1
backoffLimit: 0
template:
metadata:
labels:
job-name: helm-executor-install-gateway
spec:
volumes:
- name: source
configMap:
name: helm-executor-install-gateway-g8zhqn
- name: data
emptyDir: {}
containers:
- name: helm
image: 'swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/kubectl:v1.27.16'
command:
- /bin/sh
- '-c'
- >-
cp -r /tmp/helm-executor-source/. /tmp/helm-executor && helm
upgrade --history-max 2 --install --ca-file ca-helm.crt
--kubeconfig kube.config --kube-as-user
system:serviceaccount:extension-gateway:helm-executor.gateway
gateway
https://extensions-museum.kubesphere-system.svc/charts/gateway-1.0.2.tgz
--namespace extension-gateway --values values.yaml --set
tags.extension=true,tags.agent=false,global.portal.url=http://ks-console.kubesphere-system.svc:30880,global.imageRegistry=swr.cn-southwest-2.myhuaweicloud.com/ks
--post-renderer /tmp/helm-executor/helm-post-render.sh --debug
--wait --wait-for-jobs --timeout 10m0s
workingDir: /tmp/helm-executor
env:
- name: HELM_CACHE_HOME
value: /tmp/helm-executor
resources:
limits:
cpu: 500m
memory: 500Mi
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
- name: source
mountPath: /tmp/helm-executor-source
- name: data
...
type: RuntimeDefault
schedulerName: default-scheduler
我目前只发现这个job 不缺定这安装网关的 job
[root@master03 ingress]# kubectl get pods -n extension-gateway
NAME READY STATUS RESTARTS AGE
helm-executor-install-gateway-g8zhqn-kwpgl 0/1 Completed 0 16h
helm-executor-install-gateway-g8zhqn-v2sbp 0/1 Completed 0 18h
helm-executor-install-gateway-g8zhqn-zb6dc 0/1 Completed 0 15h
这些job无任何报错 已经完成任务 Completed
但是网关一直显示安装中 也无任何提示?
网关组件安装成功了,但是开启网关 点击无反应
### 启动网关的镜像是:arm的 需要拉取amd的镜像
#01 yaml文件镜像检查
镜像1: registry.k8s.io/ingress-nginx/controller:v1.4.0
docker inspect registry.k8s.io/ingress-nginx/controller:v1.4.0 --format='{{.Architecture}}'
arm64
镜像2: registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20220916-gd32f8c343
docker inspect registry.k8s.io/ingress-nginx/kube-webhook-certgen:v20220916-gd32f8c343 --format='{{.Architecture}}'
arm64
#02 替换成amd镜像
1)镜像1替换
https://hub.docker.com/r/bitnami/nginx-ingress-controller/tags?page=11
docker pull bitnami/nginx-ingress-controller:1.4.0
docker inspect bitnami/nginx-ingress-controller:1.4.0 --format='{{.Architecture}}'
amd64
2)镜像2替换
docker pull v5cn/ingress-nginx-kube-webhook-certgen:v20220916-gd32f8c343
docker inspect v5cn/ingress-nginx-kube-webhook-certgen:v20220916-gd32f8c343 --format='{{.Architecture}}'
amd64
修改了yaml文件内镜像 但是还是无反应?请问可以替换启动网关时候引用的镜像吗