Skip to content

Instantly share code, notes, and snippets.

@thisismsreddy
Created November 2, 2020 09:36
Show Gist options
  • Save thisismsreddy/c23428ea027c82bd98ed6009295442b4 to your computer and use it in GitHub Desktop.
Save thisismsreddy/c23428ea027c82bd98ed6009295442b4 to your computer and use it in GitHub Desktop.
This is example yaml file will create a nginx service and use octivia load balancer to expose service to public ip.
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-http-nginx-deployment
spec:
replicas: 4
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
name: external-http-nginx-service
annotations:
service.beta.kubernetes.io/openstack-internal-load-balancer: "false"
loadbalancer.openstack.org/floating-network-id: "425c54bb-c4f2-41d6-a63c-a5c87257c929"
spec:
selector:
app: nginx
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment