sidecar deployment
This commit is contained in:
parent
7c12b05791
commit
3469a4c436
10 changed files with 173 additions and 110 deletions
|
@ -12,21 +12,21 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
apiVersion: networking.istio.io/v1alpha3
|
# apiVersion: networking.istio.io/v1alpha3
|
||||||
kind: Gateway
|
# kind: Gateway
|
||||||
metadata:
|
# metadata:
|
||||||
name: frontend-gateway
|
# name: frontend-gateway
|
||||||
spec:
|
# spec:
|
||||||
selector:
|
# selector:
|
||||||
istio: ingressgateway # use Istio default gateway implementation
|
# istio: ingressgateway # use Istio default gateway implementation
|
||||||
servers:
|
# servers:
|
||||||
- port:
|
# - port:
|
||||||
number: 80
|
# number: 80
|
||||||
name: http
|
# name: http
|
||||||
protocol: HTTP
|
# protocol: HTTP
|
||||||
hosts:
|
# hosts:
|
||||||
- "*"
|
# - "*"
|
||||||
---
|
# ---
|
||||||
apiVersion: networking.istio.io/v1alpha3
|
apiVersion: networking.istio.io/v1alpha3
|
||||||
kind: VirtualService
|
kind: VirtualService
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -35,7 +35,7 @@ spec:
|
||||||
hosts:
|
hosts:
|
||||||
- "*"
|
- "*"
|
||||||
gateways:
|
gateways:
|
||||||
- frontend-gateway
|
- ingressgateway.istio-system
|
||||||
http:
|
http:
|
||||||
- route:
|
- route:
|
||||||
- destination:
|
- destination:
|
||||||
|
|
|
@ -18376,12 +18376,27 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: prometheus
|
serviceAccountName: prometheus
|
||||||
containers:
|
containers:
|
||||||
|
- name: sidecar
|
||||||
|
image: gcr.io/stackdriver-prometheus/stackdriver-prometheus-sidecar:0.7.3
|
||||||
|
args:
|
||||||
|
- "--stackdriver.project-id=tonyh-gke-o11y-anz-openbanking"
|
||||||
|
- "--prometheus.wal-directory=/data/wal"
|
||||||
|
- "--prometheus.api-address=http://127.0.0.1:9090"
|
||||||
|
- "--stackdriver.kubernetes.location=australia-southeast1"
|
||||||
|
- "--stackdriver.kubernetes.cluster-name=o11y-ob"
|
||||||
|
ports:
|
||||||
|
- name: sidecar
|
||||||
|
containerPort: 9091
|
||||||
|
volumeMounts:
|
||||||
|
- name: data-volume
|
||||||
|
mountPath: /data
|
||||||
- name: prometheus
|
- name: prometheus
|
||||||
image: "docker.io/prom/prometheus:v2.12.0"
|
image: "docker.io/prom/prometheus:v2.12.0"
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
args:
|
args:
|
||||||
- '--storage.tsdb.retention=6h'
|
- '--storage.tsdb.retention=6h'
|
||||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||||
|
- '--storage.tsdb.path=/data'
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9090
|
- containerPort: 9090
|
||||||
name: http
|
name: http
|
||||||
|
@ -18398,11 +18413,15 @@ spec:
|
||||||
cpu: 10m
|
cpu: 10m
|
||||||
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
- name: data-volume
|
||||||
|
mountPath: /data
|
||||||
- name: config-volume
|
- name: config-volume
|
||||||
mountPath: /etc/prometheus
|
mountPath: /etc/prometheus
|
||||||
- mountPath: /etc/istio-certs
|
- mountPath: /etc/istio-certs
|
||||||
name: istio-certs
|
name: istio-certs
|
||||||
volumes:
|
volumes:
|
||||||
|
- name: data-volume
|
||||||
|
emptyDir: {}
|
||||||
- name: config-volume
|
- name: config-volume
|
||||||
configMap:
|
configMap:
|
||||||
name: prometheus
|
name: prometheus
|
||||||
|
|
|
@ -39,7 +39,7 @@ spec:
|
||||||
# - name: DISABLE_TRACING
|
# - name: DISABLE_TRACING
|
||||||
# value: "1"
|
# value: "1"
|
||||||
- name: JAEGER_SERVICE_ADDR
|
- name: JAEGER_SERVICE_ADDR
|
||||||
value: "jaeger-collector:14268"
|
value: "jaeger-collector.istio-sysem.svc:14268"
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 200m
|
cpu: 200m
|
||||||
|
|
|
@ -58,7 +58,7 @@ spec:
|
||||||
# - name: DISABLE_PROFILER
|
# - name: DISABLE_PROFILER
|
||||||
# value: "1"
|
# value: "1"
|
||||||
- name: JAEGER_SERVICE_ADDR
|
- name: JAEGER_SERVICE_ADDR
|
||||||
value: "jaeger-collector:14268"
|
value: "jaeger-collector.istio-sysem.svc:14268"
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|
|
@ -70,7 +70,7 @@ spec:
|
||||||
# - name: DISABLE_PROFILER
|
# - name: DISABLE_PROFILER
|
||||||
# value: "1"
|
# value: "1"
|
||||||
- name: JAEGER_SERVICE_ADDR
|
- name: JAEGER_SERVICE_ADDR
|
||||||
value: "jaeger-collector:14268"
|
value: "jaeger-collector.istio-sysem.svc:14268"
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|
|
@ -41,7 +41,7 @@ spec:
|
||||||
# - name: DISABLE_PROFILER
|
# - name: DISABLE_PROFILER
|
||||||
# value: "1"
|
# value: "1"
|
||||||
- name: JAEGER_SERVICE_ADDR
|
- name: JAEGER_SERVICE_ADDR
|
||||||
value: "jaeger-collector:14268"
|
value: "jaeger-collector.istio-sysem.svc:14268"
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
exec:
|
exec:
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:3550"]
|
command: ["/bin/grpc_health_probe", "-addr=:3550"]
|
||||||
|
|
|
@ -40,7 +40,7 @@ spec:
|
||||||
- name: DISABLE_PROFILER
|
- name: DISABLE_PROFILER
|
||||||
value: "1"
|
value: "1"
|
||||||
- name: JAEGER_SERVICE_ADDR
|
- name: JAEGER_SERVICE_ADDR
|
||||||
value: "jaeger-collector:14268"
|
value: "jaeger-collector.istio-sysem.svc:14268"
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
exec:
|
exec:
|
||||||
|
|
|
@ -91,16 +91,16 @@ spec:
|
||||||
- name: http
|
- name: http
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: 8080
|
targetPort: 8080
|
||||||
---
|
# ---
|
||||||
apiVersion: v1
|
# apiVersion: v1
|
||||||
kind: Service
|
# kind: Service
|
||||||
metadata:
|
# metadata:
|
||||||
name: frontend-external
|
# name: frontend-external
|
||||||
spec:
|
# spec:
|
||||||
type: LoadBalancer
|
# type: LoadBalancer
|
||||||
selector:
|
# selector:
|
||||||
app: frontend
|
# app: frontend
|
||||||
ports:
|
# ports:
|
||||||
- name: http
|
# - name: http
|
||||||
port: 80
|
# port: 80
|
||||||
targetPort: 8080
|
# targetPort: 8080
|
||||||
|
|
45
patch.sh
Executable file
45
patch.sh
Executable file
|
@ -0,0 +1,45 @@
|
||||||
|
#!/bin/sh
|
||||||
|
KUBE_NAMESPACE=istio-system
|
||||||
|
KUBE_CLUSTER=o11y-ob
|
||||||
|
GCP_REGION=australia-southeast1
|
||||||
|
GCP_PROJECT=tonyh-gke-o11y-anz-openbanking
|
||||||
|
DATA_DIR=/data
|
||||||
|
DATA_VOLUME=data-volume
|
||||||
|
SIDECAR_IMAGE_TAG=0.7.3
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo -e "Usage: $0 <deployment|statefulset> <name>\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# -le 1 ]; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Override to use a different Docker image name for the sidecar.
|
||||||
|
export SIDECAR_IMAGE_NAME=${SIDECAR_IMAGE_NAME:-'gcr.io/stackdriver-prometheus/stackdriver-prometheus-sidecar'}
|
||||||
|
|
||||||
|
kubectl -n "${KUBE_NAMESPACE}" patch "$1" "$2" --type strategic --patch "
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: sidecar
|
||||||
|
image: ${SIDECAR_IMAGE_NAME}:${SIDECAR_IMAGE_TAG}
|
||||||
|
imagePullPolicy: Always
|
||||||
|
args:
|
||||||
|
- \"--stackdriver.project-id=${GCP_PROJECT}\"
|
||||||
|
- \"--prometheus.wal-directory=${DATA_DIR}/wal\"
|
||||||
|
- \"--stackdriver.kubernetes.location=${GCP_REGION}\"
|
||||||
|
- \"--stackdriver.kubernetes.cluster-name=${KUBE_CLUSTER}\"
|
||||||
|
#- \"--stackdriver.generic.location=${GCP_REGION}\"
|
||||||
|
#- \"--stackdriver.generic.namespace=${KUBE_CLUSTER}\"
|
||||||
|
ports:
|
||||||
|
- name: sidecar
|
||||||
|
containerPort: 9091
|
||||||
|
volumeMounts:
|
||||||
|
- name: ${DATA_VOLUME}
|
||||||
|
mountPath: ${DATA_DIR}
|
||||||
|
"
|
|
@ -85,5 +85,4 @@ profiles:
|
||||||
deploy:
|
deploy:
|
||||||
kubectl:
|
kubectl:
|
||||||
manifests:
|
manifests:
|
||||||
- ./kubernetes-manifests/**.yaml
|
- ./kubernetes-manifests-tracing/**.yaml
|
||||||
- ./istio-manifests/**.yaml
|
|
Loading…
Add table
Add a link
Reference in a new issue