-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add go-synthetic (example-app) yaml for auth example
Signed-off-by: bwplotka <[email protected]>
- Loading branch information
1 parent
cea558f
commit a357487
Showing
2 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
109 changes: 109 additions & 0 deletions
109
examples/instrumentation/go-synthetic/go-synthetic-basic-auth.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters