Created
December 8, 2020 15:47
-
-
Save jmrobles/088a0b3ed579200d06f8af28db7cd58e to your computer and use it in GitHub Desktop.
micro-setup.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Namespace | |
apiVersion: v1 | |
metadata: | |
name: micro | |
--- | |
kind: PersistentVolume | |
apiVersion: v1 | |
metadata: | |
name: store-pv | |
namespace: micro | |
labels: | |
project: micro | |
spec: | |
claimRef: | |
name: store-pvc | |
namespace: micro | |
storageClassName: hcloud-volumes | |
capacity: | |
storage: 3Gi | |
accessModes: | |
- ReadWriteOnce | |
hostPath: | |
path: "/data" | |
--- | |
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: store-pvc | |
namespace: micro | |
labels: | |
project: micro | |
spec: | |
storageClassName: hcloud-volumes | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: | |
storage: 2Gi | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: micro | |
namespace: micro | |
labels: | |
project: micro | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: micro | |
namespace: micro | |
labels: | |
project: micro | |
rules: | |
- apiGroups: | |
- "" | |
resources: | |
- pods | |
- pods/log | |
- services | |
- secrets | |
- namespaces | |
verbs: | |
- get | |
- create | |
- update | |
- delete | |
- list | |
- patch | |
- watch | |
- apiGroups: | |
- "apps" | |
resources: | |
- deployments | |
verbs: | |
- create | |
- update | |
- delete | |
- list | |
- patch | |
- watch | |
- apiGroups: | |
- "" | |
resources: | |
- secrets | |
- pods | |
- pods/logs | |
verbs: | |
- get | |
- watch | |
- list | |
- apiGroups: | |
- "networking.k8s.io" | |
resources: | |
- networkpolicy | |
- networkpolicies | |
verbs: | |
- get | |
- create | |
- update | |
- delete | |
- deletecollection | |
- list | |
- patch | |
- watch | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: micro | |
namespace: micro | |
labels: | |
project: micro | |
subjects: | |
- kind: ServiceAccount | |
name: micro | |
namespace: micro | |
roleRef: | |
kind: ClusterRole | |
name: micro | |
apiGroup: rbac.authorization.k8s.io | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: RoleBinding | |
metadata: | |
name: micro | |
namespace: micro | |
labels: | |
project: micro | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: micro | |
subjects: | |
- kind: ServiceAccount | |
name: micro | |
--- | |
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
namespace: micro | |
name: micro | |
labels: | |
project: micro | |
spec: | |
template: | |
spec: | |
serviceAccountName: micro | |
containers: | |
- name: micro | |
env: | |
- name: MICRO_PROFILE | |
value: kubernetes | |
- name: MICRO_PROXY | |
value: "network.micro.svc.cluster.local:8443" | |
- name: MICRO_SERVER_IMAGE | |
value: micro/micro:latest | |
args: | |
- server | |
image: micro/micro | |
imagePullPolicy: Always | |
volumeMounts: | |
- mountPath: "/store" | |
name: store-mount | |
volumes: | |
- name: store-mount | |
persistentVolumeClaim: | |
claimName: store-pvc | |
restartPolicy: OnFailure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment