Skip to content

Instantly share code, notes, and snippets.

@triangletodd
Last active May 24, 2019 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save triangletodd/520ee2d633d82c7a9edacb616c670776 to your computer and use it in GitHub Desktop.
Save triangletodd/520ee2d633d82c7a9edacb616c670776 to your computer and use it in GitHub Desktop.
VSCode Kubernetes Snippets
{
"k8s_secret": {
"prefix": "k8s_secret",
"scope": "plaintext,yaml",
"body": [
"apiVersion: v1",
"kind: Secret",
"metadata:",
" name: ${1:secret_name}",
"type: Opaque",
"data:",
" ${2:first_key}: ${3:first_value}",
],
"description": "k8s secret"
},
"k8s_ingress": {
"prefix": "k8s_ingress",
"scope": "plaintext,yaml",
"body": [
"apiVersion: extensions/v1beta1",
"kind: Ingress",
"metadata:",
" annotations:",
" ingress.gcp.kubernetes.io/pre-shared-cert: \"${4:star-vitalbook-com-01-21-2021,star-vitalsource-com-01-21-2021\"}",
" name: ${1:app_name}",
" namespace: ${2:default}",
"spec:",
" backend:",
" serviceName: ${1:app_name}",
" servicePort: ${3:http}",
],
"description": "k8s ingress"
},
"k8s_service": {
"prefix": "k8s_service",
"scope": "plaintext,yaml",
"body": [
"apiVersion: v1",
"kind: Service",
"metadata:",
" annotations:",
" cloud.google.com/backend-config: '{\"default\": \"${6:vst-default}\"}'",
" cloud.google.com/neg: '{\"ingress\": true}'",
" labels:",
" app: ${1:app_name}",
" tier: ${2:tier}",
" name: ${1:app_name}",
" namespace: ${3:default}",
"spec:",
" externalTrafficPolicy: ${4:Cluster}",
" ports:",
" - name: http",
" port: 80",
" protocol: TCP",
" targetPort: 80",
" selector:",
" app: ${1:app_name}",
" tier: ${2:tier}",
" sessionAffinity: None",
" type: ${5:type}",
],
"description": "k8s service"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment