release 3.5.0

This commit is contained in:
havelight-ee
2023-03-30 10:06:08 +09:00
parent c9ac62623a
commit 25d0ef82ea
37 changed files with 3576 additions and 2640 deletions

View File

@@ -5,7 +5,9 @@
environment: environment:
KUBECONFIG: /root/.kube/ansible_config KUBECONFIG: /root/.kube/ansible_config
roles: roles:
# - role: cmoa_os_setting - role: cmoa_os_setting
- role: cmoa_install - role: cmoa_install
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
# --user ubuntu --ask-pass --ask-become-pass

View File

@@ -1,11 +1,11 @@
[master] [master]
10.10.43.210 10.10.43.200
[worker1] [worker1]
10.10.43.211 10.10.43.201
[worker2] [worker2]
10.10.43.212 10.10.43.202
[cluster:children] [cluster:children]
master master

View File

@@ -17,6 +17,10 @@ kubernetes_metric_server_file: "{{ role_path }}/files/components.yaml"
ansible_kube_config: "/tmp/agent_config" ansible_kube_config: "/tmp/agent_config"
crio:
os: xUbuntu_20.04
version: 1.26
containerd_config: containerd_config:
version: 2 version: 2
root: /var/lib/containerd root: /var/lib/containerd

View File

@@ -1,9 +1,27 @@
--- ---
- name: Add crio yum repository - name: Import GPG key_1
command: sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_7/devel:kubic:libcontainers:stable.repo apt_key:
url: https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:{{ crio.version }}/{{ crio.os }}/Release.key
state: present
become: true
- name: Add crio yum repository - name: Import GPG key_2
command: sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:1.23.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:1.23/CentOS_7/devel:kubic:libcontainers:stable:cri-o:1.23.repo apt_key:
url: https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/{{ crio.os }}/Release.key
state: present
become: true
- name: Add crio repository_1
apt_repository:
repo: deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/{{crio.os }}/ /
state: present
filename: devel:kubic:libcontainers:stable.list
- name: Add crio repository_2
apt_repository:
repo: deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio.version }}/{{ crio.os }}/ /
state: present
filename: devel:kubic:libcontainers:stable:cri-o:{{ crio.version }}.list
- name: Create crio configuration directory - name: Create crio configuration directory
file: file:
@@ -19,8 +37,9 @@
- name: Install required packages - name: Install required packages
apt: apt:
name: name: ['cri-o', 'cri-o-runc']
- crio state: present
update_cache: yes
notify: notify:
- Reload systemd configuration - Reload systemd configuration
- Restart crio service - Restart crio service

View File

@@ -4,13 +4,13 @@ helm_version: v3.10.3
# cmoa info # cmoa info
cmoa_namespace: imxc cmoa_namespace: imxc
cmoa_version: rel3.4.9 cmoa_version: rel3.5.0
# files/00-default in role # files/00-default in role
docker_secret_file: secret_nexus.yaml docker_secret_file: secret_nexus.yaml
# all, jaeger, jspd # all, jaeger, jspd
imxc_ui: all #imxc_ui: jspd
# [docker_config_path] # [docker_config_path]
docker_config_nexus: dockerconfig/docker_config_nexus.json docker_config_nexus: dockerconfig/docker_config_nexus.json
@@ -35,6 +35,11 @@ elasticsearch_service_name: elasticsearch
elasticsearch_service_port: 9200 elasticsearch_service_port: 9200
elasticsearch_nodePort: 30200 elasticsearch_nodePort: 30200
# [postgres]
postgres_service_name: postgres
postgres_service_port: 5432
postgres_nodePort: 32431
# [Keycloak] # [Keycloak]
# Keycloak configuration settings # Keycloak configuration settings
keycloak_http_port: 31082 keycloak_http_port: 31082
@@ -55,7 +60,7 @@ keycloak_clients:
- name: 'authorization_server' - name: 'authorization_server'
client_id: authorization_server client_id: authorization_server
realm: exem realm: exem
redirect_uris: "http://{{ ansible_default_ipv4.address }}:31080/*,http://{{ ansible_default_ipv4.address }}:31084/*,http://localhost:8080/*,http://localhost:8081/*" redirect_uris: "http://{{ ansible_default_ipv4.address }}:31080/*,http://localhost:8080/*,http://localhost:8081/*"
public_client: True public_client: True
# default ip/version (not change) # default ip/version (not change)

View File

@@ -1,8 +1,9 @@
#!/bin/bash #!/bin/bash
kubectl -n imxc wait --for=condition=ready pod/elasticsearch-1 --timeout=600s
namespace=$1 namespace=$1
kubectl -n ${namespace} wait --for=condition=ready pod/elasticsearch-1 --timeout=600s
export ES_NODEPORT=`kubectl -n ${namespace} get svc elasticsearch -o jsonpath='{.spec.ports[*].nodePort}'` export ES_NODEPORT=`kubectl -n ${namespace} get svc elasticsearch -o jsonpath='{.spec.ports[*].nodePort}'`
export MASTER_IP=`kubectl get node -o wide | grep control-plane | awk '{print $6}'` export MASTER_IP=`kubectl get node -o wide | grep control-plane | awk '{print $6}'`

File diff suppressed because one or more lines are too long

0
roles/cmoa_install/files/03-ddl-dml/postgres/pg.sh Normal file → Executable file
View File

View File

View File

@@ -47,7 +47,18 @@ ALTER TABLE ONLY public.alert_target
ALTER TABLE ONLY public.alert_target ALTER TABLE ONLY public.alert_target
ADD CONSTRAINT fkjrvj775641ky7s0f82kx3sile FOREIGN KEY (alert_group_id) REFERENCES public.alert_group(id); ADD CONSTRAINT fkjrvj775641ky7s0f82kx3sile FOREIGN KEY (alert_group_id) REFERENCES public.alert_group(id);
CREATE TABLE public.report_group (
id bigint NOT NULL,
created_by character varying(255),
created_date timestamp without time zone,
modified_by character varying(255),
modified_date timestamp without time zone,
users text,
name character varying(255)
);
ALTER TABLE public.report_group OWNER TO admin;
ALTER TABLE ONLY public.report_group ADD CONSTRAINT report_group_pkey PRIMARY KEY (id);
CREATE TABLE public.report_template ( CREATE TABLE public.report_template (
id bigint NOT NULL, id bigint NOT NULL,
@@ -59,7 +70,8 @@ CREATE TABLE public.report_template (
enable boolean NOT NULL, enable boolean NOT NULL,
metric_data text, metric_data text,
template_data text, template_data text,
title character varying(255) title character varying(255),
report_group_id int8 NULL
); );
ALTER TABLE public.report_template OWNER TO admin; ALTER TABLE public.report_template OWNER TO admin;
@@ -67,6 +79,19 @@ ALTER TABLE public.report_template OWNER TO admin;
ALTER TABLE ONLY public.report_template ALTER TABLE ONLY public.report_template
ADD CONSTRAINT report_template_pkey PRIMARY KEY (id); ADD CONSTRAINT report_template_pkey PRIMARY KEY (id);
CREATE TABLE public.report_group_registry (
id bigint NOT NULL,
report_template_id bigint NOT NULL,
report_group_id bigint NOT NULL
);
ALTER TABLE public.report_group_registry OWNER TO admin;
ALTER TABLE ONLY public.report_group_registry ADD CONSTRAINT report_group_registry_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.report_group_registry ADD CONSTRAINT report_group_registry_template_id_fk FOREIGN KEY (report_template_id) REFERENCES public.report_template(id);
ALTER TABLE ONLY public.report_group_registry ADD CONSTRAINT report_group_registry_group_id_fk FOREIGN KEY (report_group_id) REFERENCES public.report_group(id);
CREATE TABLE public.alert_event ( CREATE TABLE public.alert_event (
id bigint NOT NULL, id bigint NOT NULL,
created_date timestamp without time zone NOT NULL, created_date timestamp without time zone NOT NULL,

File diff suppressed because one or more lines are too long

View File

@@ -1,36 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: manual
namespace: imxc
spec:
selector:
matchLabels:
app: manual
replicas: 1
template:
metadata:
labels:
app: manual
spec:
containers:
- name: manual
image: {{ .Values.global.IMXC_IN_REGISTRY }}/manual:{{ .Values.global.CMOA_MANUAL_VERSION }}
imagePullPolicy: IfNotPresent
---
apiVersion: v1
kind: Service
metadata:
name: manual
namespace: imxc
spec:
type: NodePort
selector:
app: manual
ports:
- protocol: TCP
port: 8088
targetPort: 3000
nodePort: {{ .Values.global.CMOA_MANUAL_PORT }}

View File

@@ -1,75 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: imxc-ui-config-jaeger
namespace: imxc
data:
properties.file: |
api.url = {{ .Values.global.SERVELET_URL_PROTOCOL }}://{{ .Values.global.ZUUL_SERVER_IP }}:{{ .Values.global.ZUUL_SERVER_PORT }}
config.js: |
window.appEnv = {
// Env Settings servletURL
offlineAccess: "{{ .Values.global.OFFLINEACCESS }}",
backLogin: "{{ .Values.global.BACKLOGIN }}",
servletURL: "{{ .Values.global.SERVELET_URL_PROTOCOL }}://{{ .Values.global.ZUUL_SERVER_IP }}:{{ .Values.global.ZUUL_SERVER_PORT }}",
demoServletURL: "{{ .Values.global.DEMO_SERVELET_URL_PROTOCOL }}://{{ .Values.global.ZUUL_SERVER_IP }}:{{ .Values.global.ZUUL_SERVER_PORT }}",
// Env Settings socketURL
socketURL: "http://{{ .Values.global.NOTI_SERVER_IP }}:{{ .Values.global.NOTI_SERVER_PORT }}/ui-server-websocket",
manualURL: "http://{{ .Values.global.CMOA_MANUAL_SERVER_IP }}:{{ .Values.global.CMOA_MANUAL_PORT }}",
// Env Settings interMaxURL
interMaxURL: "http://{{ .Values.global.INTERMAX_IP }}:8080/intermax/?",
// Env Settings CloudMOA Version
version: '{{ .Values.global.CLOUDMOA_UI_VERSION }}',
UI_build_ver: '{{ .Values.global.UI_SERVER_VERSION }}',
maxSelectionSize: 30,
loginType: 'keycloak',
keyCloak: {
"realm": "{{ .Values.global.KEYCLOAK_REALM }}",
"auth-server-url": "{{ .Values.global.KEYCLOAK_AUTH_SERVER_URL }}",
"ssl-required": "none",
"resource": "{{ .Values.global.KEYCLOAK_RESOURCE }}",
"public-client": true,
"confidential-port": 0
},
healthIndicatorStateInfo: [
{
state: "critical",
// max: 1.0,
// over: 0.8,
max: 100,
over: 80,
text: "Critical",
color: "#ff4040",
level: 4,
}, {
state: "warning",
// max: 0.8,
// over: 0.5,
max: 80,
over: 50,
text: "Warning",
color: "#ffa733",
level: 3,
}, {
state: "attention",
// max: 0.5,
// over: 0.0,
max: 50,
over: 0,
text: "Attention",
// color: "#B4B83D",
color: "#1cbe85",
level: 2,
}, {
state: "normal",
max: 0,
over: 0,
text: "Normal",
// color: "#64B87D",
color: "#24b0ed",
level: 1,
},
]
};

View File

@@ -1,63 +0,0 @@
---
kind: Service
apiVersion: v1
metadata:
name: imxc-ui-service-jaeger
namespace: imxc
spec:
type: NodePort
selector:
app: imxc-ui-jaeger
ports:
- protocol: TCP
name: ui
port: 80
targetPort: 9999
nodePort: 31084
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: imxc-ui-jaeger
namespace: imxc
labels:
app: imxc-ui
spec:
revisionHistoryLimit: 0
replicas: 1
selector:
matchLabels:
app: imxc-ui-jaeger
template:
metadata:
labels:
app: imxc-ui-jaeger
spec:
containers:
- name: imxc-ui-jaeger
image: {{ .Values.global.IMXC_IN_REGISTRY }}/ui-server:{{ .Values.global.UI_SERVER_VERSION }}
resources:
requests:
cpu: 100m
memory: 50Mi
limits:
cpu: 200m
memory: 100Mi
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
volumeMounts:
- name: config-profile
mountPath: /usr/src/app/web/env
- name: config-server
mountPath: /usr/src/app/config
volumes:
- name: config-profile
configMap:
name: imxc-ui-config-jaeger
items:
- key: "config.js"
path: "config.js"
- name: config-server
configMap:
name: imxc-ui-config-jaeger

View File

@@ -1,94 +0,0 @@
# Default values for imxc.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: 10.10.31.243:5000/cmoa3/nginx
tag: stable
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}
global:
INTERMAX_IP:
SERVELET_URL_PROTOCOL : http
DEMO_SERVELET_URL_PROTOCOL : http
KEYCLOAK_AUTH_SERVER_URL: http://111.111.111.111:31082/auth
KEYCLOAK_RESOURCE: authorization_server
KEYCLOAK_REALM: exem
IMXC_IN_REGISTRY: 10.10.31.243:5000/cmoa3
ZUUL_SERVER_IP: 111.111.111.111
ZUUL_SERVER_PORT: 31081
NOTI_SERVER_IP: 111.111.111.111
NOTI_SERVER_PORT: 31083
CMOA_MANUAL_SERVER_IP: 111.111.111.111
CMOA_MANUAL_PORT: 31090
OFFLINEACCESS: false
BACKLOGIN: false
CLOUDMOA_VERSION: rel0.0.0
UI_SERVER_VERSION: rel0.0.0
CMOA_MANUAL_VERSION: rel0.0.0

View File

@@ -1,5 +0,0 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: imxc
version: 0.1.0

View File

@@ -1,16 +0,0 @@
#! /bin/sh
STATUS_CODE="$(curl -s -o /dev/null -w '%{http_code}' http://imxc-keycloak-http/auth/realms/exem)"
if [ $STATUS_CODE -eq 200 ]; then
JWT_KEY="$(curl -s -XGET http://imxc-keycloak-http/auth/realms/exem | jq -r '.public_key')"
export JWT_KEY
chmod -R 777 /home/cloudmoa/notification/cloudmoa_alert.log
java -Djava.security.egd=file:/dev/./urandom -jar /app.jar
elif [ $STATUS_CODE -eq 404 ]; then
echo "not found exem relam. check realm in imxc-keycloak"
else
echo "not found keycloak. check to install keycloak"
fi

View File

@@ -1,36 +0,0 @@
#! /bin/bash
# 200 -> 서버 및 realm이 있는 경우
# 404 -> 서버는 있으나 realm이 없는 경우
# 000 -> 서버가 없음
STATUS_CODE="$(curl -s -o /dev/null -w '%{http_code}' http://imxc-keycloak-http/auth/realms/exem)"
if [ $STATUS_CODE -eq 404 ]; then
TOKEN="$(curl -s -d "client_id=admin-cli" -d "username=admin" -d "password=admin" -d "grant_type=password" http://imxc-keycloak-http/auth/realms/master/protocol/openid-connect/token | jq -r '.access_token')"
echo $TOKEN
echo "create realm and client"
# create realm and client
curl -s -v POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d "@/tmp/init.json" http://imxc-keycloak-http/auth/admin/realms
echo "create admin and owner"
# create admin and owner
curl -s -v POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"firstName":"","lastName":"", "username":"admin","email":"admin@example.com", "enabled":"true","credentials":[{"type":"password","value":"admin","temporary":false}]}' http://imxc-keycloak-http/auth/admin/realms/exem/users
curl -s -v POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"firstName":"","lastName":"", "username":"owner","email":"owner@example.com", "enabled":"true","credentials":[{"type":"password","value":"admin","temporary":false}]}' http://imxc-keycloak-http/auth/admin/realms/exem/users
JWT_KEY="$(curl -s -XGET http://imxc-keycloak-http/auth/realms/exem | jq -r '.public_key')"
export JWT_KEY
java -Djava.security.egd=file:/dev/./urandom -jar /app.jar
elif [ $STATUS_CODE -eq 200 ]; then
echo "exist exem relam"
JWT_KEY="$(curl -s -XGET http://imxc-keycloak-http/auth/realms/exem | jq -r '.public_key')"
export JWT_KEY
java -Djava.security.egd=file:/dev/./urandom -jar /app.jar
else
echo "not found keycloak. check to install keycloak"
fi

