diff --git a/.gitignore b/.gitignore index 9d62d53..676abc7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ node_modules bin ihaq-* -.env \ No newline at end of file +.env +**.pub +juihaq +sshkey +id_rsa diff --git a/charts/api/templates/NOTES.txt b/charts/api/templates/NOTES.txt index dc76300..03fd657 100644 --- a/charts/api/templates/NOTES.txt +++ b/charts/api/templates/NOTES.txt @@ -1,21 +1,13 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "api.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. +################################################### +############## IHAQ API running ! ############## +################################################### +###### Logs : + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "api.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl logs $POD_NAME --namespace {{ .Release.Namespace }} +###### Service : +NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "api.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "api.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "api.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} +################################################### +################################################### diff --git a/charts/api/templates/deployment.yaml b/charts/api/templates/deployment.yaml index bde838d..46a4a42 100644 --- a/charts/api/templates/deployment.yaml +++ b/charts/api/templates/deployment.yaml @@ -27,7 +27,7 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - args: ["-redis-server-name", "api-redis-master"] + args: ["-redis-server-name", "ihaq-api-redis-master"] ports: - name: http containerPort: 8080 diff --git a/charts/client/templates/NOTES.txt b/charts/client/templates/NOTES.txt index 1b52f54..3fe1c4b 100644 --- a/charts/client/templates/NOTES.txt +++ b/charts/client/templates/NOTES.txt @@ -1,21 +1,13 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "client.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. +################################################### +############## IHAQ Client running ! ############## +################################################### +###### Logs : + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "client.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + kubectl logs $POD_NAME --namespace {{ .Release.Namespace }} +###### Service : +NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "client.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "client.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "client.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 -{{- end }} +################################################### +################################################### diff --git a/charts/client/templates/deployment.yaml b/charts/client/templates/deployment.yaml index 8cd5412..03ce68f 100644 --- a/charts/client/templates/deployment.yaml +++ b/charts/client/templates/deployment.yaml @@ -27,7 +27,7 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - args: ["-i", "192.168.64.2:31834"] + args: ["-i", "api.ihaq.juin.me"] ports: - name: http containerPort: 80 diff --git a/charts/client/templates/ingress.yaml b/charts/client/templates/ingress.yaml deleted file mode 100644 index 20f8cf8..0000000 --- a/charts/client/templates/ingress.yaml +++ /dev/null @@ -1,41 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "client.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "client.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ . }} - backend: - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} -{{- end }} diff --git a/charts/client/values.yaml b/charts/client/values.yaml index da00a88..7c7d95f 100644 --- a/charts/client/values.yaml +++ b/charts/client/values.yaml @@ -23,10 +23,12 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: -podSecurityContext: {} +podSecurityContext: + {} # fsGroup: 2000 -securityContext: {} +securityContext: + {} # capabilities: # drop: # - ALL @@ -35,22 +37,9 @@ securityContext: {} # runAsUser: 1000 service: - type: NodePort + type: LoadBalancer 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 diff --git a/charts/ingress/ingress.yaml b/charts/ingress/ingress.yaml new file mode 100644 index 0000000..375aa70 --- /dev/null +++ b/charts/ingress/ingress.yaml @@ -0,0 +1,22 @@ +kind: Ingress +apiVersion: extensions/v1beta1 +metadata: + name: ingress + annotations: + kubernetes.io/ingress.class: traefik +spec: + rules: + - host: api.ihaq.juin.me + http: + paths: + - path: / + backend: + serviceName: ihaq-api + servicePort: 8080 + - host: ihaq.juin.me + http: + paths: + - path: / + backend: + serviceName: ihaq-client + servicePort: http diff --git a/charts/ingress/values.yaml b/charts/ingress/values.yaml new file mode 100644 index 0000000..1980e3a --- /dev/null +++ b/charts/ingress/values.yaml @@ -0,0 +1,13 @@ +dashboard: + enabled: true + domain: dashboard.juin.me + auth: + basic: + julien: $apr1$4hq6z3e8$nXeunzoTgvUfcHslqQPAY. # Generated by htpasswd tool +kubernetes: + namespaces: + - default + - kube-system + +rbac: + enabled: true diff --git a/charts/worker/templates/deployment.yaml b/charts/worker/templates/deployment.yaml index d4ad7fa..94092db 100644 --- a/charts/worker/templates/deployment.yaml +++ b/charts/worker/templates/deployment.yaml @@ -27,7 +27,7 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - args: ["-redis-server-name", "api-redis-master"] + args: ["-redis-server-name", "ihaq-api-redis-master"] resources: {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} diff --git a/cmd/web/public/favicon.ico b/cmd/web/public/favicon.ico index a11777c..3857331 100644 Binary files a/cmd/web/public/favicon.ico and b/cmd/web/public/favicon.ico differ diff --git a/cmd/web/public/index.html b/cmd/web/public/index.html index a254ba4..cfd9be2 100644 --- a/cmd/web/public/index.html +++ b/cmd/web/public/index.html @@ -5,10 +5,7 @@ - +