diff --git a/simple_recipes/pg.yml b/simple_recipes/pg.yml new file mode 100644 index 0000000000000000000000000000000000000000..371c3695b343f433394d2f5f916d24fbccda0f90 --- /dev/null +++ b/simple_recipes/pg.yml @@ -0,0 +1,67 @@ +apiVersion: v1 +kind: secret +metadata: + name: postgres-config + labels: + app: postgres +data: + POSTGRES_PASSWORD: xxx +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: postgres-pv-claim + labels: + app: postgres +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: postgres + labels: + app: postgres +spec: + selector: + matchLabels: + app: postgres + replicas: 1 + template: + metadata: + labels: + app: postgres + spec: + containers: + - name: postgres + image: postgres:13 + imagePullPolicy: "IfNotPresent" + ports: + - containerPort: 5432 + envFrom: + - configMapRef: + name: postgres-config + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: postgredb + subPath: postgres + volumes: + - name: postgredb + persistentVolumeClaim: + claimName: postgres-pv-claim +--- +apiVersion: v1 +kind: Service +metadata: + name: postgres + labels: + app: postgres +spec: + ports: + - port: 5432 + selector: + app: postgres \ No newline at end of file diff --git a/simple_recipes/redis.yml b/simple_recipes/redis.yml new file mode 100644 index 0000000000000000000000000000000000000000..c83c4f65de658887ae59fab55a8114ef9b19c78c --- /dev/null +++ b/simple_recipes/redis.yml @@ -0,0 +1,42 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: redis + name: simple-redis +spec: + replicas: 1 + selector: + matchLabels: + app: redis + template: + metadata: + labels: + app: redis + spec: + containers: + - image: redis:6.2.6 + name: master + ports: + - containerPort: 6379 + protocol: TCP + resources: + requests: + cpu: 100m + memory: 100M +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: redis + name: simple-redis +spec: + ports: + - port: 6379 + protocol: TCP + targetPort: 6379 + selector: + app: redis + type: ClusterIP