View File

@@ -1,14 +0,0 @@
#! /bin/sh
STATUS_CODE="$(curl -s -o /dev/null -w '%{http_code}' http://imxc-keycloak-http/auth/realms/exem)"
if [ $STATUS_CODE -eq 200 ]; then
JWT_KEY="$(curl -s -XGET http://imxc-keycloak-http/auth/realms/exem | jq -r '.public_key')"
export JWT_KEY
java -Djava.security.egd=file:/dev/./urandom -jar /app.jar
elif [ $STATUS_CODE -eq 404 ]; then
echo "not found exem relam. check realm in imxc-keycloak"
else
echo "not found keycloak. check to install keycloak"
fi

View File

@@ -1,6 +0,0 @@
#!/bin/sh
chmod -R 777 /scripts
sed -i "s/localhost/$REDIRECT_URLS/g" /scripts/init.json
cp /scripts/init.json /tmp/init.json

View File

@@ -17,7 +17,8 @@ data:
socketURL: "http://{{ .Values.global.NOTI_SERVER_IP }}:{{ .Values.global.NOTI_SERVER_PORT }}/ui-server-websocket", socketURL: "http://{{ .Values.global.NOTI_SERVER_IP }}:{{ .Values.global.NOTI_SERVER_PORT }}/ui-server-websocket",
// Env Settings interMaxURL // Env Settings interMaxURL
// ex) ~/intermax/?paConnect=1&paType=ResponseInspector&fromTime=1556096539206&toTime=1556096599206&serverName=jeus89 // ex) ~/intermax/?paConnect=1&paType=ResponseInspector&fromTime=1556096539206&toTime=1556096599206&serverName=jeus89
interMaxURL: "", interMaxURL: "http://{{ .Values.global.INTERMAX_IP }}:{{ .Values.global.INTERMAX_PORT }}/intermax/?",
manualURL: "http://{{ .Values.global.CMOA_MANUAL_SERVER_IP }}:{{ .Values.global.CMOA_MANUAL_PORT }}", manualURL: "http://{{ .Values.global.CMOA_MANUAL_SERVER_IP }}:{{ .Values.global.CMOA_MANUAL_PORT }}",
// Env Settings CloudMOA Version // Env Settings CloudMOA Version
version: '{{ .Values.global.CLOUDMOA_VERSION }}', version: '{{ .Values.global.CLOUDMOA_VERSION }}',

View File

@@ -69,6 +69,7 @@ affinity: {}
global: global:
INTERMAX_IP: INTERMAX_IP:
INTERMAX_PORT:
SERVELET_URL_PROTOCOL : http SERVELET_URL_PROTOCOL : http
DEMO_SERVELET_URL_PROTOCOL : http DEMO_SERVELET_URL_PROTOCOL : http
KEYCLOAK_AUTH_SERVER_URL: http://111.111.111.111:31082/auth KEYCLOAK_AUTH_SERVER_URL: http://111.111.111.111:31082/auth

View File

@@ -49,3 +49,20 @@
port: "{{ elasticsearch_service_port }}" port: "{{ elasticsearch_service_port }}"
nodePort: "{{ elasticsearch_nodePort }}" nodePort: "{{ elasticsearch_nodePort }}"
apply: yes apply: yes
- name: 6. Change a Postgres Service (NodePort=postgres_nodePort)
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Service
metadata:
name: "{{ postgres_service_name }}"
namespace: "{{ cmoa_namespace }}"
spec:
type: NodePort
ports:
- protocol: TCP
port: "{{ postgres_service_port }}"
nodePort: "{{ postgres_nodePort }}"
apply: yes

View File

@@ -1,79 +1,4 @@
--- ---
- name: 1. helmchart install (imxc-ui-all)
kubernetes.core.helm:
name: "{{item}}"
release_name: "{{item}}"
release_namespace: "{{ cmoa_namespace }}"
chart_ref: "{{ role_path }}/files/06-imxc-ui/{{ item }}"
create_namespace: yes
release_state: present
values_files:
- "{{ role_path }}/files/06-imxc-ui/{{ item }}/values.yaml"
with_items:
- imxc-ui-jaeger
- imxc-ui-jspd
when: imxc_ui == 'all'
- name: 1. helmchart install (imxc-ui-jaeger)
kubernetes.core.helm:
name: "{{item}}"
release_name: "{{item}}"
release_namespace: "{{ cmoa_namespace }}"
chart_ref: "{{ role_path }}/files/06-imxc-ui/{{ item }}"
create_namespace: yes
release_state: present
values_files:
- "{{ role_path }}/files/06-imxc-ui/{{ item }}/values.yaml"
with_items:
- imxc-ui-jaeger
when: imxc_ui == 'jaeger'
- name: 2. Change a imxc-ui Service (imxc-ui-jaeger)
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Service
metadata:
name: "{{ jaeger_servicename }}"
namespace: "{{ cmoa_namespace }}"
spec:
type: NodePort
ports:
- protocol: TCP
port: "{{ jaeger_service_port }}"
nodePort: "{{ jaeger_nodePort }}"
apply: yes
when: imxc_ui == 'jaeger'
- name: 2. Get a list of all pods from the namespace
command: kubectl -n "{{ cmoa_namespace }}" get pods --no-headers -o custom-columns=":metadata.name" # Output is a column
register: pod_list
when: imxc_ui != 'all'
- name: 3. Copy psql file in psql (imxc-jaeger)
kubernetes.core.k8s_cp:
namespace: "{{ cmoa_namespace }}"
pod: "{{ item }}"
remote_path: /tmp/jaeger_menumeta.psql
local_path: "{{ role_path }}/files/03-ddl-dml/postgres/jaeger_menumeta.psql"
with_items: "{{ pod_list.stdout_lines }}"
when:
- item is match('postgres')
- imxc_ui == 'jaeger'
ignore_errors: true
- name: 4. Execute a command in psql (imxc-jaeger)
kubernetes.core.k8s_exec:
namespace: "{{ cmoa_namespace }}"
pod: "{{ item }}"
command: bash -c "PGPASSWORD='eorbahrhkswp' && /usr/bin/psql -h 'localhost' -U 'admin' -d 'postgresdb' -f /tmp/jaeger_menumeta.psql"
with_items: "{{ pod_list.stdout_lines }}"
when:
- item is match('postgres')
- imxc_ui == 'jaeger'
ignore_errors: true
- name: 1. helmchart install (imxc-ui-jspd) - name: 1. helmchart install (imxc-ui-jspd)
kubernetes.core.helm: kubernetes.core.helm:
name: "{{item}}" name: "{{item}}"
@@ -85,27 +10,7 @@
values_files: values_files:
- "{{ role_path }}/files/06-imxc-ui/{{ item }}/values.yaml" - "{{ role_path }}/files/06-imxc-ui/{{ item }}/values.yaml"
with_items: with_items:
- imxc-ui-jspd - imxc-ui
when: imxc_ui == 'jspd'
ignore_errors: true
- name: 3. Copy psql file in postgres (imxc-ui-jspd)
kubernetes.core.k8s_cp:
namespace: "{{ cmoa_namespace }}"
pod: "{{ item }}"
remote_path: /tmp/jspd_menumeta.psql
local_path: "{{ role_path }}/files/03-ddl-dml/postgres/jspd_menumeta.psql"
with_items: "{{ pod_list.stdout_lines }}"
when: item is match('postgres') and imxc_ui == 'jspd'
ignore_errors: true
- name: 4. Execute a command in postgres (imxc-ui-jspd)
kubernetes.core.k8s_exec:
namespace: "{{ cmoa_namespace }}"
pod: "{{ item }}"
command: bash -c "PGPASSWORD='eorbahrhkswp' && /usr/bin/psql -h 'localhost' -U 'admin' -d 'postgresdb' -f /tmp/jspd_menumeta.psql"
with_items: "{{ pod_list.stdout_lines }}"
when: item is match('postgres') and imxc_ui == 'jspd'
ignore_errors: true ignore_errors: true
- name: 2. Check Kubernetes Pods (imxc ui) - name: 2. Check Kubernetes Pods (imxc ui)

