Skip to content

Commit

Permalink
Merge pull request #187 from stefanprodan/release-6.1.2
Browse files Browse the repository at this point in the history
Release 6.1.2
  • Loading branch information
stefanprodan authored Apr 11, 2022
2 parents c1fd17e + 8179263 commit 203f7e1
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 52 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ version-set:
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/webapp/backend/deployment.yaml && \
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/frontend/deployment.yaml && \
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/backend/deployment.yaml && \
/usr/bin/sed -i '' "s/tag:\(\s*\)$$current/tag:\1$$next/g" cue/main.cue && \
/usr/bin/sed -i '' "s/$$current/$$next/g" cue/main.cue && \
echo "Version $$next set in code, deployment, chart and kustomize"

release:
Expand All @@ -89,3 +89,8 @@ release:
swagger:
go get github.com/swaggo/swag/cmd/swag
cd pkg/api && $$(go env GOPATH)/bin/swag init -g server.go

.PHONY: cue
cue:
@cd cue && cue fmt ./... && cue vet --all-errors --concrete ./...
@cd cue && cue gen
4 changes: 2 additions & 2 deletions charts/podinfo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
version: 6.1.1
appVersion: 6.1.1
version: 6.1.2
appVersion: 6.1.2
name: podinfo
engine: gotpl
description: Podinfo Helm chart for Kubernetes
Expand Down
2 changes: 1 addition & 1 deletion charts/podinfo/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ backends: []

image:
repository: ghcr.io/stefanprodan/podinfo
tag: 6.1.1
tag: 6.1.2
pullPolicy: IfNotPresent

ui:
Expand Down
2 changes: 1 addition & 1 deletion charts/podinfo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ backends: []

image:
repository: ghcr.io/stefanprodan/podinfo
tag: 6.1.1
tag: 6.1.2
pullPolicy: IfNotPresent

ui:
Expand Down
2 changes: 1 addition & 1 deletion cue/cue.mod/module.cue
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module: "github.com/stefanprodan/podinfo/cuelang"
module: "github.com/stefanprodan/podinfo/cue"
2 changes: 1 addition & 1 deletion cue/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/stefanprodan/podinfo/cuelang
module github.com/stefanprodan/podinfo/cue

go 1.17

Expand Down
14 changes: 9 additions & 5 deletions cue/main.cue
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
package main

import (
podinfo "github.com/stefanprodan/podinfo/cuelang/podinfo"
podinfo "github.com/stefanprodan/podinfo/cue/podinfo"
)

resources: (podinfo.#Application & {
input: {
meta: {
name: "podinfo"
annotations: {
"app.kubernetes.io/name": "podinfo"
"app.kubernetes.io/part-of": "podinfo"
}
}
image: {
repository: "ghcr.io/stefanprodan/podinfo"
tag: "6.0.3"
tag: "6.1.2"
}
service: {
grpcPort: 6666
resources: requests: cpu: "100m"
hpa: {
enabled: true
minReplicas: 2
maxReplicas: 4
cpu: 99
}
}
}).out
4 changes: 0 additions & 4 deletions cue/podinfo/app.cue
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package podinfo

#selectorLabels: {
"app.kubernetes.io/name": "podinfo"
}

