Browse Source

Principalmente añado mattermost

main
Celestino Rey 2 years ago
parent
commit
256993c180
26 changed files with 8124 additions and 2 deletions
  1. +315
    -0
      HelmCharts/WeaveScope/k8s-scope.yaml
  2. +248
    -0
      HelmCharts/WeaveScope/rancher.yaml
  3. +23
    -0
      HelmCharts/hammond-chart/.helmignore
  4. +24
    -0
      HelmCharts/hammond-chart/Chart.yaml
  5. +81
    -0
      HelmCharts/hammond-chart/templates/hammond-deployment.yaml
  6. +23
    -0
      HelmCharts/hammond-chart/templates/pv-local-hammond.yaml
  7. +16
    -0
      HelmCharts/instala
  8. +1
    -1
      HelmCharts/wordpress-chart/templates/pv-local-mysql.yaml
  9. +1
    -1
      HelmCharts/wordpress-chart/templates/pv-local-wordpress.yaml
  10. +0
    -0
      K8S-dashboard/CrearDashboard.sh
  11. +12
    -0
      K8S-dashboard/cluster-role.yaml
  12. +2
    -0
      K8S-dashboard/recommended.yaml
  13. +5
    -0
      K8S-dashboard/service-account.yaml
  14. +6
    -0
      Mattermost/creaTodo.sh
  15. +82
    -0
      Mattermost/mattermost-deployment.yaml
  16. +17
    -0
      Mattermost/mm-service.yaml
  17. +86
    -0
      Mattermost/mysql-deployment-mm.yaml
  18. +6
    -0
      Mattermost/paraTodo.sh
  19. +12
    -0
      Mattermost/pv-local-mattermost.yaml
  20. +11
    -0
      Mattermost/pv-local-mysql-mm.yaml
  21. +12
    -0
      Mattermost/secrets.yaml
  22. +13
    -0
      Mattermost/temp/mattermost-installation.yaml
  23. +7036
    -0
      Mattermost/temp/mattermost-operator.yaml
  24. +71
    -0
      Mattermost/temp/mysql-deployment-mm.yaml
  25. +10
    -0
      Mattermost/temp/mysqlmm-secret.yaml
  26. +11
    -0
      Mattermost/temp/pv-local-mysql-mm.yaml

+ 315
- 0
HelmCharts/WeaveScope/k8s-scope.yaml View File