View File

@@ -0,0 +1,112 @@
---
- name: 1. helmchart install (imxc-ui-all)
kubernetes.core.helm:
name: "{{item}}"
release_name: "{{item}}"
release_namespace: "{{ cmoa_namespace }}"
chart_ref: "{{ role_path }}/files/06-imxc-ui/{{ item }}"
create_namespace: yes
release_state: present
values_files:
- "{{ role_path }}/files/06-imxc-ui/{{ item }}/values.yaml"
with_items:
- imxc-ui-jaeger
- imxc-ui-jspd
when: imxc_ui == 'all'
- name: 1. helmchart install (imxc-ui-jaeger)
kubernetes.core.helm:
name: "{{item}}"
release_name: "{{item}}"
release_namespace: "{{ cmoa_namespace }}"
chart_ref: "{{ role_path }}/files/06-imxc-ui/{{ item }}"
create_namespace: yes
release_state: present
values_files:
- "{{ role_path }}/files/06-imxc-ui/{{ item }}/values.yaml"
with_items:
- imxc-ui-jaeger
when: imxc_ui == 'jaeger'
- name: 2. Change a imxc-ui Service (imxc-ui-jaeger)
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Service
metadata:
name: "{{ jaeger_servicename }}"
namespace: "{{ cmoa_namespace }}"
spec:
type: NodePort
ports:
- protocol: TCP
port: "{{ jaeger_service_port }}"
nodePort: "{{ jaeger_nodePort }}"
apply: yes
when: imxc_ui == 'jaeger'
- name: 2. Get a list of all pods from the namespace
command: kubectl -n "{{ cmoa_namespace }}" get pods --no-headers -o custom-columns=":metadata.name" # Output is a column
register: pod_list
when: imxc_ui != 'all'
- name: 3. Copy psql file in psql (imxc-jaeger)
kubernetes.core.k8s_cp:
namespace: "{{ cmoa_namespace }}"
pod: "{{ item }}"
remote_path: /tmp/jaeger_menumeta.psql
local_path: "{{ role_path }}/files/03-ddl-dml/postgres/jaeger_menumeta.psql"
with_items: "{{ pod_list.stdout_lines }}"
when:
- item is match('postgres')
- imxc_ui == 'jaeger'
ignore_errors: true
- name: 4. Execute a command in psql (imxc-jaeger)
kubernetes.core.k8s_exec:
namespace: "{{ cmoa_namespace }}"
pod: "{{ item }}"
command: bash -c "PGPASSWORD='eorbahrhkswp' && /usr/bin/psql -h 'localhost' -U 'admin' -d 'postgresdb' -f /tmp/jaeger_menumeta.psql"
with_items: "{{ pod_list.stdout_lines }}"
when:
- item is match('postgres')
- imxc_ui == 'jaeger'
ignore_errors: true
- name: 1. helmchart install (imxc-ui-jspd)
kubernetes.core.helm:
name: "{{item}}"
release_name: "{{item}}"
release_namespace: "{{ cmoa_namespace }}"
chart_ref: "{{ role_path }}/files/06-imxc-ui/{{ item }}"
create_namespace: yes
release_state: present
values_files:
- "{{ role_path }}/files/06-imxc-ui/{{ item }}/values.yaml"
with_items:
- imxc-ui-jspd
when: imxc_ui == 'jspd'
ignore_errors: true
- name: 3. Copy psql file in postgres (imxc-ui-jspd)
kubernetes.core.k8s_cp:
namespace: "{{ cmoa_namespace }}"
pod: "{{ item }}"
remote_path: /tmp/jspd_menumeta.psql
local_path: "{{ role_path }}/files/03-ddl-dml/postgres/jspd_menumeta.psql"
with_items: "{{ pod_list.stdout_lines }}"
when: item is match('postgres') and imxc_ui == 'jspd'
ignore_errors: true
- name: 4. Execute a command in postgres (imxc-ui-jspd)
kubernetes.core.k8s_exec:
namespace: "{{ cmoa_namespace }}"
pod: "{{ item }}"
command: bash -c "PGPASSWORD='eorbahrhkswp' && /usr/bin/psql -h 'localhost' -U 'admin' -d 'postgresdb' -f /tmp/jspd_menumeta.psql"
with_items: "{{ pod_list.stdout_lines }}"
when: item is match('postgres') and imxc_ui == 'jspd'
ignore_errors: true
- name: 2. Check Kubernetes Pods (imxc ui)
command: "{{ role_path }}/files/k8s_status {{ cmoa_namespace }}"

