Help us understand the problem. What is going on with this article?

memo

More than 1 year has passed since last update.

ただのメモたぶん動かない

Docker for mac with k8s (wordpress)

https://qiita.com/yubaken/items/8023649b5c86d1b8edc2

mattermost with k8s

https://www.tmp1024.com/server/deploy-mattermost-to-kubernetes

必要ならnamespace作る

次のコマンドを実行します (YOUR_PASSWORD は適当なパスフレーズで置き換えてください)

kubectl create secret generic mysql --from-literal=password=YOUR_PASSWORD

namespace作ってたら以下のコマンド

kubectl -n myname create secret generic mysql --from-literal=password=YOUR_PASSWORD

mattermost-service.yaml

apiVersion: v1
kind: Service
metadata:
  labels:
    app: mattermost
  name: mattermost
spec:
  type: LoadBalancer
  ports:
    - port: 8065
      targetPort: 8065
      protocol: TCP
  selector:
    app: mattermost

### mattermost.yaml     
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: mattermost
  labels:
    app: mattermost
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mattermost
  template:
    metadata:
      labels:
        app: mattermost
    spec:
      containers:
        - image: mattermost/mattermost-preview
          name: mattermost
          env:
          - name: MATTERMOST_DB_HOST
            value: mysql:3306
          - name: MATTERMOST_DB_PASSWORD
            valueFrom:
              secretKeyRef:
                name: mysql
                key: password
          ports:
            - containerPort: 80
              name: mattermost
 #          volumeMounts:
 #            - name: mattermost-persistent-storage
 #              mountPath: /var/www/html
 #      volumes:
 #        - name: mattermost-persistent-storage
 #          persistentVolumeClaim:
 #            claimName: mattermost-volumeclaim

mysql-service.yaml

apiVersion: v1
kind: Service
metadata:
  name: mysql
  labels:
    app: mysql
spec:
  type: ClusterIP
  ports:
    - port: 3306
  selector:
    app: mysql

mysql.yaml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: mysql
  labels:
    app: mysql
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mysql
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
        - image: mysql:5.6
          name: mysql
          env:
            - name: MYSQL_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysql
                  key: password
          ports:
            - containerPort: 3306
              name: mysql
 #          volumeMounts:
 #            - name: mysql-persistent-storage
 #              mountPath: /var/lib/mysql
 #      volumes:
 #        - name: mysql-persistent-storage
 #          persistentVolumeClaim:
 #            claimName: mysql-volumeclaim
petaexazettayotta
ただの備忘
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away