diff --git a/.gitignore b/.gitignore index 05f0edd..e76baf6 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ __pycache__/ security/letsencrypt/introduction/certs/** kubernetes/shipa/installs/shipa-helm-chart-1.1.1/ messaging/kafka/data/* +kubernetes/portainer/volume* diff --git a/kubernetes/portainer/example-application/configmap.yaml b/kubernetes/portainer/example-application/configmap.yaml new file mode 100644 index 0000000..e9e3124 --- /dev/null +++ b/kubernetes/portainer/example-application/configmap.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: example-config +data: + config.json: | + { + "environment" : "dev" + } +# kubectl create configmap example-config --from-file ./golang/configs/config.json diff --git a/kubernetes/portainer/example-application/deployment.yaml b/kubernetes/portainer/example-application/deployment.yaml new file mode 100644 index 0000000..b66f5d1 --- /dev/null +++ b/kubernetes/portainer/example-application/deployment.yaml @@ -0,0 +1,43 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: example-deploy + labels: + app: example-app + test: test +spec: + selector: + matchLabels: + app: example-app + replicas: 2 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + template: + metadata: + labels: + app: example-app + spec: + containers: + - name: example-app + image: aimvector/python:1.0.3 + imagePullPolicy: Always + ports: + - containerPort: 5000 + resources: + requests: + memory: "64Mi" + cpu: "50m" + limits: + memory: "256Mi" + cpu: "500m" + volumeMounts: + - name: config-volume + mountPath: /configs/ + volumes: + - name: config-volume + configMap: + name: example-config diff --git a/kubernetes/portainer/example-application/ingress.yaml b/kubernetes/portainer/example-application/ingress.yaml new file mode 100644 index 0000000..1b49a62 --- /dev/null +++ b/kubernetes/portainer/example-application/ingress.yaml @@ -0,0 +1,17 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: example-ingress +spec: + ingressClassName: nginx + rules: + - host: marcel.test + http: + paths: + - path: /hello + pathType: Prefix + backend: + service: + name: example-service + port: + number: 80 \ No newline at end of file diff --git a/kubernetes/portainer/example-application/service.yaml b/kubernetes/portainer/example-application/service.yaml new file mode 100644 index 0000000..7302b6d --- /dev/null +++ b/kubernetes/portainer/example-application/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: example-service + labels: + app: example-app +spec: + type: ClusterIP + selector: + app: example-app + ports: + - protocol: TCP + name: http + port: 80 + targetPort: 5000 \ No newline at end of file