Update examples

This commit is contained in:
Darren Shepherd
2020-08-31 23:29:55 -07:00
parent 56bca25f64
commit 3614aa139d
17 changed files with 181 additions and 5 deletions

22
helm-kustomize/README.md Normal file
View File

@@ -0,0 +1,22 @@
# Helm Kustomize Example
This example will deploy the [Kubernetes sample guestbook](https://github.com/kubernetes/examples/tree/master/guestbook/) application as
packaged as a Helm chart downloaded from a third party source and will modify the helm chart using Kustomize.
The app will be deployed into the `fleet-helm-kustomize-example` namespace.
The application will be customized as follows per environment:
* Dev clusters: Only the redis leader is deployed and not the followers.
* Test clusters: Scale the front deployment to 3
* Prod clusters: Scale the front deployment to 3 and set the service type to LoadBalancer
```yaml
kind: GitRepo
apiVersion: fleet.cattle.io/v1alpha1
metadata:
name: helm-kustomize
namespace: fleet-local
spec:
repo: https://github.com/rancher/fleet-examples/
bundleDirs: helm-kustomize
```

23
helm-kustomize/fleet.yaml Normal file
View File

@@ -0,0 +1,23 @@
namespace: fleet-helm-kustomize-example
chart: https://github.com/rancher/fleet-examples/releases/download/example/guestbook-0.0.0.tgz
targets:
- name: dev
clusterSelector:
matchLabels:
env: dev
# NOTE: This directory is always relative to ./kustomize
kustomizeDir: overlays/dev
- name: test
clusterSelector:
matchLabels:
env: test
# NOTE: This directory is always relative to ./kustomize
kustomizeDir: overlays/test
- name: prod
clusterSelector:
matchLabels:
env: prod
# NOTE: This directory is always relative to ./kustomize
kustomizeDir: overlays/prod

View File

@@ -0,0 +1,3 @@
patches:
- redis-slave-deployment.yaml
- redis-slave-service.yaml

View File

@@ -0,0 +1,6 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: redis-slave
spec:
replicas: 0

View File

@@ -0,0 +1,7 @@
kind: Service
apiVersion: v1
metadata:
name: redis-slave
spec:
selector:
role: master

View File

@@ -0,0 +1,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
replicas: 3

View File

@@ -0,0 +1,6 @@
kind: Service
apiVersion: v1
metadata:
name: frontend
spec:
type: LoadBalancer

View File

@@ -0,0 +1,3 @@
patches:
- frontend-deployment.yaml
- frontend-service.yaml

View File

@@ -0,0 +1,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
replicas: 3

View File

@@ -0,0 +1,2 @@
patches:
- frontend-deployment.yaml