kubernetes / examples

Kubernetes application example tutorials
Apache License 2.0
6.21k stars 4.54k forks source link

How to access MariaDB(StatefulSets) from outside the cluster #439

Closed udupicloud closed 2 years ago

udupicloud commented 2 years ago

Hi Everyone,

Things that I need to work with the StatefulSet pods I want to create a Production grade MariaDB Galera v10.6.5 cluster with Kubernetes (v1.19 -v1.23) and will use the Persistence Ceph Storage. Also I need that to be CentOS8 or CentOS Stream 8. Pods created via StatefulSets should be accessible via SSH service from outside the cluster.

Things that I have tried

  1. I am able to create a StatefulSet with MariaDB Galera and Ceph as a PVC.
  2. I have no issue with the deployment method single replica pods.
  3. I am able to ssh to the pods in Deployment and do necessary changes and able to run the commands of service like systemctl status MariaDB ,HTTPD.
  4. I have tried to expose each pods with MetalLB load balancer. Also tried default NodePort and LoadBalancer. Able to access the pods with no deport but again how will the nginx or apache access it to store its data to MariaDB. Ref : https://github.com/cgruver/mariadb-galera-okd Ref : https://severalnines.com/database-blog/running-galera-cluster-kubernetes

Note:- I need the StatefulSet pods to be accessible via SSH from outside the cluster. I should be able to use that pods for systemd commands to work for any applications that supports.

Basically I need help to create a yaml file for my requirements. Any help for the same would be of great help.

Thanking all in advance.

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-ci-robot commented 2 years ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes/examples/issues/439#issuecomment-1181635900): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues and PRs according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue or PR with `/reopen` >- Mark this issue or PR as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.