-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨(playbook) introduce static services
Add support for static services, with fixed name, in addition to the services deployed with a deployment stamp in their name. It allows applications inside the cluster to use the services exposed by other applications, with a consistent fqdn. BREAKING CHANGE : blue/green related tasks are now updating static services instead of routes
- Loading branch information
Showing
37 changed files
with
429 additions
and
117 deletions.
There are no files selected for viewing
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
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
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
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
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,30 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: edxapp | ||
service: nginx | ||
deployment_stamp: "{{ deployment_stamp }}" | ||
service_prefix: "{{ prefix }}" | ||
type: static-service | ||
removable: "no" | ||
name: "edxapp-nginx-{{ prefix }}" | ||
namespace: "{{ project_name }}" | ||
spec: | ||
ports: | ||
- name: "{{ edxapp_nginx_cms_port }}-tcp" | ||
port: {{ edxapp_nginx_cms_port }} | ||
protocol: TCP | ||
targetPort: {{ edxapp_nginx_cms_port }} | ||
- name: "{{ edxapp_nginx_lms_port }}-tcp" | ||
port: {{ edxapp_nginx_lms_port }} | ||
protocol: TCP | ||
targetPort: {{ edxapp_nginx_lms_port }} | ||
- name: "{{ edxapp_nginx_healthcheck_port }}-tcp" | ||
port: {{ edxapp_nginx_healthcheck_port }} | ||
protocol: TCP | ||
targetPort: {{ edxapp_nginx_healthcheck_port }} | ||
selector: | ||
app: edxapp | ||
deploymentconfig: "edxapp-nginx-{{ deployment_stamp | default('undefined', true) }}" | ||
type: ClusterIP |
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
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,26 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: edxec | ||
service: nginx | ||
deployment_stamp: "{{ deployment_stamp }}" | ||
service_prefix: "{{ prefix }}" | ||
type: static-service | ||
removable: "no" | ||
name: "edxec-nginx-{{ prefix }}" | ||
namespace: "{{ project_name }}" | ||
spec: | ||
ports: | ||
- name: {{ edxec_nginx_port }}-tcp | ||
port: {{ edxec_nginx_port }} | ||
protocol: TCP | ||
targetPort: {{ edxec_nginx_port }} | ||
- name: "{{ edxec_nginx_healthcheck_port }}-tcp" | ||
port: {{ edxec_nginx_healthcheck_port }} | ||
protocol: TCP | ||
targetPort: {{ edxec_nginx_healthcheck_port }} | ||
selector: | ||
app: edxec | ||
deploymentconfig: "edxec-nginx-{{ deployment_stamp | default('undefined', true) }}" | ||
type: ClusterIP |
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
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,22 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: forum | ||
service: forum | ||
deployment_stamp: "{{ deployment_stamp }}" | ||
service_prefix: "{{ prefix }}" | ||
type: static-service | ||
removable: "no" | ||
name: "forum-app-{{ prefix }}" | ||
namespace: "{{ project_name }}" | ||
spec: | ||
ports: | ||
- name: "{{ forum_port }}-tcp" | ||
port: {{ forum_port }} | ||
protocol: TCP | ||
targetPort: {{ forum_port }} | ||
selector: | ||
app: forum | ||
deploymentconfig: "forum-app-{{ deployment_stamp | default('undefined', true) }}" | ||
type: ClusterIP |
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
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,20 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: hello | ||
deployment_stamp: "{{ deployment_stamp }}" | ||
service_prefix: "{{ prefix }}" | ||
type: static-service | ||
removable: "no" | ||
name: "hello-app-{{ prefix }}" | ||
namespace: "{{ project_name }}" | ||
spec: | ||
ports: | ||
- name: {{ hello_app_port }}-tcp | ||
port: {{ hello_app_port }} | ||
protocol: TCP | ||
targetPort: {{ hello_app_port }} | ||
type: ClusterIP | ||
selector: | ||
deploymentconfig: "hello-app-{{ deployment_stamp | default('undefined', true) }}" |
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
26 changes: 26 additions & 0 deletions
26
apps/learninglocker/templates/services/nginx/static-svc.yml.j2
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,26 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: learninglocker | ||
service: nginx | ||
deployment_stamp: "{{ deployment_stamp }}" | ||
service_prefix: "{{ prefix }}" | ||
type: static-service | ||
removable: "no" | ||
name: "learninglocker-nginx-{{ prefix }}" | ||
namespace: "{{ project_name }}" | ||
spec: | ||
ports: | ||
- name: "{{ learninglocker_nginx_port }}-tcp" | ||
port: {{ learninglocker_nginx_port }} | ||
protocol: TCP | ||
targetPort: {{ learninglocker_nginx_port }} | ||
- name: "{{ learninglocker_nginx_healthcheck_port }}-tcp" | ||
port: {{ learninglocker_nginx_healthcheck_port }} | ||
protocol: TCP | ||
targetPort: {{ learninglocker_nginx_healthcheck_port }} | ||
selector: | ||
app: learninglocker | ||
deploymentconfig: "learninglocker-nginx-{{ deployment_stamp | default('undefined', true) }}" | ||
type: ClusterIP |
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
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,26 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: marsha | ||
service: nginx | ||
deployment_stamp: "{{ deployment_stamp }}" | ||
service_prefix: "{{ prefix }}" | ||
type: static-service | ||
removable: "no" | ||
name: "marsha-nginx-{{ prefix }}" | ||
namespace: "{{ project_name }}" | ||
spec: | ||
ports: | ||
- name: {{ marsha_nginx_port }}-tcp | ||
port: {{ marsha_nginx_port }} | ||
protocol: TCP | ||
targetPort: {{ marsha_nginx_port }} | ||
- name: "{{ marsha_nginx_healthcheck_port }}-tcp" | ||
port: {{ marsha_nginx_healthcheck_port }} | ||
protocol: TCP | ||
targetPort: {{ marsha_nginx_healthcheck_port }} | ||
selector: | ||
app: marsha | ||
deploymentconfig: "marsha-nginx-{{ deployment_stamp | default('undefined', true) }}" | ||
type: ClusterIP |
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
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,26 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: richie | ||
service: nginx | ||
service_prefix: "{{ prefix }}" | ||
deployment_stamp: "{{ deployment_stamp }}" | ||
type: static-service | ||
removable: "no" | ||
name: "richie-nginx-{{ prefix }}" | ||
namespace: "{{ project_name }}" | ||
spec: | ||
ports: | ||
- name: {{ richie_nginx_port }}-tcp | ||
port: {{ richie_nginx_port }} | ||
protocol: TCP | ||
targetPort: {{ richie_nginx_port }} | ||
- name: "{{ richie_nginx_healthcheck_port }}-tcp" | ||
port: {{ richie_nginx_healthcheck_port }} | ||
protocol: TCP | ||
targetPort: {{ richie_nginx_healthcheck_port }} | ||
type: ClusterIP | ||
selector: | ||
app: richie | ||
deploymentconfig: "richie-nginx-{{ deployment_stamp | default('undefined', true) }}" |
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,20 @@ | ||
- hosts: local | ||
gather_facts: False | ||
|
||
pre_tasks: | ||
- import_tasks: tasks/check_configuration.yml | ||
|
||
tasks: | ||
- name: Display playbook name | ||
debug: msg="==== Starting create_services playbook ====" | ||
tags: deploy | ||
|
||
- import_tasks: tasks/set_vars.yml | ||
|
||
- include_tasks: tasks/run_tasks_for_apps.yml | ||
vars: | ||
tasks: | ||
- get_objects_for_app | ||
- create_static_services | ||
tags: | ||
- static_service |
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
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
Oops, something went wrong.