Jesse Suen
6 years ago
No known key found for this signature in database
GPG Key ID: 90C911E8A6106562
33 changed files with
724 additions and
0 deletions
-
sock-shop/.gitignore
-
sock-shop/app.yaml
-
sock-shop/components/carts-db-deploy.yaml
-
sock-shop/components/carts-db-svc.yaml
-
sock-shop/components/carts-deploy.yaml
-
sock-shop/components/carts-svc.yaml
-
sock-shop/components/catalogue-db-deploy.yaml
-
sock-shop/components/catalogue-db-svc.yaml
-
sock-shop/components/catalogue-deploy.yaml
-
sock-shop/components/catalogue-svc.yaml
-
sock-shop/components/front-end-deploy.yaml
-
sock-shop/components/front-end-svc.yaml
-
sock-shop/components/orders-db-deploy.yaml
-
sock-shop/components/orders-db-svc.yaml
-
sock-shop/components/orders-deploy.yaml
-
sock-shop/components/orders-svc.yaml
-
sock-shop/components/params.libsonnet
-
sock-shop/components/payment-deploy.yaml
-
sock-shop/components/payment-svc.yaml
-
sock-shop/components/queue-master-deploy.yaml
-
sock-shop/components/queue-master-svc.yaml
-
sock-shop/components/rabbitmq-deploy.yaml
-
sock-shop/components/rabbitmq-svc.yaml
-
sock-shop/components/shipping-deploy.yaml
-
sock-shop/components/shipping-svc.yaml
-
sock-shop/components/user-db-deploy.yaml
-
sock-shop/components/user-db-svc.yaml
-
sock-shop/components/user-deploy.yaml
-
sock-shop/components/user-svc.yaml
-
sock-shop/environments/base.libsonnet
-
sock-shop/environments/default/globals.libsonnet
-
sock-shop/environments/default/main.jsonnet
-
sock-shop/environments/default/params.libsonnet
|
|
@ -0,0 +1,4 @@ |
|
|
|
/lib |
|
|
|
/.ksonnet/registries |
|
|
|
/app.override.yaml |
|
|
|
/.ks_environment |
|
|
@ -0,0 +1,11 @@ |
|
|
|
apiVersion: 0.1.0 |
|
|
|
environments: |
|
|
|
default: |
|
|
|
destination: |
|
|
|
namespace: default |
|
|
|
server: https://kubernetes.default.svc |
|
|
|
k8sVersion: v1.10.0 |
|
|
|
path: default |
|
|
|
kind: ksonnet.io/app |
|
|
|
name: sock-shop |
|
|
|
version: 0.0.1 |
|
|
@ -0,0 +1,40 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: carts-db |
|
|
|
labels: |
|
|
|
name: carts-db |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: carts-db |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: carts-db |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: carts-db |
|
|
|
image: mongo |
|
|
|
ports: |
|
|
|
- name: mongo |
|
|
|
containerPort: 27017 |
|
|
|
securityContext: |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
add: |
|
|
|
- CHOWN |
|
|
|
- SETGID |
|
|
|
- SETUID |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
volumeMounts: |
|
|
|
- mountPath: /tmp |
|
|
|
name: tmp-volume |
|
|
|
volumes: |
|
|
|
- name: tmp-volume |
|
|
|
emptyDir: |
|
|
|
medium: Memory |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,13 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: carts-db |
|
|
|
labels: |
|
|
|
name: carts-db |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 27017 |
|
|
|
targetPort: 27017 |
|
|
|
selector: |
|
|
|
name: carts-db |
|
|
@ -0,0 +1,44 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: carts |
|
|
|
labels: |
|
|
|
name: carts |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: carts |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: carts |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: carts |
|
|
|
image: weaveworksdemos/carts:0.4.8 |
|
|
|
ports: |
|
|
|
- containerPort: 80 |
|
|
|
env: |
|
|
|
- name: ZIPKIN |
|
|
|
value: zipkin.jaeger.svc.cluster.local |
|
|
|
- name: JAVA_OPTS |
|
|
|
value: -Xms64m -Xmx128m -XX:PermSize=32m -XX:MaxPermSize=64m -XX:+UseG1GC -Djava.security.egd=file:/dev/urandom |
|
|
|
securityContext: |
|
|
|
runAsNonRoot: true |
|
|
|
runAsUser: 10001 |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
add: |
|
|
|
- NET_BIND_SERVICE |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
volumeMounts: |
|
|
|
- mountPath: /tmp |
|
|
|
name: tmp-volume |
|
|
|
volumes: |
|
|
|
- name: tmp-volume |
|
|
|
emptyDir: |
|
|
|
medium: Memory |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,13 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: carts |
|
|
|
labels: |
|
|
|
name: carts |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 80 |
|
|
|
targetPort: 80 |
|
|
|
selector: |
|
|
|
name: carts |
|
|
@ -0,0 +1,29 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: catalogue-db |
|
|
|
labels: |
|
|
|
name: catalogue-db |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: catalogue-db |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: catalogue-db |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: catalogue-db |
|
|
|
image: weaveworksdemos/catalogue-db:0.3.0 |
|
|
|
env: |
|
|
|
- name: MYSQL_ROOT_PASSWORD |
|
|
|
value: fake_password |
|
|
|
- name: MYSQL_DATABASE |
|
|
|
value: socksdb |
|
|
|
ports: |
|
|
|
- name: mysql |
|
|
|
containerPort: 3306 |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,13 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: catalogue-db |
|
|
|
labels: |
|
|
|
name: catalogue-db |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 3306 |
|
|
|
targetPort: 3306 |
|
|
|
selector: |
|
|
|
name: catalogue-db |
|
|
@ -0,0 +1,32 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: catalogue |
|
|
|
labels: |
|
|
|
name: catalogue |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: catalogue |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: catalogue |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: catalogue |
|
|
|
image: weaveworksdemos/catalogue:0.3.5 |
|
|
|
ports: |
|
|
|
- containerPort: 80 |
|
|
|
securityContext: |
|
|
|
runAsNonRoot: true |
|
|
|
runAsUser: 10001 |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
add: |
|
|
|
- NET_BIND_SERVICE |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,13 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: catalogue |
|
|
|
labels: |
|
|
|
name: catalogue |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 80 |
|
|
|
targetPort: 80 |
|
|
|
selector: |
|
|
|
name: catalogue |
|
|
@ -0,0 +1,32 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: front-end |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: front-end |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: front-end |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: front-end |
|
|
|
image: weaveworksdemos/front-end:0.3.12 |
|
|
|
resources: |
|
|
|
requests: |
|
|
|
cpu: 100m |
|
|
|
memory: 100Mi |
|
|
|
ports: |
|
|
|
- containerPort: 8079 |
|
|
|
securityContext: |
|
|
|
runAsNonRoot: true |
|
|
|
runAsUser: 10001 |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,14 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: front-end |
|
|
|
labels: |
|
|
|
name: front-end |
|
|
|
spec: |
|
|
|
type: LoadBalancer |
|
|
|
ports: |
|
|
|
- port: 80 |
|
|
|
targetPort: 8079 |
|
|
|
nodePort: 30001 |
|
|
|
selector: |
|
|
|
name: front-end |
|
|
@ -0,0 +1,40 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: orders-db |
|
|
|
labels: |
|
|
|
name: orders-db |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: orders-db |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: orders-db |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: orders-db |
|
|
|
image: mongo |
|
|
|
ports: |
|
|
|
- name: mongo |
|
|
|
containerPort: 27017 |
|
|
|
securityContext: |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
add: |
|
|
|
- CHOWN |
|
|
|
- SETGID |
|
|
|
- SETUID |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
volumeMounts: |
|
|
|
- mountPath: /tmp |
|
|
|
name: tmp-volume |
|
|
|
volumes: |
|
|
|
- name: tmp-volume |
|
|
|
emptyDir: |
|
|
|
medium: Memory |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,13 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: orders-db |
|
|
|
labels: |
|
|
|
name: orders-db |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 27017 |
|
|
|
targetPort: 27017 |
|
|
|
selector: |
|
|
|
name: orders-db |
|
|
@ -0,0 +1,44 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: orders |
|
|
|
labels: |
|
|
|
name: orders |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: orders |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: orders |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: orders |
|
|
|
image: weaveworksdemos/orders:0.4.7 |
|
|
|
env: |
|
|
|
- name: ZIPKIN |
|
|
|
value: zipkin.jaeger.svc.cluster.local |
|
|
|
- name: JAVA_OPTS |
|
|
|
value: -Xms64m -Xmx128m -XX:PermSize=32m -XX:MaxPermSize=64m -XX:+UseG1GC -Djava.security.egd=file:/dev/urandom |
|
|
|
ports: |
|
|
|
- containerPort: 80 |
|
|
|
securityContext: |
|
|
|
runAsNonRoot: true |
|
|
|
runAsUser: 10001 |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
add: |
|
|
|
- NET_BIND_SERVICE |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
volumeMounts: |
|
|
|
- mountPath: /tmp |
|
|
|
name: tmp-volume |
|
|
|
volumes: |
|
|
|
- name: tmp-volume |
|
|
|
emptyDir: |
|
|
|
medium: Memory |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,13 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: orders |
|
|
|
labels: |
|
|
|
name: orders |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 80 |
|
|
|
targetPort: 80 |
|
|
|
selector: |
|
|
|
name: orders |
|
|
@ -0,0 +1,36 @@ |
|
|
|
{ |
|
|
|
global: { |
|
|
|
// User-defined global parameters; accessible to all component and environments, Ex: |
|
|
|
// replicas: 4, |
|
|
|
}, |
|
|
|
components: { |
|
|
|
// Component-level parameters, defined initially from 'ks prototype use ...' |
|
|
|
// Each object below should correspond to a component in the components/ directory |
|
|
|
"carts-db-deploy": {}, |
|
|
|
"carts-db-svc": {}, |
|
|
|
"carts-deploy": {}, |
|
|
|
"carts-svc": {}, |
|
|
|
"catalogue-db-deploy": {}, |
|
|
|
"catalogue-db-svc": {}, |
|
|
|
"catalogue-deploy": {}, |
|
|
|
"catalogue-svc": {}, |
|
|
|
"front-end-deploy": {}, |
|
|
|
"front-end-svc": {}, |
|
|
|
"orders-db-deploy": {}, |
|
|
|
"orders-db-svc": {}, |
|
|
|
"orders-deploy": {}, |
|
|
|
"orders-svc": {}, |
|
|
|
"payment-deploy": {}, |
|
|
|
"payment-svc": {}, |
|
|
|
"queue-master-deploy": {}, |
|
|
|
"queue-master-svc": {}, |
|
|
|
"rabbitmq-deploy": {}, |
|
|
|
"rabbitmq-svc": {}, |
|
|
|
"shipping-deploy": {}, |
|
|
|
"shipping-svc": {}, |
|
|
|
"user-db-deploy": {}, |
|
|
|
"user-db-svc": {}, |
|
|
|
"user-deploy": {}, |
|
|
|
"user-svc": {}, |
|
|
|
}, |
|
|
|
} |
|
|
@ -0,0 +1,33 @@ |
|
|
|
|
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: payment |
|
|
|
labels: |
|
|
|
name: payment |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: payment |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: payment |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: payment |
|
|
|
image: weaveworksdemos/payment:0.4.3 |
|
|
|
ports: |
|
|
|
- containerPort: 80 |
|
|
|
securityContext: |
|
|
|
runAsNonRoot: true |
|
|
|
runAsUser: 10001 |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
add: |
|
|
|
- NET_BIND_SERVICE |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,13 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: payment |
|
|
|
labels: |
|
|
|
name: payment |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 80 |
|
|
|
targetPort: 80 |
|
|
|
selector: |
|
|
|
name: payment |
|
|
@ -0,0 +1,23 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: queue-master |
|
|
|
labels: |
|
|
|
name: queue-master |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: queue-master |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: queue-master |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: queue-master |
|
|
|
image: weaveworksdemos/queue-master:0.3.1 |
|
|
|
ports: |
|
|
|
- containerPort: 80 |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,15 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: queue-master |
|
|
|
labels: |
|
|
|
name: queue-master |
|
|
|
annotations: |
|
|
|
prometheus.io/path: "/prometheus" |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 80 |
|
|
|
targetPort: 80 |
|
|
|
selector: |
|
|
|
name: queue-master |
|
|
@ -0,0 +1,33 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: rabbitmq |
|
|
|
labels: |
|
|
|
name: rabbitmq |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: rabbitmq |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: rabbitmq |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: rabbitmq |
|
|
|
image: rabbitmq:3.6.8 |
|
|
|
ports: |
|
|
|
- containerPort: 5672 |
|
|
|
securityContext: |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
add: |
|
|
|
- CHOWN |
|
|
|
- SETGID |
|
|
|
- SETUID |
|
|
|
- DAC_OVERRIDE |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,13 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: rabbitmq |
|
|
|
labels: |
|
|
|
name: rabbitmq |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 5672 |
|
|
|
targetPort: 5672 |
|
|
|
selector: |
|
|
|
name: rabbitmq |
|
|
@ -0,0 +1,44 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: shipping |
|
|
|
labels: |
|
|
|
name: shipping |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: shipping |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: shipping |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: shipping |
|
|
|
image: weaveworksdemos/shipping:0.4.8 |
|
|
|
env: |
|
|
|
- name: ZIPKIN |
|
|
|
value: zipkin.jaeger.svc.cluster.local |
|
|
|
- name: JAVA_OPTS |
|
|
|
value: -Xms64m -Xmx128m -XX:PermSize=32m -XX:MaxPermSize=64m -XX:+UseG1GC -Djava.security.egd=file:/dev/urandom |
|
|
|
ports: |
|
|
|
- containerPort: 80 |
|
|
|
securityContext: |
|
|
|
runAsNonRoot: true |
|
|
|
runAsUser: 10001 |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
add: |
|
|
|
- NET_BIND_SERVICE |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
volumeMounts: |
|
|
|
- mountPath: /tmp |
|
|
|
name: tmp-volume |
|
|
|
volumes: |
|
|
|
- name: tmp-volume |
|
|
|
emptyDir: |
|
|
|
medium: Memory |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,13 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: shipping |
|
|
|
labels: |
|
|
|
name: shipping |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 80 |
|
|
|
targetPort: 80 |
|
|
|
selector: |
|
|
|
name: shipping |
|
|
@ -0,0 +1,40 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: user-db |
|
|
|
labels: |
|
|
|
name: user-db |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: user-db |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: user-db |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: user-db |
|
|
|
image: weaveworksdemos/user-db:0.4.0 |
|
|
|
ports: |
|
|
|
- name: mongo |
|
|
|
containerPort: 27017 |
|
|
|
securityContext: |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
add: |
|
|
|
- CHOWN |
|
|
|
- SETGID |
|
|
|
- SETUID |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
volumeMounts: |
|
|
|
- mountPath: /tmp |
|
|
|
name: tmp-volume |
|
|
|
volumes: |
|
|
|
- name: tmp-volume |
|
|
|
emptyDir: |
|
|
|
medium: Memory |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,13 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: user-db |
|
|
|
labels: |
|
|
|
name: user-db |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 27017 |
|
|
|
targetPort: 27017 |
|
|
|
selector: |
|
|
|
name: user-db |
|
|
@ -0,0 +1,35 @@ |
|
|
|
apiVersion: apps/v1 |
|
|
|
kind: Deployment |
|
|
|
metadata: |
|
|
|
name: user |
|
|
|
labels: |
|
|
|
name: user |
|
|
|
spec: |
|
|
|
replicas: 1 |
|
|
|
selector: |
|
|
|
matchLabels: |
|
|
|
name: user |
|
|
|
template: |
|
|
|
metadata: |
|
|
|
labels: |
|
|
|
name: user |
|
|
|
spec: |
|
|
|
containers: |
|
|
|
- name: user |
|
|
|
image: weaveworksdemos/user:0.4.7 |
|
|
|
ports: |
|
|
|
- containerPort: 80 |
|
|
|
env: |
|
|
|
- name: MONGO_HOST |
|
|
|
value: user-db:27017 |
|
|
|
securityContext: |
|
|
|
runAsNonRoot: true |
|
|
|
runAsUser: 10001 |
|
|
|
capabilities: |
|
|
|
drop: |
|
|
|
- all |
|
|
|
add: |
|
|
|
- NET_BIND_SERVICE |
|
|
|
readOnlyRootFilesystem: true |
|
|
|
nodeSelector: |
|
|
|
beta.kubernetes.io/os: linux |
|
|
@ -0,0 +1,14 @@ |
|
|
|
apiVersion: v1 |
|
|
|
kind: Service |
|
|
|
metadata: |
|
|
|
name: user |
|
|
|
labels: |
|
|
|
name: user |
|
|
|
namespace: sock-shop |
|
|
|
spec: |
|
|
|
ports: |
|
|
|
# the port that this service should serve on |
|
|
|
- port: 80 |
|
|
|
targetPort: 80 |
|
|
|
selector: |
|
|
|
name: user |
|
|
@ -0,0 +1,4 @@ |
|
|
|
local components = std.extVar("__ksonnet/components"); |
|
|
|
components + { |
|
|
|
// Insert user-specified overrides here. |
|
|
|
} |
|
|
@ -0,0 +1,8 @@ |
|
|
|
local base = import "base.libsonnet"; |
|
|
|
// uncomment if you reference ksonnet-lib |
|
|
|
// local k = import "k.libsonnet"; |
|
|
|
|
|
|
|
base + { |
|
|
|
// Insert user-specified overrides here. For example if a component is named \"nginx-deployment\", you might have something like:\n") |
|
|
|
// "nginx-deployment"+: k.deployment.mixin.metadata.labels({foo: "bar"}) |
|
|
|
} |
|
|
@ -0,0 +1,17 @@ |
|
|
|
local params = std.extVar("__ksonnet/params"); |
|
|
|
local globals = import "globals.libsonnet"; |
|
|
|
local envParams = params + { |
|
|
|
components +: { |
|
|
|
// Insert component parameter overrides here. Ex: |
|
|
|
// guestbook +: { |
|
|
|
// name: "guestbook-dev", |
|
|
|
// replicas: params.global.replicas, |
|
|
|
// }, |
|
|
|
}, |
|
|
|
}; |
|
|
|
|
|
|
|
{ |
|
|
|
components: { |
|
|
|
[x]: envParams.components[x] + globals, for x in std.objectFields(envParams.components) |
|
|
|
}, |
|
|
|
} |