Update examples
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user