blob: d4d482aeb2145e52a883e3e4316dfbedbeddcdaf [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: ssh-devcontainer
namespace: nuvolaris
labels:
app: ssh-devcontainer
spec:
serviceName: ssh-devcontainer
replicas: 1
selector:
matchLabels:
app: ssh-devcontainer
template:
metadata:
labels:
app: ssh-devcontainer
spec:
hostname: ssh-devcontainer
volumes:
- name: workspace
hostPath:
path: /workspace
- name: nginx-config
configMap:
name: nginx-proxy-config
containers:
- name: devcontainer
image: $IMAGE
ports:
- containerPort: 2222
name: ssh
protocol: TCP
securityContext:
runAsUser: $USERID
runAsGroup: $USERID
volumeMounts:
- name: workspace
mountPath: /home/workspace
env:
- name: OPS_USER
value: $OPS_USER
- name: OPS_PASSWORD
value: $OPS_PASSWORD
- name: OPS_APIHOST
value: $OPS_APIHOST
- name: DEBIAN_FRONTEND
value: noninteractive
- name: SSHKEY
valueFrom:
secretKeyRef:
name: ssh-secret
key: authorized_keys
- name: reverse-proxy
image: nginx:alpine
ports:
- containerPort: 80
name: http
protocol: TCP
command: ["nginx", "-g", "daemon off;"]
volumeMounts:
- name: nginx-config
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-proxy-config
namespace: nuvolaris
data:
nginx.conf: |
events {
worker_connections 1024;
}
http {
client_max_body_size 1g;
server {
listen 80;
server_name miniops.me *.miniops.me;
location / {
proxy_pass http://ingress-nginx-controller.ingress-nginx.svc.cluster.local;
proxy_set_header Host $$host;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto http;
}
}
}
---
apiVersion: v1
kind: Service
metadata:
name: ssh-devcontainer
namespace: nuvolaris
labels:
app: ssh-devcontainer
spec:
type: NodePort
selector:
app: ssh-devcontainer
ports:
- port: 2222
targetPort: 2222
nodePort: 30222
protocol: TCP
name: ssh