Skip to content

Commit

Permalink
feat: add go-synthetic (example-app) yaml for auth example
Browse files Browse the repository at this point in the history
Signed-off-by: bwplotka <[email protected]>
  • Loading branch information
bwplotka authored and TheSpiritXIII committed Mar 28, 2024
1 parent cea558f commit a357487
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 1 deletion.
109 changes: 109 additions & 0 deletions examples/instrumentation/go-synthetic/go-synthetic-basic-auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apps/v1
kind: Deployment
metadata:
name: go-synthetic-basic-auth
spec:
replicas: 2
selector:
matchLabels:
app: "go-synthetic-basic-auth"
template:
metadata:
labels:
app: "go-synthetic-basic-auth"
spec:
containers:
- name: go-synthetic
# TODO(bwplotka): Rename image to go-synthetic (example-app is misleading, we actually use go-synthetic).
image: gke.gcr.io/prometheus-engine/example-app@sha256:40658e4aff1f5c696f08037f1cb3f3b947096e378f4cbe89fe4187de72cd9358
args:
- "--listen-address=:8080"
- "--cpu-burn-ops=75"
- "--memory-ballast-mbs=1024"
- "--basic-auth-username=me"
- "--basic-auth-password=fakepasswordusedonlyfortest"
ports:
- name: web
containerPort: 8080
resources:
requests:
cpu: 10m
memory: 16Mi
limits:
memory: 10000Mi
terminationGracePeriodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: go-synthetic-basic-auth
spec:
selector:
app: go-synthetic-basic-auth
ports:
- port: 8080
targetPort: web
---
apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
metadata:
name: go-synthetic-basic-auth
spec:
selector:
matchLabels:
app: go-synthetic-basic-auth
endpoints:
- port: 8080
interval: 15s
basicAuth:
username: me
password:
secret:
key: password
name: go-synthetic-basic-auth
---
apiVersion: v1
kind: Secret
metadata:
name: go-synthetic-basic-auth
stringData:
password: fakepasswordusedonlyfortest
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: go-synthetic-basic-auth-secret-read
rules:
- resources:
- secrets
apiGroups: [""]
verbs: ["get", "list", "watch"]
resourceNames: ["go-synthetic-basic-auth"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: gmp-system:collector-go-synthetic-basic-auth-secret-read
namespace: default
roleRef:
name: go-synthetic-basic-auth-secret-read
kind: Role
apiGroup: rbac.authorization.k8s.io
subjects:
- name: collector
namespace: gmp-system
kind: ServiceAccount
2 changes: 1 addition & 1 deletion examples/instrumentation/go-synthetic/go-synthetic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
spec:
containers:
- name: go-synthetic
# TODO(bwplotka): Move to go-synthetic image once released.
# TODO(bwplotka): Rename image to go-synthetic (example-app is misleading, we actually use go-synthetic).
image: gke.gcr.io/prometheus-engine/example-app@sha256:40658e4aff1f5c696f08037f1cb3f3b947096e378f4cbe89fe4187de72cd9358
args:
- "--listen-address=:8080"
Expand Down

0 comments on commit a357487

Please sign in to comment.