Created
October 6, 2022 11:17
-
-
Save userbradley/bdf5b8b3d053c28d945f966ba32ec9ba to your computer and use it in GitHub Desktop.
service attachment
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
## deployment.yml | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: psc-ilb | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: psc-ilb | |
template: | |
metadata: | |
labels: | |
app: psc-ilb | |
spec: | |
containers: | |
- name: whereami | |
image: us-docker.pkg.dev/google-samples/containers/gke/whereami:v1.2.8 | |
ports: | |
- name: http | |
containerPort: 8080 | |
readinessProbe: | |
httpGet: | |
path: /healthz | |
port: 8080 | |
scheme: HTTP | |
initialDelaySeconds: 5 | |
timeoutSeconds: 1 | |
## service.yml | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: service-connect | |
annotations: | |
networking.gke.io/load-balancer-type: "Internal" | |
spec: | |
type: LoadBalancer | |
selector: | |
app: psc-ilb | |
ports: | |
- port: 80 | |
targetPort: 8080 | |
protocol: TCP | |
## Service-attachment.yml | |
apiVersion: networking.gke.io/v1 | |
kind: ServiceAttachment | |
metadata: | |
name: whereami | |
namespace: default | |
spec: | |
connectionPreference: ACCEPT_AUTOMATIC | |
natSubnets: | |
- service-subnet-1 | |
proxyProtocol: false | |
resourceRef: | |
kind: Service | |
name: service-connect | |
# This will error for a while, chillax. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment