diff --git a/kubernetes-templates/guestbook/0/frontend-controller.yaml b/kubernetes-templates/guestbook/0/frontend-controller.yaml new file mode 100644 index 0000000..3f8a16a --- /dev/null +++ b/kubernetes-templates/guestbook/0/frontend-controller.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + name: ${FRONTEND_NAME} + labels: + name: ${FRONTEND_NAME} +spec: + replicas: ${FRONTEND_REPLICAS} + selector: + name: ${FRONTEND_NAME} + template: + metadata: + labels: + name: ${FRONTEND_NAME} + spec: + containers: + - name: php-redis + image: gcr.io/google_samples/gb-frontend:v3 + env: + - name: GET_HOSTS_FROM + value: dns + # If your cluster config does not include a dns service, then to + # instead access environment variables to find service host + # info, comment out the 'value: dns' line above, and uncomment the + # line below. + # value: env + ports: + - containerPort: 80 diff --git a/kubernetes-templates/guestbook/0/frontend-service.yaml b/kubernetes-templates/guestbook/0/frontend-service.yaml new file mode 100644 index 0000000..09bddf2 --- /dev/null +++ b/kubernetes-templates/guestbook/0/frontend-service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: ${SERVICE_NAME} + labels: + name: ${SERVICE_NAME} +spec: + # if your cluster supports it, uncomment the following to automatically create + # an external load-balanced IP for the frontend service. + type: LoadBalancer + ports: + # the port that this service should serve on + - port: "${SERVICE_PORT}" + selector: + name: ${FRONTEND_NAME} diff --git a/kubernetes-templates/guestbook/0/rancher-compose.yml b/kubernetes-templates/guestbook/0/rancher-compose.yml new file mode 100644 index 0000000..5ab145c --- /dev/null +++ b/kubernetes-templates/guestbook/0/rancher-compose.yml @@ -0,0 +1,25 @@ +.catalog: + name: "K8s Example Guestbook" + version: "1.0.0" + description: "It's a guestbook" + questions: + - variable: "SERVICE_NAME" + label: "Service Name" + required: true + default: "frontend" + type: "string" + - variable: "Service Port" + label: "What port to listen on" + required: true + type: "int" + default: 80 + - variable: "FRONTEND_NAME" + label: "Frontend Name" + required: true + default: "frontend" + type: "string" + - variable: "Frontend Scale" + label: "Replicas for the frontend RC" + required: true + type: "int" + default: 3 diff --git a/kubernetes-templates/guestbook/0/redis-master-controller.yaml b/kubernetes-templates/guestbook/0/redis-master-controller.yaml new file mode 100644 index 0000000..2eebf26 --- /dev/null +++ b/kubernetes-templates/guestbook/0/redis-master-controller.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + name: redis-master + labels: + name: redis-master +spec: + replicas: 1 + selector: + name: redis-master + template: + metadata: + labels: + name: redis-master + spec: + containers: + - name: master + image: redis + ports: + - containerPort: 6379 diff --git a/kubernetes-templates/guestbook/0/redis-master-service.yaml b/kubernetes-templates/guestbook/0/redis-master-service.yaml new file mode 100644 index 0000000..75144a9 --- /dev/null +++ b/kubernetes-templates/guestbook/0/redis-master-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis-master + labels: + name: redis-master +spec: + ports: + # the port that this service should serve on + - port: "6379" + targetPort: "6379" + selector: + name: redis-master diff --git a/kubernetes-templates/guestbook/0/redis-slave-controller.yaml b/kubernetes-templates/guestbook/0/redis-slave-controller.yaml new file mode 100644 index 0000000..6e5dde1 --- /dev/null +++ b/kubernetes-templates/guestbook/0/redis-slave-controller.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + name: redis-slave + labels: + name: redis-slave +spec: + replicas: 2 + selector: + name: redis-slave + template: + metadata: + labels: + name: redis-slave + spec: + containers: + - name: worker + image: gcr.io/google_samples/gb-redisslave:v1 + env: + - name: GET_HOSTS_FROM + value: dns + # If your cluster config does not include a dns service, then to + # instead access an environment variable to find the master + # service's host, comment out the 'value: dns' line above, and + # uncomment the line below. + # value: env + ports: + - containerPort: 6379 diff --git a/kubernetes-templates/guestbook/0/redis-slave-service.yaml b/kubernetes-templates/guestbook/0/redis-slave-service.yaml new file mode 100644 index 0000000..1acc9de --- /dev/null +++ b/kubernetes-templates/guestbook/0/redis-slave-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis-slave + labels: + name: redis-slave +spec: + ports: + # the port that this service should serve on + - port: 6379 + selector: + name: redis-slave diff --git a/kubernetes-templates/guestbook/catalogIcon-guestbook.png b/kubernetes-templates/guestbook/catalogIcon-guestbook.png new file mode 100644 index 0000000..d731b75 Binary files /dev/null and b/kubernetes-templates/guestbook/catalogIcon-guestbook.png differ diff --git a/kubernetes-templates/guestbook/config.yml b/kubernetes-templates/guestbook/config.yml new file mode 100644 index 0000000..f58d23d --- /dev/null +++ b/kubernetes-templates/guestbook/config.yml @@ -0,0 +1,4 @@ +name: "K8s Example Guestbook" +description: "It's a guestbook" +version: 1.0.0 +category: Test