Skip to content

Instantly share code, notes, and snippets.

@alexisP
Last active September 5, 2023 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexisP/189da9404b84a17d85909d391d7e5577 to your computer and use it in GitHub Desktop.
Save alexisP/189da9404b84a17d85909d391d7e5577 to your computer and use it in GitHub Desktop.
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: sample-app
labels:
app: sample-app
spec:
containers:
- image: "aplantin.azurecr.io/sample-app:1.0"
name: sample-app
ports:
- containerPort: 8080
protocol: TCP
EOF
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
name: sample-app-service
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
spec:
type: LoadBalancer
selector:
app: sample-app
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8080
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment