├── README.md ├── bootstrap ├── flux-system │ └── .gitkeep ├── helmrepositories │ └── helmrepository-podinfo.yaml ├── kustomizations │ └── kustomization-podinfo.yaml └── namespaces │ └── namespace-podinfo.yaml └── podinfo ├── configmap-podinfo-helm-chart-value-overrides.yaml └── helmrelease-podinfo.yaml /README.md: -------------------------------------------------------------------------------- 1 | This template repo is used to illustrate a [flux-managed Kubernetes cluster](http://localhost:8123/kubernetes/deployment/flux/), in Funky Penguin's Geek Cookbook -------------------------------------------------------------------------------- /bootstrap/flux-system/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geek-cookbook/template-flux/7b4e2dbf3f5c1ebbc026824586eefafa5f5f39d0/bootstrap/flux-system/.gitkeep -------------------------------------------------------------------------------- /bootstrap/helmrepositories/helmrepository-podinfo.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: source.toolkit.fluxcd.io/v1beta1 3 | kind: HelmRepository 4 | metadata: 5 | name: podinfo 6 | namespace: flux-system 7 | spec: 8 | interval: 15m 9 | url: https://stefanprodan.github.io/podinfo -------------------------------------------------------------------------------- /bootstrap/kustomizations/kustomization-podinfo.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.toolkit.fluxcd.io/v1beta1 2 | kind: Kustomization 3 | metadata: 4 | name: podinfo 5 | namespace: flux-system 6 | spec: 7 | interval: 15m 8 | path: podinfo 9 | prune: true # remove any elements later removed from the above path 10 | timeout: 2m # if not set, this defaults to interval duration, which is 1h 11 | sourceRef: 12 | kind: GitRepository 13 | name: flux-system 14 | validation: server 15 | healthChecks: 16 | - apiVersion: apps/v1 17 | kind: Deployment 18 | name: podinfo 19 | namespace: podinfo 20 | -------------------------------------------------------------------------------- /bootstrap/namespaces/namespace-podinfo.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: podinfo 5 | -------------------------------------------------------------------------------- /podinfo/configmap-podinfo-helm-chart-value-overrides.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | creationTimestamp: null 5 | name: podinfo-helm-chart-value-overrides 6 | namespace: podinfo 7 | data: 8 | values.yaml: |- 9 | # Default values for podinfo. 10 | 11 | replicaCount: 1 12 | logLevel: info 13 | host: #0.0.0.0 14 | backend: #http://backend-podinfo:9898/echo 15 | backends: [] 16 | 17 | image: 18 | repository: ghcr.io/stefanprodan/podinfo 19 | tag: 6.0.3 20 | pullPolicy: IfNotPresent 21 | 22 | ui: 23 | color: "#34577c" 24 | message: "👋 Greetings, fellow geek!" 25 | logo: "https://geek-cookbook.funkypenguin.co.nz/images/site-logo.svg" 26 | 27 | # failure conditions 28 | faults: 29 | delay: false 30 | error: false 31 | unhealthy: false 32 | unready: false 33 | testFail: false 34 | testTimeout: false 35 | 36 | # Kubernetes Service settings 37 | service: 38 | enabled: true 39 | annotations: {} 40 | type: ClusterIP 41 | metricsPort: 9797 42 | httpPort: 9898 43 | externalPort: 9898 44 | grpcPort: 9999 45 | grpcService: podinfo 46 | nodePort: 31198 47 | # the port used to bind the http port to the host 48 | # NOTE: requires privileged container with NET_BIND_SERVICE capability -- this is useful for testing 49 | # in local clusters such as kind without port forwarding 50 | hostPort: 51 | 52 | # enable h2c protocol (non-TLS version of HTTP/2) 53 | h2c: 54 | enabled: false 55 | 56 | # enable tls on the podinfo service 57 | tls: 58 | enabled: false 59 | # the name of the secret used to mount the certificate key pair 60 | secretName: 61 | # the path where the certificate key pair will be mounted 62 | certPath: /data/cert 63 | # the port used to host the tls endpoint on the service 64 | port: 9899 65 | # the port used to bind the tls port to the host 66 | # NOTE: requires privileged container with NET_BIND_SERVICE capability -- this is useful for testing 67 | # in local clusters such as kind without port forwarding 68 | hostPort: 69 | 70 | # create a certificate manager certificate (cert-manager required) 71 | certificate: 72 | create: false 73 | # the issuer used to issue the certificate 74 | issuerRef: 75 | kind: ClusterIssuer 76 | name: self-signed 77 | # the hostname / subject alternative names for the certificate 78 | dnsNames: 79 | - podinfo 80 | 81 | # metrics-server add-on required 82 | hpa: 83 | enabled: false 84 | maxReplicas: 10 85 | # average total CPU usage per pod (1-100) 86 | cpu: 87 | # average memory usage per pod (100Mi-1Gi) 88 | memory: 89 | # average http requests per second per pod (k8s-prometheus-adapter) 90 | requests: 91 | 92 | # Redis address in the format : 93 | cache: "" 94 | # Redis deployment 95 | redis: 96 | enabled: false 97 | repository: redis 98 | tag: 6.0.8 99 | 100 | serviceAccount: 101 | # Specifies whether a service account should be created 102 | enabled: false 103 | # The name of the service account to use. 104 | # If not set and create is true, a name is generated using the fullname template 105 | name: 106 | 107 | # set container security context 108 | securityContext: {} 109 | 110 | ingress: 111 | enabled: false 112 | className: "" 113 | annotations: {} 114 | # kubernetes.io/ingress.class: nginx 115 | # kubernetes.io/tls-acme: "true" 116 | hosts: 117 | - host: podinfo.local 118 | paths: 119 | - path: / 120 | pathType: ImplementationSpecific 121 | tls: [] 122 | # - secretName: chart-example-tls 123 | # hosts: 124 | # - chart-example.local 125 | 126 | linkerd: 127 | profile: 128 | enabled: false 129 | 130 | # create Prometheus Operator monitor 131 | serviceMonitor: 132 | enabled: false 133 | interval: 15s 134 | additionalLabels: {} 135 | 136 | resources: 137 | limits: 138 | requests: 139 | cpu: 1m 140 | memory: 16Mi 141 | 142 | nodeSelector: {} 143 | 144 | tolerations: [] 145 | 146 | affinity: {} 147 | 148 | podAnnotations: {} 149 | 150 | -------------------------------------------------------------------------------- /podinfo/helmrelease-podinfo.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: helm.toolkit.fluxcd.io/v2beta1 2 | kind: HelmRelease 3 | metadata: 4 | name: podinfo 5 | namespace: podinfo 6 | spec: 7 | chart: 8 | spec: 9 | chart: podinfo 10 | version: 6.x 11 | sourceRef: 12 | kind: HelmRepository 13 | name: podinfo 14 | namespace: flux-system 15 | interval: 15m 16 | timeout: 5m 17 | releaseName: podinfo 18 | valuesFrom: 19 | - kind: ConfigMap 20 | name: podinfo-helm-chart-value-overrides 21 | valuesKey: values.yaml # This is the default, but best to be explicit for clarity --------------------------------------------------------------------------------