Update examples
This commit is contained in:
@@ -7,4 +7,6 @@ This repository contains examples of how to use Fleet using different approaches
|
|||||||
| [simple](simple/) | The minimally viable repo to deploy raw Kubernetes resources |
|
| [simple](simple/) | The minimally viable repo to deploy raw Kubernetes resources |
|
||||||
| [manifest](manifest/) | A full example of using raw Kubernetes YAML and customizing it per target cluster |
|
| [manifest](manifest/) | A full example of using raw Kubernetes YAML and customizing it per target cluster |
|
||||||
| [helm](helm/) | A full example of using Helm and customizing it per target cluster |
|
| [helm](helm/) | A full example of using Helm and customizing it per target cluster |
|
||||||
| [kustomize](kustomize/) | A full example of using Kustomize and customizing it per target cluster |
|
| [helm-external](helm-external/) | A full example of using a Helm chart that is downloaded from a third party source and customizing it per target cluster |
|
||||||
|
| [kustomize](kustomize/) | A full example of using Kustomize and customizing it per target cluster |
|
||||||
|
| [helm-kustomize](helm-kustomize/) | A full example of using Kustomize to modify a third party Helm chart |
|
||||||
|
|||||||
22
helm-external/README.md
Normal file
22
helm-external/README.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# Helm External 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.
|
||||||
|
The app will be deployed into the `fleet-helm-external-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-external
|
||||||
|
namespace: fleet-local
|
||||||
|
spec:
|
||||||
|
repo: https://github.com/rancher/fleet-examples/
|
||||||
|
bundleDirs: helm-external
|
||||||
|
```
|
||||||
24
helm-external/fleet.yaml
Normal file
24
helm-external/fleet.yaml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
namespace: fleet-helm-external-example
|
||||||
|
chart: https://github.com/rancher/fleet-examples/releases/download/example/guestbook-0.0.0.tgz
|
||||||
|
targets:
|
||||||
|
- name: dev
|
||||||
|
values:
|
||||||
|
replication: false
|
||||||
|
clusterSelector:
|
||||||
|
matchLabels:
|
||||||
|
env: dev
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
values:
|
||||||
|
replicas: 3
|
||||||
|
clusterSelector:
|
||||||
|
matchLabels:
|
||||||
|
env: test
|
||||||
|
|
||||||
|
- name: prod
|
||||||
|
values:
|
||||||
|
serviceType: LoadBalancer
|
||||||
|
replicas: 3
|
||||||
|
clusterSelector:
|
||||||
|
matchLabels:
|
||||||
|
env: prod
|
||||||
22
helm-kustomize/README.md
Normal file
22
helm-kustomize/README.md
Normal 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
23
helm-kustomize/fleet.yaml
Normal 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
|
||||||
3
helm-kustomize/kustomize/overlays/dev/kustomization.yaml
Normal file
3
helm-kustomize/kustomize/overlays/dev/kustomization.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
patches:
|
||||||
|
- redis-slave-deployment.yaml
|
||||||
|
- redis-slave-service.yaml
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Deployment
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: redis-slave
|
||||||
|
spec:
|
||||||
|
replicas: 0
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
kind: Service
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: redis-slave
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
role: master
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
kind: Service
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
spec:
|
||||||
|
type: LoadBalancer
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
patches:
|
||||||
|
- frontend-deployment.yaml
|
||||||
|
- frontend-service.yaml
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
patches:
|
||||||
|
- frontend-deployment.yaml
|
||||||
@@ -8,4 +8,15 @@ The application will be customized as follows per environment:
|
|||||||
|
|
||||||
* Dev clusters: Only the redis leader is deployed and not the followers.
|
* Dev clusters: Only the redis leader is deployed and not the followers.
|
||||||
* Test clusters: Scale the front deployment to 3
|
* Test clusters: Scale the front deployment to 3
|
||||||
* Prod clusters: Scale the front deployment to 3 and set the service type to LoadBalancer
|
* 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
|
||||||
|
namespace: fleet-local
|
||||||
|
spec:
|
||||||
|
repo: https://github.com/rancher/fleet-examples/
|
||||||
|
bundleDirs: helm
|
||||||
|
```
|
||||||
@@ -7,4 +7,15 @@ The application will be customized as follows per environment:
|
|||||||
|
|
||||||
* Dev clusters: Only the redis leader is deployed and not the followers.
|
* Dev clusters: Only the redis leader is deployed and not the followers.
|
||||||
* Test clusters: Scale the front deployment to 3
|
* Test clusters: Scale the front deployment to 3
|
||||||
* Prod clusters: Scale the front deployment to 3 and set the service type to LoadBalancer
|
* 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: kustomize
|
||||||
|
namespace: fleet-local
|
||||||
|
spec:
|
||||||
|
repo: https://github.com/rancher/fleet-examples/
|
||||||
|
bundleDirs: kustomize
|
||||||
|
```
|
||||||
@@ -7,4 +7,15 @@ The application will be customized as follows per environment:
|
|||||||
|
|
||||||
* Dev clusters: Only the redis leader is deployed and not the followers.
|
* Dev clusters: Only the redis leader is deployed and not the followers.
|
||||||
* Test clusters: Scale the front deployment to 3
|
* Test clusters: Scale the front deployment to 3
|
||||||
* Prod clusters: Scale the front deployment to 3 and set the service type to LoadBalancer
|
* 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: manifests
|
||||||
|
namespace: fleet-local
|
||||||
|
spec:
|
||||||
|
repo: https://github.com/rancher/fleet-examples/
|
||||||
|
bundleDirs: manifests
|
||||||
|
```
|
||||||
@@ -1,4 +1,15 @@
|
|||||||
# Simple Example
|
# Simple Example
|
||||||
|
|
||||||
This example will deploy the [Kubernetes sample guestbook](https://github.com/kubernetes/examples/tree/master/guestbook/) application.
|
This example will deploy the [Kubernetes sample guestbook](https://github.com/kubernetes/examples/tree/master/guestbook/) application.
|
||||||
The app will be deployed into the `default` namespace.
|
The app will be deployed into the `default` namespace.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
kind: GitRepo
|
||||||
|
apiVersion: fleet.cattle.io/v1alpha1
|
||||||
|
metadata:
|
||||||
|
name: simple
|
||||||
|
namespace: fleet-local
|
||||||
|
spec:
|
||||||
|
repo: https://github.com/rancher/fleet-examples/
|
||||||
|
bundleDirs: simple
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user