View File

@@ -12,6 +12,5 @@
msg: msg:
- ======================================================================================= - =======================================================================================
- "## CloudMOA WEB " - "## CloudMOA WEB "
- CloudMOA Jaeger = http://{{ ansible_default_ipv4.address }}:31080 - http://{{ ansible_default_ipv4.address }}:31080
- CloudMOA JSPD = http://{{ ansible_default_ipv4.address }}:31084
- ======================================================================================= - =======================================================================================

View File

@@ -3,8 +3,8 @@
tags: worker-dir tags: worker-dir
when: kubernetes_role == 'node' when: kubernetes_role == 'node'
- include: helm-install.yml #- include: helm-install.yml
tags: helm-install # tags: helm-install
- include: 00-default-settings-master.yml - include: 00-default-settings-master.yml
tags: default_setting tags: default_setting

View File

@@ -1,9 +1,27 @@
--- ---
- name: Add crio yum repository - name: Import GPG key_1
command: sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_7/devel:kubic:libcontainers:stable.repo apt_key:
url: https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:{{ crio.version }}/{{ crio.os }}/Release.key
state: present
become: true
- name: Add crio yum repository - name: Import GPG key_2
command: sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:1.23.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:1.23/CentOS_7/devel:kubic:libcontainers:stable:cri-o:1.23.repo apt_key:
url: https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/{{ crio.os }}/Release.key
state: present
become: true
- name: Add crio repository_1
apt_repository:
repo: deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/{{crio.os }}/ /
state: present
filename: devel:kubic:libcontainers:stable.list
- name: Add crio repository_2
apt_repository:
repo: deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio.version }}/{{ crio.os }}/ /
state: present
filename: devel:kubic:libcontainers:stable:cri-o:{{ crio.version }}.list
- name: Create crio configuration directory - name: Create crio configuration directory
file: file:
@@ -19,8 +37,9 @@
- name: Install required packages - name: Install required packages
apt: apt:
name: name: ['cri-o', 'cri-o-runc']
- crio state: present
update_cache: yes
notify: notify:
- Reload systemd configuration - Reload systemd configuration
- Restart crio service - Restart crio service

3087
test.sh Normal file

File diff suppressed because it is too large Load Diff