суббота, 19 августа 2023 г.

OKD/OpenShift console for vanilla Kubernetes

I have using OpenShift almost 4 years and WEB console better than default Kubernetes Dashboard IMHO.





Prepartion:
1. 192.168.1.160 - nginx external
2. 192.168.1.164 - worker node, also as nginx ingress
k8s: v1.26.5 OKD: origin-console:4.13 after installation give access for SA kubectl create clusterrolebinding cr-admin --clusterrole=cluster-admin --serviceaccount=default:default
============================================================================NGINX===========================================================
http {


upstream console {
server 192.168.1.164:80;
}
server {
listen 80;
location / {
proxy_pass http://console;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

=======================================================deployment=========================================================
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: console
name: console
spec:
replicas: 1
selector:
matchLabels:
app: console
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: console
spec:
containers:
- image: quay.io/openshift/origin-console:4.13
name: origin-console
resources: {}
ports:
- containerPort: 9000
status: {}
=============================================================service=====================================================
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: console
name: console
spec:
ports:
- port: 9000
protocol: TCP
targetPort: 9000
nodePort: 30030
selector:
app: console
type: NodePort
status:
loadBalancer: {}
=============================================================ingress=====================================================
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
creationTimestamp: null
name: console
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: console.diploma.kz
http:
paths:
- backend:
service:
name: console
port:
number: 9000
path: /
pathType: Prefix

Комментариев нет:

Отправить комментарий