Skip to content

Latest commit

 

History

History
71 lines (60 loc) · 1.27 KB

k8s_mysql-test.md

File metadata and controls

71 lines (60 loc) · 1.27 KB

...menustart

...menuend

create a test mysql in k8s with root/root

apiVersion: v1
items:
- apiVersion: apps/v1
  kind: Deployment
  metadata:
    labels:
      k8s-app: mysql-test
    name: mysql-test
  spec:
    replicas: 1
    selector:
      matchLabels:
        k8s-app: mysql-test
    strategy:
      type: RollingUpdate
    template:
      metadata:
        labels:
          k8s-app: mysql-test
      spec:
        containers:
        - env:
          - name: MYSQL_USER
            value: root
          - name: MYSQL_ROOT_PASSWORD
            value: root
          image: mysql:5.6
          imagePullPolicy: IfNotPresent
          name: mysql-test
          resources:
            limits:
              cpu: "1"
              memory: 1Gi
            requests:
              cpu: 100m
              memory: 128Mi
        dnsPolicy: ClusterFirst
        restartPolicy: Always

- apiVersion: v1
  kind: Service
  metadata:
    name: mysql-test
  spec:
    ports:
    - name: 3306-3306-tcp
      port: 3306
      protocol: TCP
      targetPort: 3306
    selector:
      k8s-app: mysql-test
    sessionAffinity: None
    type: ClusterIP

kind: List