#Application: {
input: #Config
out: {
Expand Down
9 changes: 3 additions & 6 deletions cue/podinfo/config.cue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import (
tag: string
pullPolicy: *"IfNotPresent" | string
}
selectorLabels: {
"app.kubernetes.io/name": meta.name
}
replicas: *1 | int
service: #serviceConfig
host: string
Expand Down Expand Up @@ -43,12 +46,6 @@ import (
nodeSelector: {[ string]: string}
affinity: corev1.#Affinity
tolerations: [ ...corev1.#Toleration]
linkerd: {
enabled: *false | bool
}
redis: {
enabled: *false | bool
}
tls: {
enabled: *false | bool
port: *9899 | int
Expand Down
13 changes: 10 additions & 3 deletions cue/podinfo/deployment.cue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import (
type: "RollingUpdate"
rollingUpdate: maxUnavailable: 1
}
selector: matchLabels: #selectorLabels
selector: matchLabels: _config.selectorLabels
template: {
metadata: {
labels: #selectorLabels
labels: _config.selectorLabels
annotations: {
"prometheus.io/scrape": "true"
"prometheus.io/port": "\(_config.service.httpPort)"
"prometheus.io/port": "\(_config.service.metricsPort)"
_config.podAnnotations
}
}
Expand All @@ -41,6 +41,8 @@ import (
command: [
"./podinfo",
"--port=\(_config.service.httpPort)",
"--port-metrics=\(_config.service.metricsPort)",
"--grpc-port=\(_config.service.grpcPort)",
"--level=\(_config.logLevel)",
"--random-delay=\(_config.faults.delay)",
"--random-error=\(_config.faults.error)",
Expand All @@ -56,6 +58,11 @@ import (
containerPort: _config.service.metricsPort
protocol: "TCP"
},
{
name: "grpc"
containerPort: _config.service.grpcPort
protocol: "TCP"
},
]
livenessProbe: {
exec: {
Expand Down
45 changes: 26 additions & 19 deletions cue/podinfo/hpa.cue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

#hpaConfig: {
enabled: *false | bool
cpu: int
memory: string
cpu: *0 | int
memory: *"" | string
minReplicas: int
maxReplicas: int
}
Expand All @@ -25,24 +25,31 @@ import (
}
minReplicas: _config.hpa.minReplicas
maxReplicas: _config.hpa.maxReplicas
metrics: [ {
type: "Resource"
resource: {
name: "cpu"
target: {
type: "Utilization"
averageUtilization: _config.hpa.cpu
metrics: [
if _config.hpa.cpu > 0 {
{
type: "Resource"
resource: {
name: "cpu"
target: {
type: "Utilization"
averageUtilization: _config.hpa.cpu
}
}
}
}
}, {
type: "Resource"
resource: {
name: "memory"
target: {
type: "AverageValue"
averageValue: _config.hpa.memory
},
if _config.hpa.memory != "" {
{
type: "Resource"
resource: {
name: "memory"
target: {
type: "AverageValue"
averageValue: _config.hpa.memory
}
}
}
}
}]
},
]
}
}
2 changes: 1 addition & 1 deletion cue/podinfo/service.cue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
metadata: _config.meta
spec: corev1.#ServiceSpec & {
type: "ClusterIP"
selector: #selectorLabels
selector: _config.selectorLabels
ports: [{
name: "http"
port: _config.service.externalPort
Expand Down
2 changes: 1 addition & 1 deletion cue/podinfo/servicemonitor.cue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ package podinfo
interval: _config.serviceMonitor.interval
}]
namespaceSelector: matchNames: _config.meta.namespace
selector: matchLabels: #selectorLabels
selector: matchLabels: _config.selectorLabels
}
}
2 changes: 1 addition & 1 deletion deploy/bases/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
spec:
containers:
- name: backend
image: ghcr.io/stefanprodan/podinfo:6.1.1
image: ghcr.io/stefanprodan/podinfo:6.1.2
imagePullPolicy: IfNotPresent
ports:
- name: http
Expand Down
2 changes: 1 addition & 1 deletion deploy/bases/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
spec:
containers:
- name: frontend
image: ghcr.io/stefanprodan/podinfo:6.1.1
image: ghcr.io/stefanprodan/podinfo:6.1.2
imagePullPolicy: IfNotPresent
ports:
- name: http
Expand Down
2 changes: 1 addition & 1 deletion deploy/webapp/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
serviceAccountName: webapp
containers:
- name: backend
image: ghcr.io/stefanprodan/podinfo:6.1.1
image: ghcr.io/stefanprodan/podinfo:6.1.2
imagePullPolicy: IfNotPresent
ports:
- name: http
Expand Down
2 changes: 1 addition & 1 deletion deploy/webapp/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
serviceAccountName: webapp
containers:
- name: frontend
image: ghcr.io/stefanprodan/podinfo:6.1.1
image: ghcr.io/stefanprodan/podinfo:6.1.2
imagePullPolicy: IfNotPresent
ports:
- name: http
Expand Down
2 changes: 1 addition & 1 deletion kustomize/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
spec:
containers:
- name: podinfod
image: ghcr.io/stefanprodan/podinfo:6.1.1
image: ghcr.io/stefanprodan/podinfo:6.1.2
imagePullPolicy: IfNotPresent
ports:
- name: http
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package version

var VERSION = "6.1.1"
var VERSION = "6.1.2"
var REVISION = "unknown"

0 comments on commit 203f7e1

Please sign in to comment.