diff --git a/templates/nginx-service.template.yaml b/templates/nginx-service.template.yaml new file mode 100644 index 0000000..5b0b1c5 --- /dev/null +++ b/templates/nginx-service.template.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: my-nginx-service + namespace: devnet +spec: + ports: + - port: 80 + protocol: TCP + selector: + name: my-nginx diff --git a/templates/nginx.template.yaml b/templates/nginx.template.yaml new file mode 100644 index 0000000..032e172 --- /dev/null +++ b/templates/nginx.template.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Pod +metadata: + labels: + name: my-nginx + name: my-nginx + namespace: devnet +spec: + containers: + - name: my-nginx-container + image: nginx:latest + ports: + - containerPort: 80 + protocol: TCP \ No newline at end of file diff --git a/templates/stacks-devnet-api-pod.template.yaml b/templates/stacks-devnet-api-pod.template.yaml new file mode 100644 index 0000000..60a4993 --- /dev/null +++ b/templates/stacks-devnet-api-pod.template.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Pod +metadata: + labels: + name: stacks-devnet-api + name: stacks-devnet-api + namespace: devnet +spec: + containers: + - command: + - ./stacks-devnet-api + name: stacks-devnet-api-container + # image: nginx:latest + image: stacks-devnet-api + imagePullPolicy: Never + ports: + - containerPort: 8477 + name: api + protocol: TCP \ No newline at end of file diff --git a/templates/stacks-devnet-api-service.template.yaml b/templates/stacks-devnet-api-service.template.yaml new file mode 100644 index 0000000..2d3e7f8 --- /dev/null +++ b/templates/stacks-devnet-api-service.template.yaml @@ -0,0 +1,67 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: stacks-devnet-api-service-account + namespace: devnet + +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: stacks-devnet-api-service-account +rules: + - apiGroups: [""] + resources: ["pods", "services", "configmaps", "pvc"] + verbs: ["get", "delete", "create"] + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: stacks-devnet-api-service-account +subjects: + - kind: ServiceAccount + name: stacks-devnet-api-service-account +roleRef: + kind: ClusterRole + name: stacks-devnet-api-service-account + apiGroup: rbac.authorization.k8s.io + +--- +apiVersion: v1 +kind: Pod +metadata: + labels: + name: stacks-devnet-api + name: stacks-devnet-api + namespace: devnet +spec: + serviceAccountName: stacks-devnet-api-service-account + containers: + - command: ["DEVELOPMENT=TRUE ./stacks-devnet-api"] + name: stacks-devnet-api-container + # image: nginx:latest + image: stacks-devnet-api + imagePullPolicy: Never + ports: + - containerPort: 8477 + name: api + protocol: TCP + +--- +apiVersion: v1 +kind: Service +metadata: + name: stacks-devnet-api-service + namespace: devnet +spec: + ports: + - name: api + port: 8477 + protocol: TCP + targetPort: 8477 + nodePort: 30000 + selector: + name: stacks-devnet-api + type: NodePort +