mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-04-09 20:46:51 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
306aac3e65 | ||
|
|
55318b0c20 | ||
|
|
1865faf7ce | ||
|
|
9edd7abbe8 | ||
|
|
1c4acc0b33 | ||
|
|
6274f16b9b | ||
|
|
93e338a964 | ||
|
|
73b03b77fc | ||
|
|
0135757fbd | ||
|
|
ea1fe87d49 |
4
Makefile
4
Makefile
@@ -57,6 +57,10 @@ version-set:
|
|||||||
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/podinfo/Chart.yaml && \
|
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/podinfo/Chart.yaml && \
|
||||||
sed -i '' "s/version: $$current/version: $$next/g" charts/podinfo/Chart.yaml && \
|
sed -i '' "s/version: $$current/version: $$next/g" charts/podinfo/Chart.yaml && \
|
||||||
sed -i '' "s/podinfo:$$current/podinfo:$$next/g" kustomize/deployment.yaml && \
|
sed -i '' "s/podinfo:$$current/podinfo:$$next/g" kustomize/deployment.yaml && \
|
||||||
|
sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/webapp/frontend/deployment.yaml && \
|
||||||
|
sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/webapp/backend/deployment.yaml && \
|
||||||
|
sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/frontend/deployment.yaml && \
|
||||||
|
sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/backend/deployment.yaml && \
|
||||||
echo "Version $$next set in code, deployment, chart and kustomize"
|
echo "Version $$next set in code, deployment, chart and kustomize"
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
version: 3.2.2
|
version: 3.2.3
|
||||||
appVersion: 3.2.2
|
appVersion: 3.2.3
|
||||||
name: podinfo
|
name: podinfo
|
||||||
engine: gotpl
|
engine: gotpl
|
||||||
description: Podinfo Helm chart for Kubernetes
|
description: Podinfo Helm chart for Kubernetes
|
||||||
|
|||||||
@@ -29,48 +29,53 @@ The command removes all the Kubernetes components associated with the chart and
|
|||||||
|
|
||||||
The following tables lists the configurable parameters of the podinfo chart and their default values.
|
The following tables lists the configurable parameters of the podinfo chart and their default values.
|
||||||
|
|
||||||
Parameter | Description | Default
|
Parameter | Default | Description
|
||||||
--- | --- | ---
|
--- | --- | ---
|
||||||
`affinity` | node/pod affinities | None
|
`replicaCount` | `1` | Desired number of pods
|
||||||
`backend` | echo backend URL | None
|
`logLevel` | `info` | Log level: `debug`, `info`, `warn`, `error`, `flat` or `panic`
|
||||||
`backends` | echo backend URL array | None
|
`backend` | `None` | Echo backend URL
|
||||||
`faults.delay` | random HTTP response delays between 0 and 5 seconds | `false`
|
`backends` | `[]` | Array of echo backend URLs
|
||||||
`faults.error` | 1/3 chances of a random HTTP response error | `false`
|
`ui.color` | `#34577c` | UI color
|
||||||
`faults.unhealthy` | when set, the healthy state is never reached | `false`
|
`ui.message` | `None` | UI greetings message
|
||||||
`faults.unready` | when set, the ready state is never reached | `false`
|
`ui.logo` | `None` | UI logo
|
||||||
`hpa.enabled` | enables HPA | `false`
|
`faults.delay` | `false` | Random HTTP response delays between 0 and 5 seconds
|
||||||
`hpa.cpu` | target CPU usage per pod | None
|
`faults.error` | `false` | 1/3 chances of a random HTTP response error
|
||||||
`hpa.memory` | target memory usage per pod | None
|
`faults.unhealthy` | `false` | When set, the healthy state is never reached
|
||||||
`hpa.requests` | target requests per second per pod | None
|
`faults.unready` | `false` | When set, the ready state is never reached
|
||||||
`hpa.maxReplicas` | maximum pod replicas | `10`
|
`h2c.enabled` | `false` | Allow upgrading to h2c
|
||||||
`image.pullPolicy` | image pull policy | `IfNotPresent`
|
`image.repository` | `stefanprodan/podinfo` | Image repository
|
||||||
`image.repository` | image repository | `stefanprodan/podinfo`
|
`image.tag` | `<VERSION>` | Image tag
|
||||||
`image.tag` | image tag | `<VERSION>`
|
`image.pullPolicy` | `IfNotPresent` | Image pull policy
|
||||||
`ingress.enabled` | enables ingress | `false`
|
`service.enabled` | `true` | Create a Kubernetes Service, should be disabled when using [Flagger](https://flagger.app)
|
||||||
`ingress.annotations` | ingress annotations | None
|
`service.type` | `ClusterIP` | Type of the Kubernetes Service
|
||||||
`ingress.hosts` | ingress accepted hostnames | None
|
`service.metricsPort` | `9797` | Prometheus metrics endpoint port
|
||||||
`ingress.tls` | ingress TLS configuration | None
|
`service.httpPort` | `9898` | Container HTTP port
|
||||||
`message` | UI greetings message | None
|
`service.externalPort` | `9898` | ClusterIP HTTP port
|
||||||
`nodeSelector` | node labels for pod assignment | `{}`
|
`service.grpcPort` | `9999` | ClusterIP gPRC port
|
||||||
`replicaCount` | desired number of pods | `2`
|
`service.grpcService` | `podinfo` | gPRC service name
|
||||||
`resources.requests/cpu` | pod CPU request | `1m`
|
`service.nodePort` | `31198` | NodePort for the HTTP endpoint
|
||||||
`resources.requests/memory` | pod memory request | `16Mi`
|
`hpa.enabled` | `false` | Enables the Kubernetes HPA
|
||||||
`resources.limits/cpu` | pod CPU limit | None
|
`hpa.maxReplicas` | `10` | Maximum amount of pods
|
||||||
`resources.limits/memory` | pod memory limit | None
|
`hpa.cpu` | `None` | Target CPU usage per pod
|
||||||
`service.enabled` | create Kubernetes service (should be disabled when using Flagger) | `true`
|
`hpa.memory` | `None` | Target memory usage per pod
|
||||||
`service.metricsPort` | Prometheus metrics endpoint port | `9797`
|
`hpa.requests` | `None` | Target HTTP requests per second per pod
|
||||||
`service.externalPort` | ClusterIP HTTP port | `9898`
|
`serviceAccount.enabled` | `false` | Whether a service account should be created
|
||||||
`service.httpPort` | container HTTP port | `9898`
|
`serviceAccount.name` | `None` | The name of the service account to use, if not set and create is true, a name is generated using the fullname template
|
||||||
`service.nodePort` | NodePort for the HTTP endpoint | `31198`
|
`linkerd.profile.enabled` | `false` | Create Linkerd service profile
|
||||||
`service.grpcPort` | ClusterIP gPRC port | `9999`
|
`serviceMonitor.enabled` | `false` | Whether a Prometheus Operator service monitor should be created
|
||||||
`service.grpcService` | gPRC service name | `podinfo`
|
`serviceMonitor.interval` | `15s` | Prometheus scraping interval
|
||||||
`service.type` | type of service | `ClusterIP`
|
`ingress.enabled` | `false` | Enables Ingress
|
||||||
`tolerations` | list of node taints to tolerate | `[]`
|
`ingress.annotations` | `{}` | Ingress annotations
|
||||||
`serviceAccount.enabled` | specifies whether a service account should be created | `false`
|
`ingress.path` | `/*` | Ingress path
|
||||||
`serviceAccount.name` | the name of the service account to use, if not set and create is true, a name is generated using the fullname template | None
|
`ingress.hosts` | `[]` | Ingress accepted hosts
|
||||||
`linkerd.profile.enabled` | create Linkerd service profile | `false`
|
`ingress.tls` | `[]` | Ingress TLS configuration
|
||||||
`serviceMonitor.enabled` | specifies whether a Prometheus Operator service monitor should be created | `false`
|
`resources.requests.cpu` | `1m` | Pod CPU request
|
||||||
`serviceMonitor.interval` | Prometheus scraping interval | `15s`
|
`resources.requests.memory` | `16Mi` | Pod memory request
|
||||||
|
`resources.limits.cpu` | `None` | Pod CPU limit
|
||||||
|
`resources.limits.memory` | `None` | Pod memory limit
|
||||||
|
`nodeSelector` | `{}` | Node labels for pod assignment
|
||||||
|
`tolerations` | `[]` | List of node taints to tolerate
|
||||||
|
`affinity` | `None` | Node/pod affinities
|
||||||
|
|
||||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||||
|
|
||||||
@@ -86,5 +91,3 @@ $ helm install stable/podinfo --name my-release -f values.yaml
|
|||||||
```
|
```
|
||||||
|
|
||||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||||
```
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ h2c:
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: stefanprodan/podinfo
|
repository: stefanprodan/podinfo
|
||||||
tag: 3.2.2
|
tag: 3.2.3
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
service:
|
service:
|
||||||
|
|||||||
32
deploy/README.md
Normal file
32
deploy/README.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Deploy demo webapp
|
||||||
|
|
||||||
|
Demo webapp manifests:
|
||||||
|
- [common](webapp/common)
|
||||||
|
- [frontend](webapp/frontend)
|
||||||
|
- [backend](webapp/backend)
|
||||||
|
|
||||||
|
Deploy the demo in `webapp` namespace:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl apply -f ./webapp/common
|
||||||
|
kubectl apply -f ./webapp/backend
|
||||||
|
kubectl apply -f ./webapp/frontend
|
||||||
|
```
|
||||||
|
|
||||||
|
Deploy the demo in the `dev` namespace:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kustomize build ./overlays/dev | kubectl apply -f-
|
||||||
|
```
|
||||||
|
|
||||||
|
Deploy the demo in the `staging` namespace:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kustomize build ./overlays/staging | kubectl apply -f-
|
||||||
|
```
|
||||||
|
|
||||||
|
Deploy the demo in the `production` namespace:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kustomize build ./overlays/production | kubectl apply -f-
|
||||||
|
```
|
||||||
72
deploy/bases/backend/deployment.yaml
Normal file
72
deploy/bases/backend/deployment.yaml
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: backend
|
||||||
|
spec:
|
||||||
|
minReadySeconds: 3
|
||||||
|
revisionHistoryLimit: 5
|
||||||
|
progressDeadlineSeconds: 60
|
||||||
|
strategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: 0
|
||||||
|
type: RollingUpdate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: backend
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
prometheus.io/scrape: "true"
|
||||||
|
prometheus.io/port: "9797"
|
||||||
|
labels:
|
||||||
|
app: backend
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: backend
|
||||||
|
image: stefanprodan/podinfo:3.2.3
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 9898
|
||||||
|
protocol: TCP
|
||||||
|
- name: http-metrics
|
||||||
|
containerPort: 9797
|
||||||
|
protocol: TCP
|
||||||
|
- name: grpc
|
||||||
|
containerPort: 9999
|
||||||
|
protocol: TCP
|
||||||
|
command:
|
||||||
|
- ./podinfo
|
||||||
|
- --port=9898
|
||||||
|
- --port-metrics=9797
|
||||||
|
- --grpc-port=9999
|
||||||
|
- --grpc-service-name=backend
|
||||||
|
- --level=info
|
||||||
|
env:
|
||||||
|
- name: PODINFO_UI_COLOR
|
||||||
|
value: "#34577c"
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- podcli
|
||||||
|
- check
|
||||||
|
- http
|
||||||
|
- localhost:9898/healthz
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 5
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- podcli
|
||||||
|
- check
|
||||||
|
- http
|
||||||
|
- localhost:9898/readyz
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 5
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 2000m
|
||||||
|
memory: 512Mi
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 32Mi
|
||||||
18
deploy/bases/backend/hpa.yaml
Normal file
18
deploy/bases/backend/hpa.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: autoscaling/v2beta2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: backend
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: backend
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 2
|
||||||
|
metrics:
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: cpu
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: 99
|
||||||
7
deploy/bases/backend/kustomization.yaml
Normal file
7
deploy/bases/backend/kustomization.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- service.yaml
|
||||||
|
- deployment.yaml
|
||||||
|
- hpa.yaml
|
||||||
|
|
||||||
17
deploy/bases/backend/service.yaml
Normal file
17
deploy/bases/backend/service.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: backend
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: backend
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 9898
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: http
|
||||||
|
- port: 9999
|
||||||
|
targetPort: grpc
|
||||||
|
protocol: TCP
|
||||||
|
name: grpc
|
||||||
71
deploy/bases/frontend/deployment.yaml
Normal file
71
deploy/bases/frontend/deployment.yaml
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
spec:
|
||||||
|
minReadySeconds: 3
|
||||||
|
revisionHistoryLimit: 5
|
||||||
|
progressDeadlineSeconds: 60
|
||||||
|
strategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: 0
|
||||||
|
type: RollingUpdate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: frontend
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
prometheus.io/scrape: "true"
|
||||||
|
prometheus.io/port: "9797"
|
||||||
|
labels:
|
||||||
|
app: frontend
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: frontend
|
||||||
|
image: stefanprodan/podinfo:3.2.3
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 9898
|
||||||
|
protocol: TCP
|
||||||
|
- name: http-metrics
|
||||||
|
containerPort: 9797
|
||||||
|
protocol: TCP
|
||||||
|
- name: grpc
|
||||||
|
containerPort: 9999
|
||||||
|
protocol: TCP
|
||||||
|
command:
|
||||||
|
- ./podinfo
|
||||||
|
- --port=9898
|
||||||
|
- --port-metrics=9797
|
||||||
|
- --level=info
|
||||||
|
- --backend-url=http://backend:9898/echo
|
||||||
|
env:
|
||||||
|
- name: PODINFO_UI_COLOR
|
||||||
|
value: "#34577c"
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- podcli
|
||||||
|
- check
|
||||||
|
- http
|
||||||
|
- localhost:9898/healthz
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 5
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- podcli
|
||||||
|
- check
|
||||||
|
- http
|
||||||
|
- localhost:9898/readyz
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 5
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 128Mi
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 32Mi
|
||||||
18
deploy/bases/frontend/hpa.yaml
Normal file
18
deploy/bases/frontend/hpa.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: autoscaling/v2beta2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: backend
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 4
|
||||||
|
metrics:
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: cpu
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: 99
|
||||||
7
deploy/bases/frontend/kustomization.yaml
Normal file
7
deploy/bases/frontend/kustomization.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- service.yaml
|
||||||
|
- deployment.yaml
|
||||||
|
- hpa.yaml
|
||||||
|
|
||||||
13
deploy/bases/frontend/service.yaml
Normal file
13
deploy/bases/frontend/service.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: frontend
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: http
|
||||||
9
deploy/overlays/dev/kustomization.yaml
Normal file
9
deploy/overlays/dev/kustomization.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: dev
|
||||||
|
resources:
|
||||||
|
- ../../bases/backend
|
||||||
|
- ../../bases/frontend
|
||||||
|
- namespace.yaml
|
||||||
|
transformers:
|
||||||
|
- labels.yaml
|
||||||
10
deploy/overlays/dev/labels.yaml
Normal file
10
deploy/overlays/dev/labels.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: builtin
|
||||||
|
kind: LabelTransformer
|
||||||
|
metadata:
|
||||||
|
name: labels
|
||||||
|
labels:
|
||||||
|
env: dev
|
||||||
|
instance: webapp
|
||||||
|
fieldSpecs:
|
||||||
|
- path: metadata/labels
|
||||||
|
create: true
|
||||||
4
deploy/overlays/dev/namespace.yaml
Normal file
4
deploy/overlays/dev/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: dev
|
||||||
9
deploy/overlays/production/kustomization.yaml
Normal file
9
deploy/overlays/production/kustomization.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: production
|
||||||
|
resources:
|
||||||
|
- ../../bases/backend
|
||||||
|
- ../../bases/frontend
|
||||||
|
- namespace.yaml
|
||||||
|
transformers:
|
||||||
|
- labels.yaml
|
||||||
10
deploy/overlays/production/labels.yaml
Normal file
10
deploy/overlays/production/labels.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: builtin
|
||||||
|
kind: LabelTransformer
|
||||||
|
metadata:
|
||||||
|
name: labels
|
||||||
|
labels:
|
||||||
|
env: production
|
||||||
|
instance: webapp
|
||||||
|
fieldSpecs:
|
||||||
|
- path: metadata/labels
|
||||||
|
create: true
|
||||||
4
deploy/overlays/production/namespace.yaml
Normal file
4
deploy/overlays/production/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: production
|
||||||
9
deploy/overlays/staging/kustomization.yaml
Normal file
9
deploy/overlays/staging/kustomization.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: staging
|
||||||
|
resources:
|
||||||
|
- ../../bases/backend
|
||||||
|
- ../../bases/frontend
|
||||||
|
- namespace.yaml
|
||||||
|
transformers:
|
||||||
|
- labels.yaml
|
||||||
10
deploy/overlays/staging/labels.yaml
Normal file
10
deploy/overlays/staging/labels.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: builtin
|
||||||
|
kind: LabelTransformer
|
||||||
|
metadata:
|
||||||
|
name: labels
|
||||||
|
labels:
|
||||||
|
env: staging
|
||||||
|
instance: webapp
|
||||||
|
fieldSpecs:
|
||||||
|
- path: metadata/labels
|
||||||
|
create: true
|
||||||
4
deploy/overlays/staging/namespace.yaml
Normal file
4
deploy/overlays/staging/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: staging
|
||||||
74
deploy/webapp/backend/deployment.yaml
Normal file
74
deploy/webapp/backend/deployment.yaml
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: backend
|
||||||
|
namespace: webapp
|
||||||
|
spec:
|
||||||
|
minReadySeconds: 3
|
||||||
|
revisionHistoryLimit: 5
|
||||||
|
progressDeadlineSeconds: 60
|
||||||
|
strategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: 0
|
||||||
|
type: RollingUpdate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: backend
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
prometheus.io/scrape: "true"
|
||||||
|
prometheus.io/port: "9797"
|
||||||
|
labels:
|
||||||
|
app: backend
|
||||||
|
spec:
|
||||||
|
serviceAccountName: webapp
|
||||||
|
containers:
|
||||||
|
- name: backend
|
||||||
|
image: stefanprodan/podinfo:3.2.3
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 9898
|
||||||
|
protocol: TCP
|
||||||
|
- name: http-metrics
|
||||||
|
containerPort: 9797
|
||||||
|
protocol: TCP
|
||||||
|
- name: grpc
|
||||||
|
containerPort: 9999
|
||||||
|
protocol: TCP
|
||||||
|
command:
|
||||||
|
- ./podinfo
|
||||||
|
- --port=9898
|
||||||
|
- --port-metrics=9797
|
||||||
|
- --grpc-port=9999
|
||||||
|
- --grpc-service-name=backend
|
||||||
|
- --level=info
|
||||||
|
env:
|
||||||
|
- name: PODINFO_UI_COLOR
|
||||||
|
value: "#34577c"
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- podcli
|
||||||
|
- check
|
||||||
|
- http
|
||||||
|
- localhost:9898/healthz
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 5
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- podcli
|
||||||
|
- check
|
||||||
|
- http
|
||||||
|
- localhost:9898/readyz
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 5
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 2000m
|
||||||
|
memory: 512Mi
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 32Mi
|
||||||
19
deploy/webapp/backend/hpa.yaml
Normal file
19
deploy/webapp/backend/hpa.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: autoscaling/v2beta2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: backend
|
||||||
|
namespace: webapp
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: backend
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 2
|
||||||
|
metrics:
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: cpu
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: 99
|
||||||
18
deploy/webapp/backend/service.yaml
Normal file
18
deploy/webapp/backend/service.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: backend
|
||||||
|
namespace: webapp
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: backend
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 9898
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: http
|
||||||
|
- port: 9999
|
||||||
|
targetPort: grpc
|
||||||
|
protocol: TCP
|
||||||
|
name: grpc
|
||||||
4
deploy/webapp/common/namespace.yaml
Normal file
4
deploy/webapp/common/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: webapp
|
||||||
5
deploy/webapp/common/service-account.yaml
Normal file
5
deploy/webapp/common/service-account.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: webapp
|
||||||
|
namespace: webapp
|
||||||
73
deploy/webapp/frontend/deployment.yaml
Normal file
73
deploy/webapp/frontend/deployment.yaml
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
namespace: webapp
|
||||||
|
spec:
|
||||||
|
minReadySeconds: 3
|
||||||
|
revisionHistoryLimit: 5
|
||||||
|
progressDeadlineSeconds: 60
|
||||||
|
strategy:
|
||||||
|
rollingUpdate:
|
||||||
|
maxUnavailable: 0
|
||||||
|
type: RollingUpdate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: frontend
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
prometheus.io/scrape: "true"
|
||||||
|
prometheus.io/port: "9797"
|
||||||
|
labels:
|
||||||
|
app: frontend
|
||||||
|
spec:
|
||||||
|
serviceAccountName: webapp
|
||||||
|
containers:
|
||||||
|
- name: frontend
|
||||||
|
image: stefanprodan/podinfo:3.2.3
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 9898
|
||||||
|
protocol: TCP
|
||||||
|
- name: http-metrics
|
||||||
|
containerPort: 9797
|
||||||
|
protocol: TCP
|
||||||
|
- name: grpc
|
||||||
|
containerPort: 9999
|
||||||
|
protocol: TCP
|
||||||
|
command:
|
||||||
|
- ./podinfo
|
||||||
|
- --port=9898
|
||||||
|
- --port-metrics=9797
|
||||||
|
- --level=info
|
||||||
|
- --backend-url=http://backend:9898/echo
|
||||||
|
env:
|
||||||
|
- name: PODINFO_UI_COLOR
|
||||||
|
value: "#34577c"
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- podcli
|
||||||
|
- check
|
||||||
|
- http
|
||||||
|
- localhost:9898/healthz
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 5
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- podcli
|
||||||
|
- check
|
||||||
|
- http
|
||||||
|
- localhost:9898/readyz
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
timeoutSeconds: 5
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 128Mi
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 32Mi
|
||||||
19
deploy/webapp/frontend/hpa.yaml
Normal file
19
deploy/webapp/frontend/hpa.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: autoscaling/v2beta2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
namespace: webapp
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: backend
|
||||||
|
minReplicas: 1
|
||||||
|
maxReplicas: 4
|
||||||
|
metrics:
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: cpu
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: 99
|
||||||
14
deploy/webapp/frontend/service.yaml
Normal file
14
deploy/webapp/frontend/service.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
namespace: webapp
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: frontend
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: http
|
||||||
@@ -2,8 +2,6 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: podinfo
|
name: podinfo
|
||||||
labels:
|
|
||||||
app: podinfo
|
|
||||||
spec:
|
spec:
|
||||||
minReadySeconds: 3
|
minReadySeconds: 3
|
||||||
revisionHistoryLimit: 5
|
revisionHistoryLimit: 5
|
||||||
@@ -25,7 +23,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: podinfod
|
- name: podinfod
|
||||||
image: stefanprodan/podinfo:3.2.2
|
image: stefanprodan/podinfo:3.2.3
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
@@ -2,3 +2,6 @@ resources:
|
|||||||
- hpa.yaml
|
- hpa.yaml
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
|
|
||||||
|
commonLabels:
|
||||||
|
app: podinfo
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: podinfo
|
name: podinfo
|
||||||
labels:
|
|
||||||
app: podinfo
|
|
||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
selector:
|
selector:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package version
|
package version
|
||||||
|
|
||||||
var VERSION = "3.2.2"
|
var VERSION = "3.2.3"
|
||||||
var REVISION = "unknown"
|
var REVISION = "unknown"
|
||||||
|
|||||||
Reference in New Issue
Block a user