A controller for mananging Kubernetes Service and Ingress resources based on the the results of environment-exporter, in order to expose the ports inside Environment to the public internet.
Name | Default | Description |
---|---|---|
APP_EXPORTER_ENDPOINT | http://environment-exporter.default:10093 | The endpoint for environment-exporter |
APP_EXTERNAL_IP | "" | The IP which the Pair instance is accessible from |
APP_ENVIRONMENT_NAMESPACE | default | The namespace where Environment is deployed |
APP_ENVIRONMENT_BASE_DOMAIN | _.pair.sharing.io | The DNS base domain assigned to the Pair instance (e.g: mycoolinstance.pair.sharing.io) |
APP_INGRESS_CLASS_NAME | nginx | The Ingress class to use for exposing |
apiVersion: v1
kind: ServiceAccount
metadata:
name: environment-exposer
namespace: pair-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: environment-exposer
namespace: default
rules:
- apiGroups:
- ""
resources:
- services
verbs:
- get
- list
- create
- delete
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- get
- list
- create
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: environment-exposer
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: environment-exposer
subjects:
- kind: ServiceAccount
name: environment-exposer
namespace: pair-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: environment-exposer
namespace: pair-system
spec:
selector:
matchLabels:
app: environment-exposer
template:
metadata:
labels:
app: environment-exposer
spec:
serviceAccountName: environment-exposer
containers:
- name: environment-exposer
image: registry.gitlab.com/sharingio/environment/exposer:latest
imagePullPolicy: IfNotPresent
securityContext:
runAsUser: 1000
runAsGroup: 1000
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
env:
- name: APP_EXPORTER_ENDPOINT
value: http://environment-exporter.default:10093
- name: APP_EXTERNAL_IP
value: 127.0.0.1 # replace with useful IP
- name: APP_ENVIRONMENT_DEFAULT_NAMESPACE
value: default
- name: APP_ENVIRONMENT_BASE_DOMAIN
value: _.pair.sharing.io # replace with real host
volumeMounts:
- name: template-folder
mountPath: /home/ii/.sharing.io/cluster-api/exposer/templates
volumes:
- name: template-folder
hostPath:
path: /home/ii/.sharing.io/cluster-api/exposer/templates