@ -0,0 +1,315 @@
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Namespace
metadata:
name: weave
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
name: weave-scope
name: weave-scope
namespace: weave
rules:
- apiGroups:
- ""
resources:
- pods
- pods/log
- replicationcontrollers
- services
- namespaces
- persistentvolumes
- persistentvolumeclaims
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- delete
- apiGroups:
- apps
resources:
- deployments
- statefulsets
- daemonsets
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- daemonsets
- deployments
- deployments/scale
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- deployments/scale
verbs:
- update
- apiGroups:
- apps
resources:
- deployments/scale
verbs:
- get
- update
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
verbs:
- list
- watch
- apiGroups:
- extensions
resourceNames:
- weave-scope
resources:
- podsecuritypolicies
verbs:
- use
- apiGroups:
- volumesnapshot.external-storage.k8s.io
resources:
- volumesnapshots
- volumesnapshotdatas
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- update
- patch
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: weave-scope
labels:
name: weave-scope
namespace: weave
roleRef:
kind: ClusterRole
name: weave-scope
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: weave-scope
namespace: weave
- apiVersion: apps/v1
kind: Deployment
metadata:
name: weave-scope-app
labels:
name: weave-scope-app
app: weave-scope
weave-cloud-component: scope
weave-scope-component: app
namespace: weave
spec:
replicas: 1
selector:
matchLabels:
app: weave-scope
revisionHistoryLimit: 2
template:
metadata:
labels:
name: weave-scope-app
app: weave-scope
weave-cloud-component: scope
weave-scope-component: app
spec:
containers:
- name: app
args:
- '--no-probe'
env: [ ]
image: weaveworks/scope:1.13.2
imagePullPolicy: IfNotPresent
ports:
- containerPort: 4040
protocol: TCP
resources:
requests:
cpu: 200m
memory: 200Mi
- apiVersion: apps/v1
kind: DaemonSet
metadata:
name: weave-scope-agent
labels:
name: weave-scope-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: agent
namespace: weave
spec:
minReadySeconds: 5
selector:
matchLabels:
app: weave-scope
template:
metadata:
labels:
name: weave-scope-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: agent
spec:
containers:
- name: scope-agent
args:
- '--mode=probe'
- '--probe-only'
- '--probe.kubernetes.role=host'
- '--probe.docker.bridge=docker0'
- '--probe.docker=true'
- 'weave-scope-app.weave.svc.cluster.local.:80'
env:
- name: SCOPE_HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: weaveworks/scope:1.13.2
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 100m
memory: 100Mi
securityContext:
privileged: true
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
- name: scope-plugins
mountPath: /var/run/scope/plugins
- name: sys-kernel-debug
mountPath: /sys/kernel/debug
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
hostPID: true
tolerations:
- effect: NoSchedule
operator: Exists
volumes:
- name: docker-socket
hostPath:
path: /var/run/docker.sock
- name: scope-plugins
hostPath:
path: /var/run/scope/plugins
- name: sys-kernel-debug
hostPath:
path: /sys/kernel/debug
updateStrategy:
rollingUpdate:
maxUnavailable: 1
- apiVersion: apps/v1
kind: Deployment
metadata:
name: weave-scope-cluster-agent
labels:
name: weave-scope-cluster-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: cluster-agent
namespace: weave
spec:
replicas: 1
selector:
matchLabels:
name: weave-scope-cluster-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: cluster-agent
revisionHistoryLimit: 2
template:
metadata:
labels:
name: weave-scope-cluster-agent
app: weave-scope
weave-cloud-component: scope
weave-scope-component: cluster-agent
spec:
containers:
- name: scope-cluster-agent
args:
- '--mode=probe'
- '--probe-only'
- '--probe.kubernetes.role=cluster'
- 'weave-scope-app.weave.svc.cluster.local.:80'
command:
- /home/weave/scope
image: 'docker.io/weaveworks/scope:1.13.2'
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
- name: scope-plugins
mountPath: /var/run/scope/plugins
serviceAccountName: weave-scope
volumes:
- name: scope-plugins
hostPath:
path: /var/run/scope/plugins
- apiVersion: v1
kind: ServiceAccount
metadata:
name: weave-scope
labels:
name: weave-scope
namespace: weave
- apiVersion: v1
kind: Service
metadata:
name: weave-scope-app
labels:
name: weave-scope-app
app: weave-scope
weave-cloud-component: scope
weave-scope-component: app
namespace: weave
spec:
type: NodePort
ports:
- name: app
port: 80
nodePort: 30481
protocol: TCP
targetPort: 4040
selector:
name: weave-scope-app
app: weave-scope
weave-cloud-component: scope
weave-scope-component: app

+ 248
- 0
HelmCharts/WeaveScope/rancher.yaml View File

@ -0,0 +1,248 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: proxy-clusterrole-kubeapiserver
rules:
- apiGroups: [""]
resources:
- nodes/metrics
- nodes/proxy
- nodes/stats
- nodes/log
- nodes/spec
verbs: ["get", "list", "watch", "create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: proxy-role-binding-kubernetes-master
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: proxy-clusterrole-kubeapiserver
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: kube-apiserver
---
apiVersion: v1
kind: Namespace
metadata:
name: cattle-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: cattle
namespace: cattle-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cattle-admin-binding
namespace: cattle-system
labels:
cattle.io/creator: "norman"
subjects:
- kind: ServiceAccount
name: cattle
namespace: cattle-system
roleRef:
kind: ClusterRole
name: cattle-admin
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Secret
metadata:
name: cattle-credentials-80151d8
namespace: cattle-system
type: Opaque
data:
url: "aHR0cHM6Ly9rOHMtc2VydmVy"
token: "azR0Nzk2ZDZjc2dka3pyOXJ3MjR2dDdwZzlzNW16bG45dzRxNWQ3d2w2bHZsdHY0Y3RoMjU4"
namespace: ""
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cattle-admin
labels:
cattle.io/creator: "norman"
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- '*'
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cattle-cluster-agent
namespace: cattle-system
spec:
selector:
matchLabels:
app: cattle-cluster-agent
template:
metadata:
labels:
app: cattle-cluster-agent
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/controlplane
operator: In
values:
- "true"
- weight: 1
preference:
matchExpressions:
- key: node-role.kubernetes.io/etcd
operator: In
values:
- "true"
serviceAccountName: cattle
tolerations:
- operator: Exists
containers:
- name: cluster-register
imagePullPolicy: IfNotPresent
env:
- name: CATTLE_FEATURES
value: ""
- name: CATTLE_SERVER
value: "https://k8s-server"
- name: CATTLE_CA_CHECKSUM
value: "80133263142ecf49684f5a72e13c9ac613fce40afb85514123875530b55704dd"
- name: CATTLE_CLUSTER
value: "true"
- name: CATTLE_K8S_MANAGED
value: "true"
image: rancher/rancher-agent:v2.4.18
volumeMounts:
- name: cattle-credentials
mountPath: /cattle-credentials
readOnly: true
volumes:
- name: cattle-credentials
secret:
secretName: cattle-credentials-80151d8
defaultMode: 320
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: cattle-node-agent
namespace: cattle-system
spec:
selector:
matchLabels:
app: cattle-agent
template:
metadata:
labels:
app: cattle-agent
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
hostNetwork: true
serviceAccountName: cattle
tolerations:
- operator: Exists
containers:
- name: agent
image: rancher/rancher-agent:v2.4.18
imagePullPolicy: IfNotPresent
env:
- name: CATTLE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: CATTLE_SERVER
value: "https://k8s-server"
- name: CATTLE_CA_CHECKSUM
value: "80133263142ecf49684f5a72e13c9ac613fce40afb85514123875530b55704dd"
- name: CATTLE_CLUSTER
value: "false"
- name: CATTLE_K8S_MANAGED
value: "true"
- name: CATTLE_AGENT_CONNECT
value: "true"
volumeMounts:
- name: cattle-credentials
mountPath: /cattle-credentials
readOnly: true
- name: k8s-ssl
mountPath: /etc/kubernetes
- name: var-run
mountPath: /var/run
- name: run
mountPath: /run
- name: docker-certs
mountPath: /etc/docker/certs.d
securityContext:
privileged: true
volumes:
- name: k8s-ssl
hostPath:
path: /etc/kubernetes
type: DirectoryOrCreate
- name: var-run
hostPath:
path: /var/run
type: DirectoryOrCreate
- name: run
hostPath:
path: /run
type: DirectoryOrCreate
- name: cattle-credentials
secret:
secretName: cattle-credentials-80151d8
defaultMode: 320
- hostPath:
path: /etc/docker/certs.d
type: DirectoryOrCreate
name: docker-certs
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%

+ 23
- 0
HelmCharts/hammond-chart/.helmignore View File

@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

+ 24
- 0
HelmCharts/hammond-chart/Chart.yaml View File

@ -0,0 +1,24 @@
apiVersion: v2
name: hammond-chart
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"

+ 81
- 0
HelmCharts/hammond-chart/templates/hammond-deployment.yaml View File

@ -0,0 +1,81 @@
apiVersion: v1
kind: Service
metadata:
name: hammond
spec:
type: NodePort
ports:
- name: http
port: 3000
nodePort: 30081
targetPort: hammond-http
selector:
app: hammond
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: hammond-assets-claim
labels:
app: hammond
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: hammond-config-claim
labels:
app: hammond
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hammond
labels:
app: hammond
spec:
selector:
matchLabels:
app: hammond
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: hammond
tier: frontend
spec:
containers:
- name: hammond
image: akhilrex/hammond
ports:
- containerPort: 3000
name: "hammond-http"
volumeMounts:
- name: hammond-assets-folder
mountPath: /assets
- name: hammond-config-folder
mountPath: /config
imagePullSecrets:
- name: reg-cred-secret
volumes:
- name: hammond-assets-folder
persistentVolumeClaim:
claimName: hammond-assets-claim
- name: hammond-config-folder
persistentVolumeClaim:
claimName: hammond-config-claim

+ 23
- 0
HelmCharts/hammond-chart/templates/pv-local-hammond.yaml View File

@ -0,0 +1,23 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: hammond-assets-folder
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/Externo/hammond/assets"
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: hammond-config-folder
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/Externo/hammond/config"

+ 16
- 0
HelmCharts/instala View File

@ -0,0 +1,16 @@
#!/bin/bash
if [ -z "$1" ]
then
echo "Falta nombre del chart"
else
if [ "$2" = "i" ]
then
helm install $1 ./$1-chart --namespace=$1 --create-namespace
elif [ "$2" = "u" ]
then
helm uninstall $1 -n $1
else
echo "Falta comando: i=instalar, u=desinstalar"
fi
fi

+ 1
- 1
HelmCharts/wordpress-chart/templates/pv-local-mysql.yaml View File

@ -8,4 +8,4 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/wordpress/wordpress-db"
path: "/mnt/Externo/wordpress/wordpress-db"

+ 1
- 1
HelmCharts/wordpress-chart/templates/pv-local-wordpress.yaml View File

@ -8,5 +8,5 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: "/mnt/cluster/wordpress/wordpress-wp"
path: "/mnt/Externo/wordpress/wordpress-wp"

K8S-dashboard/CrearDashboard.txt → K8S-dashboard/CrearDashboard.sh View File


+ 12
- 0
K8S-dashboard/cluster-role.yaml View File

@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard

+ 2
- 0
K8S-dashboard/recommended.yaml View File

@ -37,8 +37,10 @@ metadata:
name: kubernetes-dashboard name: kubernetes-dashboard
namespace: kubernetes-dashboard namespace: kubernetes-dashboard
spec: spec:
type: NodePort
ports: ports:
- port: 443 - port: 443
nodePort: 30481
targetPort: 8443 targetPort: 8443
selector: selector:
k8s-app: kubernetes-dashboard k8s-app: kubernetes-dashboard


+ 5
- 0
K8S-dashboard/service-account.yaml View File

@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard

+ 6
- 0
Mattermost/creaTodo.sh View File

@ -0,0 +1,6 @@
kubectl create -f pv-local-mattermost.yaml
kubectl create -f pv-local-mysql-mm.yaml
kubectl create -f secrets.yaml
kubectl create -f mm-service.yaml
kubectl create -f mysql-deployment-mm.yaml
kubectl create -f mattermost-deployment.yaml

+ 82
- 0
Mattermost/mattermost-deployment.yaml View File

@ -0,0 +1,82 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mm-pv-claim
namespace: mattermost
labels:
app: mattermost
spec:
accessModes:
- ReadWriteOnce
storageClassName: ""
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mattermost
namespace: mattermost
labels:
app: mattermost
spec:
selector:
matchLabels:
app: mattermost
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: mattermost
tier: frontend
spec:
containers:
- image: "mattermost/mattermost-team-edition:6.3.2"
name: mattermost
env:
- name: DB_TYPE
value: mariadb
- name: DB_HOST
value: mattermost-mariadb
- name: DB_PORT_NUMBER
value: "3306"
- name: MM_USERNAME
valueFrom:
secretKeyRef:
name: mattermost.env
key: USER
- name: MM_PASSWORD
valueFrom:
secretKeyRef:
name: mattermost.env
key: PASSWORD
- name: MM_DBNAME
valueFrom:
secretKeyRef:
name: mattermost.env
key: DATABASE
- name: MM_SQLSETTINGS_DATASOURCE
value: "mattermost:Dsa-0213@tcp(mattermost-mariadb:3306)/mattermost?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s"
- name: MM_SQLSETTINGS_DRIVERNAME
value: "mysql"
ports:
- containerPort: 8065
name: mattermost
volumeMounts:
- name: mattermost-persistent-storage
mountPath: /mattermost/data
- name: etclocaltime
mountPath: /etc/localtime
readOnly: true
imagePullSecrets:
- name: reg-cred-secret
volumes:
- name: mattermost-persistent-storage
persistentVolumeClaim:
claimName: mm-pv-claim
- name: etclocaltime
hostPath:
path: /etc/localtime

+ 17
- 0
Mattermost/mm-service.yaml View File

@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: mattermost
namespace: mattermost
labels:
app: mattermost
spec:
type: NodePort
ports:
- name: http
port: 8065
nodePort: 30099
targetPort: mattermost
selector:
app: mattermost
tier: frontend

+ 86
- 0
Mattermost/mysql-deployment-mm.yaml View File

@ -0,0 +1,86 @@
apiVersion: v1
kind: Service
metadata:
name: mattermost-mariadb
namespace: mattermost
labels:
app: mattermost
spec:
ports:
- name: mariadb
port: 3306
targetPort: mariadb
selector:
app: mattermost
tier: mariadb
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-mm-pv-claim
namespace: mattermost
labels:
app: mattermost
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mattermost-mariadb
namespace: mattermost
labels:
app: mattermost
spec:
selector:
matchLabels:
app: mattermost
tier: mariadb
strategy:
type: Recreate
template:
metadata:
labels:
app: mattermost
tier: mariadb
spec:
containers:
- image: docker-registry:32000/mariadb:1.0
name: mariadb
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mattermost.env
key: ROOT_PASSWORD
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: mattermost.env
key: DATABASE
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mattermost.env
key: USER
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mattermost.env
key: PASSWORD
ports:
- containerPort: 3306
name: mariadb
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
imagePullSecrets:
- name: reg-cred-secret
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-mm-pv-claim

+ 6
- 0
Mattermost/paraTodo.sh View File

@ -0,0 +1,6 @@
kubectl delete -f mattermost-deployment.yaml
kubectl delete -f mm-service.yaml
kubectl delete -f mysql-deployment-mm.yaml
kubectl delete -f pv-local-mattermost.yaml
kubectl delete -f pv-local-mysql-mm.yaml
kubectl delete -f secrets.yaml

+ 12
- 0
Mattermost/pv-local-mattermost.yaml View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: mm-folder
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/mattermost/mattermost"

+ 11
- 0
Mattermost/pv-local-mysql-mm.yaml View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: mm-data
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/Externo/mattermost/db"

+ 12
- 0
Mattermost/secrets.yaml View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: mattermost.env
namespace: mattermost
type: Opaque
data:
ROOT: cm9vdA==
ROOT_PASSWORD: RHNhLTAyMTM=
DATABASE: bWF0dGVybW9zdA==
USER: bWF0dGVybW9zdA==
PASSWORD: RHNhLTAyMTM=

+ 13
- 0
Mattermost/temp/mattermost-installation.yaml View File

@ -0,0 +1,13 @@
apiVersion: installation.mattermost.com/v1beta1
kind: Mattermost
metadata:
name: mattermost # Chose the desired name
spec:
size: 100users # Adjust to your requirements
ingress:
enabled: true
host: k8s-server # Adjust to your domain
annotations:
kubernetes.io/ingress.class: nginx
version: 6.0.1
licenseSecret: "" # If you have created secret in step 1, put its name here

+ 7036
- 0
Mattermost/temp/mattermost-operator.yaml
File diff suppressed because it is too large
View File


+ 71
- 0
Mattermost/temp/mysql-deployment-mm.yaml View File

@ -0,0 +1,71 @@
apiVersion: v1
kind: Service
metadata:
name: mattermost-mysql
namespace: mattermost
labels:
app: mattermost
spec:
ports:
- name: mysql
port: 3306
targetPort: mysql
selector:
app: mattermost
tier: mysql
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-mm-pv-claim
namespace: mattermost
labels:
app: mattermost
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mattermost-mysql
namespace: mattermost
labels:
app: mattermost
spec:
selector:
matchLabels:
app: mattermost
tier: mysql
strategy:
type: Recreate
template:
metadata:
labels:
app: mattermost
tier: mysql
spec:
containers:
- image: docker-registry:32000/mariadb:1.0
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysqlmm-pass
key: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
imagePullSecrets:
- name: reg-cred-secret
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-mm-pv-claim

+ 10
- 0
Mattermost/temp/mysqlmm-secret.yaml View File

@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: mysqlmm-pass
namespace: mattermost
type: Opaque
data:
db_user: root
db_passwd: RHNhLTAyMTM=
password: RHNhLTAyMTM=

+ 11
- 0
Mattermost/temp/pv-local-mysql-mm.yaml View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: mm-data
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/cluster/mattermost/mattermost-db"

Loading…
Cancel
Save