linux怎么查看本机内存大小
326
2022-09-11
k8s安装phpmyadmin
背景
K8s里面的Mysql服务需要开放给维护人员使用,通过ingress配置转发tcp流量也是可以,这里提供一种使用phpmyadmin通过web页面访问的方法
将phpmyadmin的配置文件下载下来放在本地
cat config.inc.php
创建configmap导入配置文件
kubectl -n test create configmap config.inc.php --from-file=/deploy/sorts/phpmyadmin/config.inc.php
编辑yml文件创建ingress、service、deploy资源
kind: Deployment apiVersion: apps/v1 metadata: name: phpmyadmin namespace: test spec: replicas: 1 selector: matchLabels: app: phpmyadmin template: metadata: labels: app: phpmyadmin spec: containers: - name: phpmyadmin image: phpmyadmin env: - name: PMA_HOST value: mysql - name: PMA_ARBITRARY value: "1" ports: - containerPort: 80 protocol: TCP volumeMounts: - mountPath: /etc/phpmyadmin/config.inc.php name: config-inc-php subPath: config.inc.php volumes: - name: config-inc-php configMap: name: config.inc.php --- kind: Service apiVersion: v1 metadata: name: phpmyadmin namespace: test labels: name: phpmyadmin spec: type: NodePort ports: - protocol: TCP nodePort: 31003 targetPort: 80 port: 80 selector: app: phpmyadmin --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-phpmyadmin namespace: test spec: ingressClassName: nginx rules: - host: phpmyadmin.test.com http: paths: - backend: service: name: phpmyadmin port: number: 80 path: / pathType: ImplementationSpecific
PS
需要注意的是环境变量需要配置PMA_ARBITRARY=1,代表使用任意数据库
使用
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~