I am trying to install velero and minio for my k8s cluster. I have one master and 2 worker nodes. I have issue with NodePort service.
Overall pods are working and Node Port service is also running but when I try to access the minio Dashboard from browser It change Port number. I thought that issue is with my service so I also created another question for that.
Actual problem is with Console port.
When I run kubectl logs minio-8649b94fb5-8cr2k -n velero
I see this information .
WARNING: MINIO_ACCESS_KEY and MINIO_SECRET_KEY are deprecated.
Please use MINIO_ROOT_USER and MINIO_ROOT_PASSWORD
Formatting 1st pool, 1 set(s), 1 drives per set.
WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.
MinIO Object Storage Server
Copyright: 2015-2023 MinIO, Inc.
License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
Version: RELEASE.2023-01-25T00-19-54Z (go1.19.4 linux/amd64)
Status: 1 Online, 0 Offline.
API: http://10.244.2.136:9000 http://127.0.0.1:9000
Console: http://10.244.2.136:37269 http://127.0.0.1:37269
Documentation: https://min.io/docs/minio/linux/index.html
Warning: The standard parity is set to 0. This can lead to data loss.
The port number of
Console: http://10.244.2.136:37269 http://127.0.0.1:37269
is different than the port of Node Port service.
This is my NodePort Service
master-k8s@masterk8s-virtual-machine:~/velero-v1.2.0-darwin-amd64$ kubectl get svc -n velero
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
minio NodePort 10.97.197.54 <none> 9000:30480/TCP 82m
When I search the URL in browser with service port number it convert to console port and I am not able to access my application.
What I have done to fix this:
- I try to use Load balancer services and still not able to access the Application.
- I also assign the NodePort in service.yaml file It stop changing the port but I am not able to access the Application.
- I change the Ports in application and service still the same issue.
- Log have noting but this information.
- I try to install minio directly on my Ubuntu VM and it was successful.
What do I want:
I have done everything I could do. I don't find any issue like that or any information related to this topic. Any advice will be very help to fix this issue. How can I change the port of console or make it sync with service port?
Updated yaml
apiVersion: v1
kind: Namespace
metadata:
name: velero
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: minio
name: minio
labels:
component: minio
spec:
strategy:
type: Recreate
selector:
matchLabels:
component: minio
template:
metadata:
labels:
component: minio
spec:
volumes:
- name: storage
emptyDir: {}
- name: config
emptyDir: {}
containers:
- name: minio
image: minio/minio:latest
imagePullPolicy: IfNotPresent
args:
- server
- /storage
- --console-address=:9090
- --config-dir=/config
env:
- name: MINIO_ACCESS_KEY
value: "minio"
- name: MINIO_SECRET_KEY
value: "minio123"
ports:
- containerPort: 9000
name: api
- containerPort: 9090
name: console
volumeMounts:
- name: storage
mountPath: "/storage"
- name: config
mountPath: "/config"
---
apiVersion: v1
kind: Service
metadata:
namespace: minio
name: minio-service
labels:
component: minio
spec:
# ClusterIP is recommended for production environments.
# Change to NodePort if needed per documentation,
# but only if you run Minio in a test/trial environment, for example with Minikube.
type: LoadBalancer
ports:
- port: 9000
targetPort: 9000
protocol: TCP
selector:
component: minio
---
apiVersion: batch/v1
kind: Job
metadata:
namespace: minio
name: minio-setup
labels:
component: minio
spec:
template:
metadata:
name: minio-setup
spec:
restartPolicy: OnFailure
volumes:
- name: config
emptyDir: {}
containers:
- name: mc
image: minio/mc:latest
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- "mc --config-dir=/config config host add velero http://minio:9000 minio minio123 && mc --config-dir=/config mb -p velero/velero"
volumeMounts:
- name: config
mountPath: "/config"